561. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2/1/2017 2:56:50 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.

561.1 Files compared

# 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\Plug-ins AdvancedPlugin.cs Tue Dec 20 19:51:42 2016 UTC
2 Wed Feb 1 19:56:50 2017 UTC

561.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 0 0
Changed 0 0
Inserted 0 0
Removed 1 106

561.3 Comparison options

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

561.4 Active regular expressions

No regular expressions were active.

561.5 Comparison detail

1   // ======= ========== ========== ========== ========== ========== ========== ==        
2   //  This f ile is par t of the M icrosoft C RM SDK Cod e 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   //<snippet AdvancedPl ugin>        
17   using Syst em;        
18          
19   // Microso ft Dynamic s CRM name space(s)        
20   using Micr osoft.Xrm. Sdk;        
21          
22   namespace  Microsoft. Crm.Sdk.Sa mples        
23   {        
24       public  class Adv ancedPlugi n : IPlugi n        
25       {        
26           pr ivate read only strin g _unsecur eString;        
27           pr ivate read only strin g _secureS tring;        
28          
29           pu blic Advan cedPlugin( string uns ecureStrin g, string  secureStri ng)        
30           {        
31                if (Stri ng.IsNullO rWhiteSpac e(unsecure String) ||        
32                    Stri ng.IsNullO rWhiteSpac e(secureSt ring))        
33                {        
34                    thro w new Inva lidOperati onExceptio n        
35                         ("Unsecure  and secur e strings  are requir ed by the  Advanced P lug-in, bu t not prov ided.");        
36                }        
37          
38                _unsecur eString =  unsecureSt ring;        
39                _secureS tring = se cureString ;        
40           }        
41           // / <summary >        
42           // / A plug-i n that upd ates the d escription  field wit h values         
43           // / from the  unsecure  and secure  construct or paramet ers.        
44           // / </summar y>        
45           // / <remarks >Register  this plug- in on the  Update mes sage, cont act entity ,        
46           // / pre-Oper ation and  synchronou s mode. Se e the Read me for mor e informat ion.        
47           // / </remark s>        
48           pu blic void  Execute(IS erviceProv ider servi ceProvider )        
49           {        
50                //<snipp etAdvanced Plugin2>        
51                //Extrac t the trac ing servic e for use  in debuggi ng sandbox ed plug-in s.        
52                ITracing Service tr acingServi ce =        
53                    (ITr acingServi ce)service Provider.G etService( typeof(ITr acingServi ce));        
54          
55                // Obtai n the exec ution cont ext from t he service  provider.        
56                IPluginE xecutionCo ntext cont ext = (IPl uginExecut ionContext )        
57                    serv iceProvide r.GetServi ce(typeof( IPluginExe cutionCont ext));        
58          
59                // For t his sample , execute  the plug-i n code onl y while th e client i s online.         
60                tracingS ervice.Tra ce("Advanc edPlugin:  Verifying  the client  is not of fline.");        
61                if (cont ext.IsExec utingOffli ne || cont ext.IsOffl inePlaybac k)        
62                    retu rn;        
63          
64                // The I nputParame ters colle ction cont ains all t he data pa ssed         
65                // in th e message  request.        
66                if (cont ext.InputP arameters. Contains(" Target") & &        
67                    cont ext.InputP arameters[ "Target"]  is Entity)        
68                {        
69                    // O btain the  target ent ity from t he Input P arameters.        
70                    trac ingService .Trace        
71                         ("Advanced Plugin: Ge tting the  target ent ity from I nput Param eters.");        
72                    Enti ty entity  = (Entity) context.In putParamet ers["Targe t"];        
73          
74                    // O btain the  image enti ty from th e Pre Enti ty Images.        
75                    trac ingService .Trace        
76                         ("Advanced Plugin: Ge tting imag e entity f rom PreEnt ityImages. ");        
77                    //<s nippetAdva ncedPlugin 1>        
78                    Enti ty image =  (Entity)c ontext.Pre EntityImag es["Target "];        
79                    //</ snippetAdv ancedPlugi n1>        
80                    //</ snippetAdv ancedPlugi n2>        
81          
82                    // V erify that  the targe t entity r epresents  a contact.        
83                    // I f not, thi s plug-in  was not re gistered c orrectly.        
84                    trac ingService .Trace        
85                         ("Advanced Plugin: Ve rifying th at the tar get entity  represent s a contac t.");        
86                    if ( entity.Log icalName ! = "contact ")        
87                         return;        
88          
89                    trac ingService .Trace("Ad vancedPlug in: Creati ng the des cription." );        
90                    Stri ng descrip tionMessag e = "Old f ull name:  " +        
91                         image["ful lname"] +  " -- Unsec ured: " +  _unsecureS tring +        
92                         ", Secured : " + _sec ureString;        
93          
94                    trac ingService .Trace        
95                         ("Advanced Plugin: Ch ecking if  the target  entity do esn't have  a descrip tion attri bute.");        
96                    if ( entity.Att ributes.Co ntains("de scription" ) == false )        
97                    {        
98                         tracingSer vice.Trace        
99                             ("Adva ncedPlugin : Adding a  descripti on attribu te with th e new valu e.");        
100                         entity.Att ributes.Ad d("descrip tion", des criptionMe ssage);        
101                    }        
102                }        
103           }        
104       }        
105   }        
106   //</snippe tAdvancedP lugin>