Annotation of cleanflash/CleanFlashInstaller/InstallFlags.cs, revision 1.1.1.1

1.1       root        1: using System;
                      2: 
                      3: namespace CleanFlashInstaller {
                      4:     public class InstallFlags {
                      5:         public static int NONE = 0;
                      6:         public static int PEPPER = 1 << 0;
                      7:         public static int NETSCAPE = 1 << 1;
                      8:         public static int ACTIVEX = 1 << 2;
                      9:         public static int PLAYER = 1 << 3;
                     10:         public static int PLAYER_START_MENU = 1 << 4;
                     11:         public static int PLAYER_DESKTOP = 1 << 5;
                     12:         public static int X64 = 1 << 6;
                     13:         public static int DEBUG = 1 << 7;
                     14: 
                     15:         private static int UNINSTALL_TICKS = 9;
                     16:         private static int INSTALL_GENERAL_TICKS = 5;
                     17: 
                     18:         private int value = 0;
                     19: 
                     20:         public InstallFlags(int value) {
                     21:             this.value = value;
                     22:         }
                     23: 
                     24:         public InstallFlags() : this(0) { }
                     25: 
                     26:         public int GetValue() {
                     27:             return value;
                     28:         }
                     29: 
                     30:         public bool IsSet(int flag) {
                     31:             return (value & flag) == flag;
                     32:         }
                     33: 
                     34:         public bool IsSet(InstallFlags flags) {
                     35:             return IsSet(flags.GetValue());
                     36:         }
                     37: 
                     38:         public bool IsNoneSet() {
                     39:             return value == 0;
                     40:         }
                     41: 
                     42:         public void SetFlag(int flag) {
                     43:             value |= flag;
                     44:         }
                     45: 
                     46:         public void SetConditionally(bool set, int flag) {
                     47:             if (set) {
                     48:                 SetFlag(flag);
                     49:             }
                     50:         }
                     51: 
                     52:         public int GetTicks() {
                     53:             int ticks = (IsSet(PEPPER) ? 1 : 0) + (IsSet(NETSCAPE) ? 1 : 0) + (IsSet(ACTIVEX) ? 2 : 0);
                     54: 
                     55:             if (Environment.Is64BitOperatingSystem) {
                     56:                 ticks *= 2;
                     57:             }
                     58: 
                     59:             if (IsSet(PLAYER)) {
                     60:                 ticks++;
                     61:             }
                     62: 
                     63:             ticks += UNINSTALL_TICKS;
                     64:             ticks += INSTALL_GENERAL_TICKS;
                     65:             return ticks;
                     66:         }
                     67:     }
                     68: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.