This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using System; | |
| using System.Windows; | |
| namespace MyProject.WPF.Helpers | |
| { | |
| /// <summary> | |
| /// Allows an arbitrary UI element to bind keyboard focus to an attached property. | |
| /// </summary> | |
| public static class FocusBehaviour | |
| { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Create a trusted authority | |
| makecert -sv SignRoot.pvk -cy authority -r signroot.cer -a sha1 -n "CN=Dev Cert Authority" -ss my -sr localmachine | |
| # First install root auth certificate above (See comment), then... | |
| # Create authorised certificate for actual use | |
| makecert -iv SignRoot.pvk -ic signroot.cer -cy end -pe -n "CN=localhost" -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localmachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # language: en | |
| Feature: Division | |
| In order to avoid silly mistakes | |
| Cashiers must be able to calculate a fraction | |
| Scenario: Regular numbers | |
| Given I have entered 3 into the calculator | |
| And I have entered 2 into the calculator | |
| When I press divide | |
| Then the result should be 1.5 on the screen | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0"?> | |
| <configuration> | |
| <appSettings> | |
| <add key="di" value="<< your device id here >>" /> | |
| <add key="dp" value="<< your device password here>>" /> | |
| <add key="username" value="<< Live Id here >>" /> | |
| <add key="password" value="<< Live Id password here>>" /> | |
| <add key="serviceContextName" value="MyServiceContext" /> | |
| <add key="l" value="CS" /> | |
| <add key="codewriterfilter" value="SvcUtilFilter.CodeWriterFilter,SvcUtilFilter" /> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | private OrganizationServiceProxy _serviceProxy; | |
| private IOrganizationService _service; | |
| // Instance of your generated ServiceContext class | |
| private MyServiceContext _context; | |
| private ServerConnection _serverConnection; = new ServerConnection(); | |
| // This class can be found in the crmservicehelpers file under the samplecode\{language}\helpercode directory | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Contact contact = new Contact() | |
| { | |
| FirstName = "Testing", | |
| LastName = "McTesterson" | |
| }; | |
| _context.AddObject(contact); | |
| _context.SaveChanges(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | IList<Contact> testers = _context.ContactSet.Where(x => x.LastName == "McTesterson").ToList(); | |
| Contact tester = testers[0]; | |
| tester.FirstName = "Pete"; | |
| _context.UpdateObject(tester); | |
| _context.SaveChanges(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // FAIL | |
| _context.ContactSet.Where(x => !string.IsNullOrEmpty(x.LastName)); | |
| // WIN | |
| _context.ContactSet.Where(x => x.LastName != null && x.LastName != string.Empty); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | contact.FirstName = "Tom"; | |
| // Assign record to new owner | |
| AssignRequest assign = new AssignRequest | |
| { | |
| Assignee = new EntityReference(SystemUser.EntityLogicalName, newOwnerId), | |
| Target = new EntityReference(Contact.EntityLogicalName, contact.Id) | |
| }; | |
| _context.UpdateObject(contact); | 
OlderNewer