<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <configSections>

    <!--Register service's custom configruation sections and group-->
    <sectionGroup name="microsoft.Hpc.Session.ServiceRegistration"
                  type="Microsoft.Hpc.Scheduler.Session.Configuration.ServiceRegistration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <section name="service"
               type="Microsoft.Hpc.Scheduler.Session.Configuration.ServiceConfiguration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
               allowDefinition="Everywhere"
               allowExeDefinition="MachineToApplication"
               />

    

    </sectionGroup>

    <sectionGroup name="microsoft.Hpc.Broker"
                  type="Microsoft.Hpc.Scheduler.Session.Configuration.BrokerConfigurations, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <section name="monitor"
               type="Microsoft.Hpc.Scheduler.Session.Configuration.BrokerMonitorConfiguration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
               allowDefinition="Everywhere"
               allowExeDefinition="MachineToApplication"
               />
      <section name="services"
               type="Microsoft.Hpc.Scheduler.Session.Configuration.BrokerServicesConfiguration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
               allowDefinition="Everywhere"
               allowExeDefinition="MachineToApplication"
               />
      <section name="loadBalancing"
               type="Microsoft.Hpc.Scheduler.Session.Configuration.LoadBalancingConfiguration, Microsoft.Hpc.Scheduler.Session, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
               allowDefinition="Everywhere"
               allowExeDefinition="MachineToApplication"
               />
    </sectionGroup>

	  <section name="PopupBasherConfiguration"
             type="Microsoft.Hpc.Excel.PopupBasherSectionHandler,Microsoft.Hpc.Excel,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35"
             allowDefinition="Everywhere"
             allowExeDefinition="MachineToApplication"
             />

  </configSections>

  <microsoft.Hpc.Session.ServiceRegistration>
    <service assembly="C:\Program Files\Microsoft HPC Pack 2008 R2\Bin\excel\HelloWorldService.dll" 
	     contract="HelloWorldService.IHelloWorldService"
             type="HelloWorldService.HelloWorldService" 
             includeExceptionDetailInFaults="true"
             maxConcurrentCalls="0"
                 >
    </service>
  </microsoft.Hpc.Session.ServiceRegistration>

  <!--Service broker's configuration-->
  <microsoft.Hpc.Broker>
    <!--configuration to control broker's monitoring behavior-->
    <monitor messageThrottleStartThreshold="4096"
             messageThrottleStopThreshold="3072"
             loadSamplingInterval="1000"
             allocationAdjustInterval="-1"
             clientIdleTimeout="30000000"
             clientConnectionTimeout="30000000"
             sessionIdleTimeout="300000"
             statusUpdateInterval="15000"/>
    <services>
      <!--Address templates used for Broker service-->
      <brokerServiceAddresses>
        <!--
            Two configuration is done to enable broker listen on this URI:
            1. Port 9091 is added to firewall exceptions
            2. Users group is allowed to register with NetTcp port sharing service
        -->
        <add baseAddress="net.tcp://localhost:9091/Broker"/>
        <!--Before using HTTP transport, make sure:
                1. The HTTP URI is correctly reserved for the user who is going to starts the session 
                   (using "netsh http add urlacl")and evaluate risk of allowing the user to listen on that URL
                2. Open the port in firewall
        -->
        <add baseAddress="http://localhost/Broker"/>
        <!--Before using HTTPS transport, make sure 
                1. The HTTPS URI is correctly reserved for the user who is going to starts the session 
                   (using "netsh http add urlacl") and evaluate risk of allowing the user to listen on that URL
                2. Open the port in firewall
                3. Valid certificate is installed for the machine
                4. the certificate is registered with HTTP listener ("netsh http add sslcert")
        -->
        <add baseAddress="https://localhost/Broker"/>
      </brokerServiceAddresses>
    </services>
    <loadBalancing messageResendLimit="3"
                   serviceOperationTimeout="86400000"
                   endpointNotFoundRetryCountLimit="10"
                   endpointNotFoundRetryPeriod="5000"/>
  </microsoft.Hpc.Broker>

  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <!--binding used by broker's front end service with security-->
        <binding name="Microsoft.Hpc.SecureNetTcpBrokerBinding" portSharingEnabled="true">
          <security mode="Transport"/>
        </binding>

        <!--binding used by broker's front end service with no security-->
        <binding name="Microsoft.Hpc.UnsecureNetTcpBrokerBinding" portSharingEnabled="true">
          <security mode="None"/>
        </binding>

        <!--binding used by broker's backend-->
        <binding name="Microsoft.Hpc.BackEndBinding">
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="None"/>
          </security>
        </binding>
      </netTcpBinding>

      <basicHttpBinding>
        <!--binding used by broker's front end service with security-->
        <binding name="Microsoft.Hpc.SecureHttpBrokerBinding">
          <security mode="TransportWithMessageCredential">
            <message clientCredentialType="UserName"/>
            <transport clientCredentialType="None"/>
          </security>
        </binding>

        <!--binding used by broker's front end service with no security-->
        <binding name="Microsoft.Hpc.UnsecureHttpBrokerBinding">
          <security mode="None"/>
        </binding>
      </basicHttpBinding>

      <customBinding>
        <binding name="Microsoft.Hpc.UnsecureCustomBrokerBinding">
          <tcpTransport portSharingEnabled="true"></tcpTransport>
        </binding>
      </customBinding>
    </bindings>

    <behaviors>
      <serviceBehaviors>
        <behavior name="throttling">
          <serviceThrottling maxConcurrentCalls="50"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

  <system.diagnostics>
	  <sources>
	    <source name="ExcelDriver" switchName="ExcelDriverSwitch"
		    switchType="System.Diagnostics.SourceSwitch">
	    </source>
	  </sources>
  		
    <switches>
	    <add name = "ExcelDriverSwitch" value="Error"/>
    </switches>

  </system.diagnostics>
  
  <!--
		Period = "2000" value in milliseconds for watching period
	-->
  <PopupBasherConfiguration Period="1000">
    <!--
			List each windows and children that we want to drive
			
			<Window
				Title = "Title of the window caption"
				Class = "Class name" => #32770 for dialog boxes, use companion tool like spy++ or AccExplorer32 to find them
			>
				<Child
					Title="Title of the window caption"
					Class="Class name" 
					Role="See role below" 
					Action="Supported action see below"
					Search="Search mode, Exact or by using Regular Expression"
				/>
			</Window>

			Action:
				DoDefault	=> The default action associated with the control will be executed
				Exist		=> Check existence

			Search :
				Exact		=> Search the title name by using exact noncasesensitive string matching
				RegEx		=> Search the title name by using a regular expression
							
			Role:
				ROLE_SYSTEM_TITLEBAR
				ROLE_SYSTEM_MENUBAR
				ROLE_SYSTEM_SCROLLBAR
				ROLE_SYSTEM_GRIP
				ROLE_SYSTEM_SOUND
				ROLE_SYSTEM_CURSOR
				ROLE_SYSTEM_CARET
				ROLE_SYSTEM_ALERT
				ROLE_SYSTEM_WINDOW
				ROLE_SYSTEM_CLIENT
				ROLE_SYSTEM_MENUPOPUP
				ROLE_SYSTEM_MENUITEM
				ROLE_SYSTEM_TOOLTIP
				ROLE_SYSTEM_APPLICATION
				ROLE_SYSTEM_DOCUMENT
				ROLE_SYSTEM_PANE
				ROLE_SYSTEM_CHART
				ROLE_SYSTEM_DIALOG
				ROLE_SYSTEM_BORDER
				ROLE_SYSTEM_GROUPING
				ROLE_SYSTEM_SEPARATOR
				ROLE_SYSTEM_TOOLBAR
				ROLE_SYSTEM_STATUSBAR
				ROLE_SYSTEM_TABLE
				ROLE_SYSTEM_COLUMNHEADER
				ROLE_SYSTEM_ROWHEADER
				ROLE_SYSTEM_COLUMN
				ROLE_SYSTEM_ROW
				ROLE_SYSTEM_CELL
				ROLE_SYSTEM_LINK
				ROLE_SYSTEM_HELPBALLOON
				ROLE_SYSTEM_CHARACTER
				ROLE_SYSTEM_LIST
				ROLE_SYSTEM_LISTITEM
				ROLE_SYSTEM_OUTLINE
				ROLE_SYSTEM_OUTLINEITEM
				ROLE_SYSTEM_PAGETAB
				ROLE_SYSTEM_PROPERTYPAGE
				ROLE_SYSTEM_INDICATOR
				ROLE_SYSTEM_GRAPHIC
				ROLE_SYSTEM_STATICTEXT
				ROLE_SYSTEM_TEXT
				ROLE_SYSTEM_PUSHBUTTON
				ROLE_SYSTEM_CHECKBUTTON
				ROLE_SYSTEM_RADIOBUTTON
				ROLE_SYSTEM_COMBOBOX
				ROLE_SYSTEM_DROPLIST
				ROLE_SYSTEM_PROGRESSBAR
				ROLE_SYSTEM_DIAL
				ROLE_SYSTEM_HOTKEYFIELD
				ROLE_SYSTEM_SLIDER
				ROLE_SYSTEM_SPINBUTTON
				ROLE_SYSTEM_DIAGRAM
				ROLE_SYSTEM_ANIMATION
				ROLE_SYSTEM_EQUATION
				ROLE_SYSTEM_BUTTONDROPDOWN
				ROLE_SYSTEM_BUTTONMENU
				ROLE_SYSTEM_BUTTONDROPDOWNGRID
				ROLE_SYSTEM_WHITESPACE
				ROLE_SYSTEM_PAGETABLIST
				ROLE_SYSTEM_CLOCK
				ROLE_SYSTEM_SPLITBUTTON
				ROLE_SYSTEM_IPADDRESS
				ROLE_SYSTEM_OUTLINEBUTTON
		-->
    <Windows>

      <!--
        This rule matches error popups you might get from an XLL written in VB
      <Window Title="Microsoft Visual Basic" Class="#32770">
        <Child	Title="*"
						Class="MSOUNISTAT" Role="ROLE_SYSTEM_WINDOW" Action="Exist" Search="RegEx" />
        <Child Title="Fin" Class="Button" Role="ROLE_SYSTEM_PUSHBUTTON" Action="DoDefault" Search="Exact"/>
      </Window>
-->

      <!--     
        This rule matches the VBA MsgBox dialog. Every time this pops up, this rule
        pushes the Ok button.
-->

      <Window Title="Microsoft Excel" Class="#32770">
        <Child Title="Ok" Role="ROLE_SYSTEM_PUSHBUTTON" Action="DoDefault" Search="Exact" />
      </Window>

      <!--     
        This rule matches the Excel File Open dialog. Every time this pops up, this rule
        pushes the Cancel button.
      <Window Title="Open">
        <Child Title="Cancel" Role="ROLE_SYSTEM_PUSHBUTTON" Action="DoDefault" Search="Exact"/>
      </Window>
-->

      <!--     
        This rule matches the Excel Insert Hyperlink dialog. Every time this pops up, this rule
        pushes the Cancel button.
      <Window Title="Insert Hyperlink">
        <Child Title="Cancel" Role="ROLE_SYSTEM_PUSHBUTTON" Action="DoDefault" Search="Exact"/>
      </Window>
      
-->

    </Windows>
  </PopupBasherConfiguration>
</configuration>
