www.pudn.com > Proximity-sample.zip > PeerFinderScenario.xaml.h, change:2012-06-01,size:3085b


//********************************************************* 
// 
// Copyright (c) Microsoft. All rights reserved. 
// This code is licensed under the Microsoft Public License. 
// 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. 
// 
//********************************************************* 
 
// 
// PeerFinderScenario.xaml.h 
// Declaration of the PeerFinderScenario class 
// 
 
#pragma once 
 
#include "pch.h" 
#include "PeerFinderScenario.g.h" 
#include "MainPage.xaml.h" 
 
namespace ProximityCPP 
{ 
    /// <summary> 
    /// An empty page that can be used on its own or navigated to within a Frame. 
    /// </summary> 
    public ref class PeerFinderScenario sealed 
    { 
    public: 
        PeerFinderScenario(); 
 
    protected: 
        virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override; 
        virtual void OnNavigatingFrom(Windows::UI::Xaml::Navigation::NavigatingCancelEventArgs ^ e) override; 
    private: 
 
        void TriggeredConnectionStateChangedEventHandler(Object^ sender, Windows::Networking::Proximity::TriggeredConnectionStateChangedEventArgs^ e); 
        void ConnectionRequestedEventHandler(Object^ sender, Windows::Networking::Proximity::ConnectionRequestedEventArgs^ e); 
        void PeerFinder_StartFindingPeers(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); 
        void PeerFinder_BrowsePeers(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); 
        void PeerFinder_Accept(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); 
        void PeerFinder_Connect(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); 
        void SocketError(Platform::String^ errMessage); 
        void PeerFinder_Send(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); 
 
        void PeerFinderInit(); 
        void PeerFinderReset(); 
        void Scenario2Reset(); 
        void PeerFinder_StartSendReceive(); 
        void PeerFinder_StartReader(); 
 
        //members 
        MainPage^ m_rootPage; 
        Windows::UI::Core::CoreDispatcher^ m_coreDispatcher; 
        bool m_peerFinderStarted; 
        Windows::Foundation::Collections::IVectorView<Windows::Networking::Proximity::PeerInformation^>^ m_peerInformationList; 
        Windows::Networking::Proximity::PeerInformation^ m_requestingPeer; 
        Windows::Networking::Sockets::StreamSocket^ m_socket; 
        Windows::Storage::Streams::DataWriter^ m_dataWriter; 
        Windows::Storage::Streams::DataReader^ m_dataReader; 
        bool m_triggeredConnectSupported; 
        bool m_browseConnectSupported; 
        bool m_startPeerFinderImmediately; 
        bool m_socketClosed; 
        Windows::Foundation::EventRegistrationToken m_triggerToken; 
        Windows::Foundation::EventRegistrationToken m_connectionRequestedToken; 
 
        //connection states 
        Platform::Collections::Vector<Platform::String^>^ m_ConnectStateArray; 
    }; 
}