コード例 #1
0
ファイル: ScanLayerView.cs プロジェクト: Zebra/iFactr-iOS
            public ScanController(ScanLayer scanLayer)
            {
                _layer = scanLayer;
                string fontName = null;
                double fontSize = 12;

                if (_layer.LayerStyle != null && _layer.LayerStyle.DefaultLabelStyle != null)
                {
                    fontName = _layer.LayerStyle.DefaultLabelStyle.FontFamily;
                    fontSize = _layer.LayerStyle.DefaultLabelStyle.FontSize;
                }
                if (!string.IsNullOrEmpty(fontName))
                {
                    float size;
                    if (!float.TryParse(fontSize.ToString(), out size))
                    {
                        TouchFactory.Instance.Logger.Warn("Could not parse " + fontSize + "(double) to a float value");
                        size = 12;
                    }
                    _layerFont = TouchStyle.ToFont(UIFont.FromName(fontName, size));
                }

                callback               = scanLayer.Callback;
                barcodeKey             = ScanLayer.BarcodeKey;
                completeButtonText     = scanLayer.Callback.Text ?? iApp.Factory.GetResourceString("Done");
                backgroundColor        = _layer.LayerStyle.LayerBackgroundColor;
                barcodeSeparatorChar   = ScanLayer.BarcodeSeparatorChar;
                ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
            }
コード例 #2
0
ファイル: ScanLayerView.cs プロジェクト: Zebra/iFactr-iOS
            public CameraScanController(CameraScanLayer layer, Link callback, string parametersKey)
            {
                _layer           = layer;
                _callback        = callback;
                _barcodeValueKey = parametersKey;
                DuplicateWait    = layer.DuplicateTimeout;
                //				Autorotate = TouchFactory.Instance.Platform == MobilePlatform.iPad;
                ModalPresentationStyle = UIModalPresentationStyle.FormSheet;

                string fontName = null;
                double fontSize = 12;

                if (_layer.LayerStyle != null && _layer.LayerStyle.DefaultLabelStyle != null)
                {
                    fontName = _layer.LayerStyle.DefaultLabelStyle.FontFamily;
                    fontSize = _layer.LayerStyle.DefaultLabelStyle.FontSize;
                }
                if (!string.IsNullOrEmpty(fontName))
                {
                    _layerFont = TouchStyle.ToFont(UIFont.FromName(fontName, LastValueScanOverlay.LabelFontSize));
                }
            }