Monday

csharp binary operators sample

1. declaring values to be masked : all must be pow2

public enum EnumInvoiceFlags
{
LateFeeApplied = 1,
DelinquencyApplied = 2,
Unfreezed = 4
}


applying masks:
 invoice.Flags = invoice.Flags | (int)EnumInvoiceFlags.DelinquencyApplied; 



checking if mask has specific value:
 
if ((invoice.Flags & (int)EnumInvoiceFlags.DelinquencyApplied) != (int)EnumInvoiceFlags.DelinquencyApplied)



No comments:

here is powershell script on how to get list of files from changesets associated with one tfs task

$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...