/// <summary>
        /// Sample : Deleting AllReceipts registration saved file. (Using this method when your application is uninstalled)
        /// </summary>
        public static void DeleteRegistrationConfigFile()
        {
            // Specify the registration information saved file path.
            string registratioConfignFilePath = SMCloudServices.GetRegistrationConfigFilePath();

            try
            {
                File.Delete(registratioConfignFilePath);
            }
            catch (Exception)
            {
            }

            bool success;

            if (!File.Exists(registratioConfignFilePath))
            {
                success = true;
            }
            else
            {
                success = false;
            }

            ShowResultMessage(success);

            Util.NotifyAllReceiptsIsRegisteredStatusChanged();
        }
        /// <summary>
        /// Sample : Showing AllRceipts registration view.
        /// </summary>
        public static void ShowAllReceiptsRegistrationView()
        {
            // Check is your device is registered.
            bool isAlreadyRegistered = CheckIsDeviceRegisteredInStarCloudServices();

            if (!isAlreadyRegistered) // Not registered
            {
                // Specify the file path to save the registration information. (XML format)
                string path = SetRegistrationConfigFilePath();

                if (path == null)
                {
                    return;
                }

                // Please be sure to set registration config path first.
                SMCloudServices.SetRegistrationConfigFilePath(path);
            }

            // Specify owner window. (option)
            Window ownerWindow = Util.GetMainWindow();

            SMCloudServices.ShowRegistrationView(ownerWindow);

            // If without owner window, use below method.
            // SMCloudServices.ShowRegistrationView();
        }
        public AllReceiptsInfoManager()
        {
            if (SharedInformationManager.AllReceiptsInfoManager == null)
            {
                RestorePreviousSettings();
            }
            else
            {
                CopyProperty(SharedInformationManager.AllReceiptsInfoManager);
            }

            SharedInformationManager.AllReceiptsInfoManager = this;

            string filePath = Properties.Settings.Default.AllReceiptsRegistrationFilePath;

            SMCloudServices.SetRegistrationConfigFilePath(filePath);

            try
            {
                isRegistered = SMCloudServices.IsRegistered();
            }
            catch (InvalidOperationException)
            {
                isRegistered = false;
            }
        }
        public static void SetAllReceiptsRegistrationFilePath(string filePath)
        {
            SMCloudServices.SetRegistrationConfigFilePath(filePath);

            Properties.Settings.Default.AllReceiptsRegistrationFilePath = filePath;

            Properties.Settings.Default.Save();
        }
        public void NotifyIsRegisteredPropertyChanged()
        {
            isRegistered = SMCloudServices.IsRegistered();

            OnPropertyChanged("RegistrationStateDescription");
            OnPropertyChanged("IsRegistered");
            OnPropertyChanged("IsUnRegistered");
            OnPropertyChanged("TextReceiptIsEnabled");
            OnPropertyChanged("TextUTF8ReceiptIsEnabled");
            OnPropertyChanged("RasterReceiptIsEnabled");
        }
        /// <summary>
        /// Sample : Checking is your device is registered in StarCloudServices.
        /// </summary>
        private static bool CheckIsDeviceRegisteredInStarCloudServices()
        {
            // Specify your AllReceipts config path.
            string filePath = Properties.Settings.Default.AllReceiptsRegistrationFilePath;

            if (filePath.Equals(""))
            {
                return(false);
            }

            SMCloudServices.SetRegistrationConfigFilePath(filePath);

            return(SMCloudServices.IsRegistered());
        }
Example #7
0
 // StarCloudServices
 public static string GetSMCloudServicesVersion()
 {
     return(SMCloudServices.GetSMCloudServicesVersion());
 }