592. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 10/26/2017 10:44:23 PM Eastern Daylight 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.

592.1 Files compared

# Location File Last Modified
1 Fri Oct 27 02:44:23 2017 UTC
2 OSCIF_BMS_v2_iter 2_September_2017.zip\BMS_Cand\Source\Sources\BMS.Vista.TestEis\BMS.Utils Utilities.cs Wed Oct 18 18:47:02 2017 UTC

592.2 Comparison summary

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

592.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

592.4 Active regular expressions

No regular expressions were active.

592.5 Comparison detail

        1   using Syst em;
        2   using Syst em.Collect ions.Gener ic;
        3   using Syst em.Linq;
        4   using Syst em.Text;
        5   using Syst em.Reflect ion;
        6   using Syst em.Web;
        7   using Syst em.IO;
        8  
        9  
        10   namespace  BMS.Utils
        11   {
        12       public  class Uti lities
        13       {
        14           pu blic stati c string G etBaseLang uage(strin g language )
        15           {
        16                DateTime  entryInLo gMethodTim e = DateTi me.UtcNow;
        17                if (Info World.Trac ing.IWTrac e.IsEntryE nabled)
        18                {
        19                    Info World.Trac ing.IWTrac e.Entry(Sy stem.Refle ction.Meth odBase.Get CurrentMet hod(), ent ryInLogMet hodTime);
        20                }
        21                try
        22                {
        23                    if ( String.IsN ullOrEmpty (language) )
        24                         return nul l;
        25  
        26                    int  index = la nguage.Ind exOf('-');
        27                    if ( index >= 0 )
        28                         return lan guage.Subs tring(0, i ndex);
        29                    retu rn languag e;
        30                }
        31                finally
        32                {
        33                    if ( InfoWorld. Tracing.IW Trace.IsEx itEnabled)
        34                    {
        35                         InfoWorld. Tracing.IW Trace.Exit (System.Re flection.M ethodBase. GetCurrent Method(),  DateTime.U tcNow, ent ryInLogMet hodTime);
        36                    }
        37                }
        38           }
        39  
        40           pu blic stati c Dictiona ry<string,  string> S plitPerson FullName(s tring full Name)
        41           {
        42                DateTime  entryInLo gMethodTim e = DateTi me.UtcNow;
        43                if (Info World.Trac ing.IWTrac e.IsEntryE nabled)
        44                {
        45                    Info World.Trac ing.IWTrac e.Entry(Sy stem.Refle ction.Meth odBase.Get CurrentMet hod(), ent ryInLogMet hodTime);
        46                }
        47                try
        48                {
        49                    Dict ionary<str ing, strin g> result  = new Dict ionary<str ing, strin g>();
        50                    resu lt.Add(Con stants.PER SON_FIRST_ NAME, stri ng.Empty);
        51                    resu lt.Add(Con stants.PER SON_MIDDLE _NAME, str ing.Empty) ;
        52                    resu lt.Add(Con stants.PER SON_LAST_N AME, strin g.Empty);
        53  
        54                    stri ng firstNa me = strin g.Empty, l astName =  string.Emp ty, middle Name = str ing.Empty;
        55  
        56                    full Name = ful lName.Trim ();
        57  
        58                    try
        59                    {
        60                         string[] n ames = ful lName.Spli t(',');
        61  
        62                         lastName =  names[0]. Trim();
        63                         firstName  = names[1] .Trim();
        64                         names = fi rstName.Sp lit(' ');
        65                         if (names. Length ==  2)
        66                         {
        67                             firstN ame = name s[0].Trim( );
        68                             middle Name = nam es[1].Trim ();
        69                         }
        70                    }
        71                    catc h
        72                    {
        73                         lastName =  fullName;
        74                         firstName  = string.E mpty;
        75                         middleName  = string. Empty;
        76                    }
        77  
        78                    resu lt[Constan ts.PERSON_ FIRST_NAME ] = firstN ame;
        79                    resu lt[Constan ts.PERSON_ MIDDLE_NAM E] = middl eName;
        80                    resu lt[Constan ts.PERSON_ LAST_NAME]  = lastNam e;
        81  
        82                    retu rn result;
        83                }
        84                finally
        85                {
        86                    if ( InfoWorld. Tracing.IW Trace.IsEx itEnabled)
        87                    {
        88                         InfoWorld. Tracing.IW Trace.Exit (System.Re flection.M ethodBase. GetCurrent Method(),  DateTime.U tcNow, ent ryInLogMet hodTime);
        89                    }
        90                }
        91           }
        92  
        93           pu blic stati c string G enericToSt ringUsingP ropertyRef lection<T> (T instanc e, bool sh owNull = t rue)
        94           {
        95                DateTime  entryInLo gMethodTim e = DateTi me.UtcNow;
        96                if (Info World.Trac ing.IWTrac e.IsEntryE nabled)
        97                {
        98                    Info World.Trac ing.IWTrac e.Entry(Sy stem.Refle ction.Meth odBase.Get CurrentMet hod(), ent ryInLogMet hodTime);
        99                }
        100                try
        101                {
        102                    Type  type = ty peof(T);
        103                    retu rn ObjectT oStringUsi ngProperty Reflection (instance,  type, sho wNull);
        104                }
        105                finally
        106                {
        107                    if ( InfoWorld. Tracing.IW Trace.IsEx itEnabled)
        108                    {
        109                         InfoWorld. Tracing.IW Trace.Exit (System.Re flection.M ethodBase. GetCurrent Method(),  DateTime.U tcNow, ent ryInLogMet hodTime);
        110                    }
        111                }
        112           }
        113  
        114           pu blic stati c string O bjectToStr ingUsingPr opertyRefl ection(Obj ect obj, b ool showNu ll = true)
        115           {
        116                DateTime  entryInLo gMethodTim e = DateTi me.UtcNow;
        117                if (Info World.Trac ing.IWTrac e.IsEntryE nabled)
        118                {
        119                    Info World.Trac ing.IWTrac e.Entry(Sy stem.Refle ction.Meth odBase.Get CurrentMet hod(), ent ryInLogMet hodTime);
        120                }
        121                try
        122                {
        123                    Type  type = ob j.GetType( );
        124                    retu rn ObjectT oStringUsi ngProperty Reflection (obj, type , showNull );
        125                }
        126                finally
        127                {
        128                    if ( InfoWorld. Tracing.IW Trace.IsEx itEnabled)
        129                    {
        130                         InfoWorld. Tracing.IW Trace.Exit (System.Re flection.M ethodBase. GetCurrent Method(),  DateTime.U tcNow, ent ryInLogMet hodTime);
        131                    }
        132                }
        133           }
        134  
        135           pr ivate stat ic void Ap pendLine(S tringBuild er sb, obj ect result , string p roperty, b ool showNu ll)
        136           {
        137                DateTime  entryInLo gMethodTim e = DateTi me.UtcNow;
        138                if (Info World.Trac ing.IWTrac e.IsEntryE nabled)
        139                {
        140                    Info World.Trac ing.IWTrac e.Entry(Sy stem.Refle ction.Meth odBase.Get CurrentMet hod(), ent ryInLogMet hodTime);
        141                }
        142                try
        143                {
        144                    if ( result ==  null)
        145                    {
        146                         if (showNu ll)
        147                             sb.App endLine(st ring.Forma t("{0} is  null", pro perty));
        148                    }
        149                    else
        150                    {
        151                         sb.AppendL ine(string .Format("{ 0}={1}", p roperty, r esult));
        152                    }
        153                }
        154                finally
        155                {
        156                    if ( InfoWorld. Tracing.IW Trace.IsEx itEnabled)
        157                    {
        158                         InfoWorld. Tracing.IW Trace.Exit (System.Re flection.M ethodBase. GetCurrent Method(),  DateTime.U tcNow, ent ryInLogMet hodTime);
        159                    }
        160                }
        161           }
        162  
        163           pr ivate stat ic string  ObjectToSt ringUsingP ropertyRef lection(Ob ject obj,  Type type,  bool show Null)
        164           {
        165                DateTime  entryInLo gMethodTim e = DateTi me.UtcNow;
        166                if (Info World.Trac ing.IWTrac e.IsEntryE nabled)
        167                {
        168                    Info World.Trac ing.IWTrac e.Entry(Sy stem.Refle ction.Meth odBase.Get CurrentMet hod(), ent ryInLogMet hodTime);
        169                }
        170                try
        171                {
        172                    Stri ngBuilder  sb = new S tringBuild er();
        173                    // G et fields  that are t o be seria lized.
        174                    Prop ertyInfo[]  propertie s = type.G etProperti es();
        175  
        176  
        177                    fore ach (Prope rtyInfo p  in propert ies)
        178                    {
        179                         object res ult = p.Ge tValue(obj , null);
        180                         AppendLine (sb, resul t, p.Name,  showNull) ;
        181  
        182                    }
        183  
        184                    Fiel dInfo[] fi elds = typ e.GetField s();
        185  
        186                    fore ach (Field Info field  in fields )
        187                    {
        188                         object res ult = fiel d.GetValue (obj);
        189                         AppendLine (sb, resul t, field.N ame, showN ull);
        190  
        191                    }
        192  
        193  
        194                    retu rn sb.ToSt ring();
        195                }
        196                finally
        197                {
        198                    if ( InfoWorld. Tracing.IW Trace.IsEx itEnabled)
        199                    {
        200                         InfoWorld. Tracing.IW Trace.Exit (System.Re flection.M ethodBase. GetCurrent Method(),  DateTime.U tcNow, ent ryInLogMet hodTime);
        201                    }
        202                }
        203           }
        204  
        205           pu blic stati c bool IsI E7Browser( )
        206           {
        207                DateTime  entryInLo gMethodTim e = DateTi me.UtcNow;
        208                if (Info World.Trac ing.IWTrac e.IsEntryE nabled)
        209                {
        210                    Info World.Trac ing.IWTrac e.Entry(Sy stem.Refle ction.Meth odBase.Get CurrentMet hod(), ent ryInLogMet hodTime);
        211                }
        212                try
        213                {
        214                    Http BrowserCap abilities  brObject =  HttpConte xt.Current .Request.B rowser;
        215                    if ( brObject.B rowser.Equ als("IE")  && brObjec t.Version. StartsWith ("7."))
        216                         return tru e;
        217                    else
        218                         return fal se;
        219                }
        220                finally
        221                {
        222                    if ( InfoWorld. Tracing.IW Trace.IsEx itEnabled)
        223                    {
        224                         InfoWorld. Tracing.IW Trace.Exit (System.Re flection.M ethodBase. GetCurrent Method(),  DateTime.U tcNow, ent ryInLogMet hodTime);
        225                    }
        226                }
        227           }
        228  
        229           pu blic stati c void Cle arEVSImage s()
        230           {
        231                DateTime  entryInLo gMethodTim e = DateTi me.UtcNow;
        232                if (Info World.Trac ing.IWTrac e.IsEntryE nabled)
        233                {
        234                    Info World.Trac ing.IWTrac e.Entry(Sy stem.Refle ction.Meth odBase.Get CurrentMet hod(), ent ryInLogMet hodTime);
        235                }
        236                try
        237                {
        238                    stri ng path =  HttpContex t.Current. Server.Map Path("~/Co ntent/imag es/EVS/");                  
        239                    if ( Directory. Exists(pat h))
        240                    {
        241                         foreach (s tring file  in Direct ory.GetFil es(path))
        242                         {
        243                             try
        244                             {
        245                                 Fi le.Delete( file);
        246                             }
        247                             catch  { }
        248                         }
        249                    }
        250                }
        251                finally
        252                {
        253                    if ( InfoWorld. Tracing.IW Trace.IsEx itEnabled)
        254                    {
        255                         InfoWorld. Tracing.IW Trace.Exit (System.Re flection.M ethodBase. GetCurrent Method(),  DateTime.U tcNow, ent ryInLogMet hodTime);
        256                    }
        257                }
        258           }
        259       }
        260   }