Produced by Araxis Merge on 2/1/2017 2:56:20 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM\trunk\SDK\SampleCode\CS\Azure\Plug-ins | SandboxPlugin.cs | Tue Dec 20 19:51:42 2016 UTC |
| 2 | Wed Feb 1 19:56:20 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 86 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | // ======= ========== ========== ========== ========== ========== ========== ========== = | |||||
| 2 | // This f ile is par t of the M icrosoft D ynamics CR M SDK Code Samples. | |||||
| 3 | // | |||||
| 4 | // Copyri ght (C) Mi crosoft Co rporation. All righ ts reserve d. | |||||
| 5 | // | |||||
| 6 | // This s ource code is intend ed only as a supplem ent to Mic rosoft | |||||
| 7 | // Develo pment Tool s and/or o n-line doc umentation . See the se other | |||||
| 8 | // materi als for de tailed inf ormation r egarding M icrosoft c ode sample s. | |||||
| 9 | // | |||||
| 10 | // THIS C ODE AND IN FORMATION ARE PROVID ED "AS IS" WITHOUT W ARRANTY OF ANY | |||||
| 11 | // KIND, EITHER EXP RESSED OR IMPLIED, I NCLUDING B UT NOT LIM ITED TO TH E | |||||
| 12 | // IMPLIE D WARRANTI ES OF MERC HANTABILIT Y AND/OR F ITNESS FOR A | |||||
| 13 | // PARTIC ULAR PURPO SE. | |||||
| 14 | // | |||||
| 15 | // ======= ========== ========== ========== ========== ========== ========== ========== = | |||||
| 16 | ||||||
| 17 | //<snippet SandboxPlu gin> | |||||
| 18 | using Syst em; | |||||
| 19 | using Syst em.Diagnos tics; | |||||
| 20 | using Syst em.Threadi ng; | |||||
| 21 | using Syst em.Runtime .Serializa tion; | |||||
| 22 | ||||||
| 23 | using Syst em.Service Model; | |||||
| 24 | using Syst em.Service Model.Chan nels; | |||||
| 25 | using Syst em.Service Model.Desc ription; | |||||
| 26 | ||||||
| 27 | using Micr osoft.Xrm. Sdk; | |||||
| 28 | ||||||
| 29 | namespace Microsoft. Crm.Sdk.Sa mples | |||||
| 30 | { | |||||
| 31 | /// <s ummary> | |||||
| 32 | /// A custom plu g-in that can post t he executi on context of the cu rrent mess age to the Windows | |||||
| 33 | /// Az ure Servic e Bus. The plug-in a lso demons trates tra cing which assist wi th | |||||
| 34 | /// de bugging fo r plug-ins that are registered in the sa ndbox. | |||||
| 35 | /// </ summary> | |||||
| 36 | /// <r emarks>Thi s sample r equires th at a servi ce endpoin t be creat ed first, and its ID passed | |||||
| 37 | /// to the plug- in constru ctor throu gh the uns ecure conf iguration parameter when the p lug-in | |||||
| 38 | /// st ep is regi stered.</r emarks> | |||||
| 39 | public sealed cl ass Sandbo xPlugin : IPlugin | |||||
| 40 | { | |||||
| 41 | pr ivate Guid serviceEn dpointId; | |||||
| 42 | ||||||
| 43 | // / <summary > | |||||
| 44 | // / Construc tor. | |||||
| 45 | // / </summar y> | |||||
| 46 | pu blic Sandb oxPlugin(s tring conf ig) | |||||
| 47 | { | |||||
| 48 | if (Stri ng.IsNullO rEmpty(con fig) || !G uid.TryPar se(config, out servi ceEndpoint Id)) | |||||
| 49 | { | |||||
| 50 | thro w new Inva lidPluginE xecutionEx ception("S ervice end point ID s hould be p assed as c onfig."); | |||||
| 51 | } | |||||
| 52 | } | |||||
| 53 | ||||||
| 54 | pu blic void Execute(IS erviceProv ider servi ceProvider ) | |||||
| 55 | { | |||||
| 56 | // Retri eve the ex ecution co ntext. | |||||
| 57 | IPluginE xecutionCo ntext cont ext = (IPl uginExecut ionContext )servicePr ovider.Get Service(ty peof(IPlug inExecutio nContext)) ; | |||||
| 58 | ||||||
| 59 | // Extra ct the tra cing servi ce. | |||||
| 60 | ITracing Service tr acingServi ce = (ITra cingServic e)serviceP rovider.Ge tService(t ypeof(ITra cingServic e)); | |||||
| 61 | if (trac ingService == null) | |||||
| 62 | thro w new Inva lidPluginE xecutionEx ception("F ailed to r etrieve th e tracing service.") ; | |||||
| 63 | ||||||
| 64 | IService EndpointNo tification Service cl oudService = (IServi ceEndpoint Notificati onService) servicePro vider.GetS ervice(typ eof(IServi ceEndpoint Notificati onService) ); | |||||
| 65 | if (clou dService = = null) | |||||
| 66 | thro w new Inva lidPluginE xecutionEx ception("F ailed to r etrieve th e service bus servic e."); | |||||
| 67 | ||||||
| 68 | try | |||||
| 69 | { | |||||
| 70 | trac ingService .Trace("Po sting the execution context.") ; | |||||
| 71 | stri ng respons e = cloudS ervice.Exe cute(new E ntityRefer ence("serv iceendpoin t", servic eEndpointI d), contex t); | |||||
| 72 | if ( !String.Is NullOrEmpt y(response )) | |||||
| 73 | { | |||||
| 74 | tracingSer vice.Trace ("Response = {0}", r esponse); | |||||
| 75 | } | |||||
| 76 | trac ingService .Trace("Do ne."); | |||||
| 77 | } | |||||
| 78 | catch (E xception e ) | |||||
| 79 | { | |||||
| 80 | trac ingService .Trace("Ex ception: { 0}", e.ToS tring()); | |||||
| 81 | thro w; | |||||
| 82 | } | |||||
| 83 | } | |||||
| 84 | } | |||||
| 85 | } | |||||
| 86 | //</snippe tSandboxPl ugin> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.