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:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...