Produced by Araxis Merge on 2/1/2017 2:56:29 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\CrmSvcUtilExtensions\GeneratePicklistEnums | FilteringService.cs | Tue Dec 20 19:51:44 2016 UTC |
| 2 | Wed Feb 1 19:56:29 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 1 | 126 |
| 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 | // | |||||
| 3 | // This f ile is par t of the M icrosoft D ynamics CR M SDK Code Samples. | |||||
| 4 | // | |||||
| 5 | // Copyri ght (C) Mi crosoft Co rporation. All righ ts reserve d. | |||||
| 6 | // | |||||
| 7 | // This s ource code is intend ed only as a supplem ent to Mic rosoft | |||||
| 8 | // Develo pment Tool s and/or o nline docu mentation. See thes e other | |||||
| 9 | // materi als for de tailed inf ormation r egarding M icrosoft c ode sample s. | |||||
| 10 | // | |||||
| 11 | // THIS C ODE AND IN FORMATION ARE PROVID ED "AS IS" WITHOUT W ARRANTY OF ANY | |||||
| 12 | // KIND, EITHER EXP RESSED OR IMPLIED, I NCLUDING B UT NOT LIM ITED TO TH E | |||||
| 13 | // IMPLIE D WARRANTI ES OF MERC HANTABILIT Y AND/OR F ITNESS FOR A | |||||
| 14 | // PARTIC ULAR PURPO SE. | |||||
| 15 | // | |||||
| 16 | // ======= ========== ========== ========== ========== ========== ========== == | |||||
| 17 | //<snippet FilteringS ervice> | |||||
| 18 | ||||||
| 19 | // Define SKIP_STATE _OPTIONSET S if you p lan on usi ng this ex tension in conjuncti on with | |||||
| 20 | // the une xtended Cr mSvcUtil, since it a lready gen erates sta te options ets. | |||||
| 21 | #define SK IP_STATE_O PTIONSETS | |||||
| 22 | ||||||
| 23 | using Syst em; | |||||
| 24 | using Syst em.Collect ions.Gener ic; | |||||
| 25 | using Micr osoft.Crm. Services.U tility; | |||||
| 26 | using Micr osoft.Xrm. Sdk.Metada ta; | |||||
| 27 | ||||||
| 28 | namespace Microsoft. Crm.Sdk.Sa mples | |||||
| 29 | { | |||||
| 30 | /// <s ummary> | |||||
| 31 | /// Cr eate an im plementati on of ICod eWriterFil terService if you wa nt to prov ide your o wn | |||||
| 32 | /// lo gic for wh ether or n ot a given item will have code generated for it. | |||||
| 33 | /// </ summary> | |||||
| 34 | public sealed cl ass Filter ingService : ICodeWr iterFilter Service | |||||
| 35 | { | |||||
| 36 | pr ivate Dict ionary<Str ing, bool> Generated OptionSets { get; se t; } | |||||
| 37 | ||||||
| 38 | pr ivate ICod eWriterFil terService DefaultSe rvice { ge t; set; } | |||||
| 39 | ||||||
| 40 | pu blic Filte ringServic e(ICodeWri terFilterS ervice def aultServic e) | |||||
| 41 | { | |||||
| 42 | DefaultS ervice = d efaultServ ice; | |||||
| 43 | Generate dOptionSet s = new Di ctionary<S tring, boo l>(); | |||||
| 44 | } | |||||
| 45 | ||||||
| 46 | // / <summary > | |||||
| 47 | // / Does not mark the OptionSet for genera tion if it has alrea dy been ma rked for | |||||
| 48 | // / generati on. | |||||
| 49 | // / </summar y> | |||||
| 50 | pu blic bool GenerateOp tionSet( | |||||
| 51 | OptionSe tMetadataB ase option SetMetadat a, IServic eProvider services) | |||||
| 52 | { | |||||
| 53 | #if SKIP _STATE_OPT IONSETS | |||||
| 54 | // O nly skip t he state o ptionsets if the use r of the e xtension w ishes to. | |||||
| 55 | if ( optionSetM etadata.Op tionSetTyp e == Optio nSetType.S tate) | |||||
| 56 | { | |||||
| 57 | return fal se; | |||||
| 58 | } | |||||
| 59 | #endif | |||||
| 60 | ||||||
| 61 | if (opti onSetMetad ata.IsGlob al.HasValu e && optio nSetMetada ta.IsGloba l.Value) | |||||
| 62 | { | |||||
| 63 | if ( !Generated OptionSets .ContainsK ey(optionS etMetadata .Name)) | |||||
| 64 | { | |||||
| 65 | GeneratedO ptionSets[ optionSetM etadata.Na me] = true ; | |||||
| 66 | return tru e; | |||||
| 67 | } | |||||
| 68 | } | |||||
| 69 | else | |||||
| 70 | { | |||||
| 71 | retu rn true; | |||||
| 72 | } | |||||
| 73 | return f alse; | |||||
| 74 | } | |||||
| 75 | ||||||
| 76 | // / <summary > | |||||
| 77 | // / Ideally, we wouldn 't generat e any attr ibutes, bu t we must in order t o leverage | |||||
| 78 | // / the logi c in CrmSv cUtil. If the attri bute for a n OptionSe t is not g enerated, | |||||
| 79 | // / then a n ull refere nce except ion is thr own when a ttempting to create the | |||||
| 80 | // / OptionSe t. We wil l remove t hese in ou r ICustomi zeCodeDomS ervice imp lementatio n. | |||||
| 81 | // / </summar y> | |||||
| 82 | pu blic bool GenerateAt tribute( | |||||
| 83 | Attribut eMetadata attributeM etadata, I ServicePro vider serv ices) | |||||
| 84 | { | |||||
| 85 | return ( attributeM etadata.At tributeTyp e == Attri buteTypeCo de.Picklis t | |||||
| 86 | || a ttributeMe tadata.Att ributeType == Attrib uteTypeCod e.State | |||||
| 87 | || a ttributeMe tadata.Att ributeType == Attrib uteTypeCod e.Status); | |||||
| 88 | } | |||||
| 89 | ||||||
| 90 | // / <summary > | |||||
| 91 | // / Ideally, we wouldn 't generat e any enti ties, but we must in order to leverage | |||||
| 92 | // / the logi c in CrmSv cUtil. If an entity which con tains a cu stom Optio nSet | |||||
| 93 | // / attribut e is not g enerated, then the c ustom Opti onSet will not be ge nerated, | |||||
| 94 | // / either. We will r emove thes e in our I CustomizeC odeDomServ ice implem entation. | |||||
| 95 | // / </summar y> | |||||
| 96 | pu blic bool GenerateEn tity( | |||||
| 97 | EntityMe tadata ent ityMetadat a, IServic eProvider services) | |||||
| 98 | { | |||||
| 99 | return D efaultServ ice.Genera teEntity(e ntityMetad ata, servi ces); | |||||
| 100 | } | |||||
| 101 | ||||||
| 102 | // / <summary > | |||||
| 103 | // / We don't want to g enerate an y relation ships. | |||||
| 104 | // / </summar y> | |||||
| 105 | pu blic bool GenerateRe lationship ( | |||||
| 106 | Relation shipMetada taBase rel ationshipM etadata, E ntityMetad ata otherE ntityMetad ata, | |||||
| 107 | IService Provider s ervices) | |||||
| 108 | { | |||||
| 109 | return f alse; | |||||
| 110 | } | |||||
| 111 | ||||||
| 112 | // / <summary > | |||||
| 113 | // / We don't want to g enerate an y service contexts. | |||||
| 114 | // / </summar y> | |||||
| 115 | pu blic bool GenerateSe rviceConte xt(IServic eProvider services) | |||||
| 116 | { | |||||
| 117 | return f alse; | |||||
| 118 | } | |||||
| 119 | ||||||
| 120 | pu blic bool GenerateOp tion(Optio nMetadata optionMeta data, ISer viceProvid er service s) | |||||
| 121 | { | |||||
| 122 | return D efaultServ ice.Genera teOption(o ptionMetad ata, servi ces); | |||||
| 123 | } | |||||
| 124 | } | |||||
| 125 | } | |||||
| 126 | //</snippe tFiltering Service> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.