Esempio n. 1
0
 public static bool ApplicationPathExists()
 {
     return(Directory.Exists(string.Format(
                                 CultureInfo.InvariantCulture, "{0}{1}{2}",
                                 Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                 Path.DirectorySeparatorChar,
                                 RM.GetString("UserConfigPath") + Config.PhotoKioskVersion)));
 }
Esempio n. 2
0
 public static string GetFullPath(string fileName)
 {
     if (fileName != "")
     {
         if (Path.IsPathRooted(fileName))
         {
             return(fileName);
         }
         else
         {
             return(string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}{3}{4}",
                                  Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                  Path.DirectorySeparatorChar,
                                  RM.GetString("UserConfigPath") + Config.PhotoKioskVersion,
                                  Path.DirectorySeparatorChar,
                                  fileName));
         }
     }
     else
     {
         return(fileName);
     }
 }
Esempio n. 3
0
 public static void RestoreDefaultReceiptFile(string filename)
 {
     Tools.SaveStreamToFile(Assembly.GetExecutingAssembly().GetManifestResourceStream(RM.GetString("ReceiptFile")), filename);
 }
Esempio n. 4
0
 public static void RestoreDefaultTransformFile()
 {
     Tools.SaveStreamToFile(Assembly.GetExecutingAssembly().GetManifestResourceStream(RM.GetString("TransformFile")), TransformFile);
 }
Esempio n. 5
0
 public void RestoreDefaultResourcesFile()
 {
     Tools.SaveStreamToFile(Assembly.GetExecutingAssembly().GetManifestResourceStream(RM.GetString("ResourcesFile")), LocalizationFile.Value);
 }
Esempio n. 6
0
        public Config(bool isReadonly)
        {
            // General
            PhotoKioskId          = new Setting <string>(isReadonly, "PhotoKioskId", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            MemoryCacheSize       = new Setting <int>(isReadonly, "MemoryCacheSize", 100, false, new Setting <int> .SettingChangedHandler(SettingValueChanged));
            SearchProcessDuration = new Setting <int>(isReadonly, "SearchProcessDuration", 7000, false, new Setting <int> .SettingChangedHandler(SettingValueChanged));
            InactivityTimeout     = new Setting <int>(isReadonly, "InactivityTimeout", 420000, false, new Setting <int> .SettingChangedHandler(SettingValueChanged));
            EnableEventLogging    = new Setting <bool>(isReadonly, "EnableEventLogging", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            SourcePaths           = new Setting <string>(isReadonly, "SourcePaths", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            EnableFolderSelection = new Setting <bool>(isReadonly, "EnableFolderSelection", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            PaperSizeUnits        = new Setting <string>(isReadonly, "PaperSizeUnits", Constants.MmUnits, false, new Setting <string> .SettingChangedHandler(SettingValueChanged));

            // Bluetooth
            EnableBluetooth = new Setting <bool>(isReadonly, "EnableBluetooth", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            BluetoothHost   = new Setting <string>(isReadonly, "BluetoothHost", RM.GetString("BluetoothHostNameDefValue"), true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            BluetoothFolder = new Setting <string>(isReadonly, "BluetoothFolder", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));

            // Callback
            OnStartCallback    = new Setting <string>(isReadonly, "OnStartCallback", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            OnCancelCallback   = new Setting <string>(isReadonly, "OnCancelCallback", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            OnCompleteCallback = new Setting <string>(isReadonly, "OnCompleteCallback", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));

            // Image Editor
            EnableImageEditor     = new Setting <bool>(isReadonly, "EnableImageEditor", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableRotation        = new Setting <bool>(isReadonly, "EnableRotation", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableFlip            = new Setting <bool>(isReadonly, "EnableFlip", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableCrop            = new Setting <bool>(isReadonly, "EnableCrop", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableColorCorrection = new Setting <bool>(isReadonly, "EnableColorCorrection", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableEffects         = new Setting <bool>(isReadonly, "EnableEffects", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableRedEyeRemoval   = new Setting <bool>(isReadonly, "EnableRedEyeRemoval", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            CropFile = new Setting <string>(isReadonly, "CropFile", GetFullPath("Crop.xml"), false, new Setting <string> .SettingChangedHandler(SettingValueChanged));

            // Contact info
            EnableCustomerPhone       = new Setting <bool>(isReadonly, "EnableCustomerPhone", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableCustomerEmail       = new Setting <bool>(isReadonly, "EnableCustomerEmail", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableCustomerOrderId     = new Setting <bool>(isReadonly, "EnableCustomerOrderId", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            EnableCustomerNameOrderId = new Setting <bool>(isReadonly, "EnableCustomerNameOrderId", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            SkipContactInfo           = new Setting <bool>(isReadonly, "SkipContactInfo", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));

            // Photo ordering
            EnablePhotoOrdering = new Setting <bool>(isReadonly, "EnablePhotoOrdering", true, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));

            // Price file
            PriceFile = new Setting <string>(isReadonly, "PriceFile", GetFullPath("Price.xml"), false, new Setting <string> .SettingChangedHandler(SettingValueChanged));

            // CDburner
            EnableCDBurning         = new Setting <bool>(isReadonly, "EnableCDBurner", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            CDBurningRequireConfirm = new Setting <bool>(isReadonly, "CDBurnerRequireConfirm", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            DriveLetter             = new Setting <string>(isReadonly, "DriveLetter", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            DiscLabel     = new Setting <string>(isReadonly, "DiscLabel", "Photo_Kiosk", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            CDBurningCost = new Setting <float>(isReadonly, "CDBurningCost", 10.0f, true, new Setting <float> .SettingChangedHandler(SettingValueChanged));
            CDBurningPaymentInstructions = new Setting <string>(isReadonly, "CDBurnerPaymentInstructions", RM.GetString("CDBurningPaymentInstructions"), true, new Setting <string> .SettingChangedHandler(SettingValueChanged));

            // PhotoPrinter
            EnablePhotoPrinting              = new Setting <bool>(isReadonly, "EnablePhotoPrinter", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            PhotoPrintingRequireConfirm      = new Setting <bool>(isReadonly, "PhotoPrinterRequireConfirm", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            PhotoPrintingPaymentInstructions = new Setting <string>(isReadonly, "PhotoPrintingPaymentInstructions", RM.GetString("PhotoPrintingPaymentInstructions"), true, new Setting <string> .SettingChangedHandler(SettingValueChanged));

            // ReceiptPrinter
            EnableReceiptPrinter = new Setting <bool>(isReadonly, "EnableReceiptPrinter", false, true, new Setting <bool> .SettingChangedHandler(SettingValueChanged));
            ReceiptPrinterName   = new Setting <string>(isReadonly, "ReceiptPrinterName", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            ReceiptTemplateFile  = new Setting <string>(isReadonly, "ReceiptTemplateFile", GetFullPath("ReceiptTemplate.xaml"), false, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            PhotosInReceipt      = new Setting <int>(isReadonly, "PhotosInReceipt", 20, true, new Setting <int> .SettingChangedHandler(SettingValueChanged));

            // Appearance
            ThemeFile        = new Setting <string>(isReadonly, "ThemeFile", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            LocalizationFile = new Setting <string>(isReadonly, "LocalizationFile", GetFullPath("Resources.xml"), false, new Setting <string> .SettingChangedHandler(SettingValueChanged));
            MainBanner       = new Setting <string>(isReadonly, "MainBanner", "", true, new Setting <string> .SettingChangedHandler(SettingValueChanged));

            // Screens
            Screens.Add(new ScreenSetting(isReadonly, "WelcomeScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "ChooseUploadWayScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "SelectFoldersScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "UploadingPhotosScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "ProgressScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "SelectScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "OrderFormingScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "AdditionalServicesScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "ImageEditorScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "ConfirmOrderScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "ContactInfoScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "OrderIdScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "BurningScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "PrintingScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "ThankYouScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));
            Screens.Add(new ScreenSetting(isReadonly, "ThankYouCancelScreen", new Setting <string> .SettingChangedHandler(SettingValueChanged)));

            var configFileMap = new ExeConfigurationFileMap();

            configFileMap.ExeConfigFilename = GetFullPath(RM.GetString("ConfigFileName"));
            _kioskConfig = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);

            Load();
        }