// Adds a new switch (two incase the symbology has an inverse) to SymbologySection
        void addSymbologySwitches(String settingString, int offset)
        {
            // add switch for regular symbology
            SwitchCell cell = new SwitchCell {
                Text = Convert.settingToDisplay[settingString]
            };

            initializeSwitch(cell, settingString);
            SymbologySection.Insert(SymbologySection.Count - offset, cell);

            if (Helpers.Settings.hasInvertedSymbology(settingString))
            {
                string invString = Helpers.Settings.getInvertedSymboloby(settingString);

                // add switch for inverse symbology
                SwitchCell invCell = new SwitchCell {
                    Text = Convert.settingToDisplay[invString]
                };
                initializeSwitch(invCell, invString);
                SymbologySection.Insert(SymbologySection.Count - offset, invCell);

                // Gray out the inverse symbology switch if the regular symbology is disabled
                invCell.IsEnabled = Settings.getBoolSetting(settingString);
                cell.OnChanged   += (object sender, ToggledEventArgs e) =>
                {
                    invCell.IsEnabled = e.Value;
                };
            }
        }
Ejemplo n.º 2
0
        // Adds a new switch (two in case the symbology has an inverse) to SymbologySection
        void addSymbologySwitches(String settingString, int offset)
        {
            // DPM Mode switch will be created alongside with the DataMatrix one,
            // as DPM Mode availability depends on DataMatrix being enabled
            if (Settings.isDpmMode(settingString))
            {
                return;
            }

            // add switch for regular symbology
            SwitchCell cell = new SwitchCell {
                Text = Convert.settingToDisplay[settingString]
            };

            initializeSwitch(cell, settingString);
            SymbologySection.Insert(SymbologySection.Count - offset, cell);

            if (Settings.hasInvertedSymbology(settingString))
            {
                string invString = Settings.getInvertedSymbology(settingString);

                // add switch for inverse symbology
                SwitchCell invCell = new SwitchCell {
                    Text = Convert.settingToDisplay[invString]
                };
                initializeSwitch(invCell, invString);
                SymbologySection.Insert(SymbologySection.Count - offset, invCell);

                // Gray out the inverse symbology switch if the regular symbology is disabled
                invCell.IsEnabled = Settings.getBoolSetting(settingString);
                cell.OnChanged   += (object sender, ToggledEventArgs e) =>
                {
                    invCell.IsEnabled = e.Value;
                };
            }

            if (Settings.isDataMatrix(settingString))
            {
                string dpmString = Settings.DpmModeString;

                // add switch for DPM Mode
                SwitchCell dpmCell = new SwitchCell {
                    Text = Convert.settingToDisplay[dpmString]
                };
                initializeSwitch(dpmCell, dpmString);
                SymbologySection.Insert(SymbologySection.Count - offset, dpmCell);

                // Gray out the DPM Mode switch if the DataMatrix symbology is disabled
                dpmCell.IsEnabled = Settings.getBoolSetting(settingString);
                cell.OnChanged   += (object sender, ToggledEventArgs e) =>
                {
                    dpmCell.IsEnabled = e.Value;
                };
            }
        }