public override void Execute(object parameter)
        {
            bool isSelected = true;
            SelectSettingWindow selectPatterWindow = Function.SelectPatternWindow;

            if (Function.SelectPatternWindow != null)
            {
                selectPatterWindow.SelectedIndex = Function.DefaultPatternIndex;

                isSelected = (bool)selectPatterWindow.ShowDialog();
            }

            if (isSelected)
            {
                Communication.PeripheralStatus result = CallFunctionWithProgressBar(selectPatterWindow);

                if (result != Communication.PeripheralStatus.Connect ||
                    Function.Type == DisplayFunctionManager.FunctionType.CheckStatus)
                {
                    Communication.ShowPeripheralStatusResultMessage("Display", result);

                    return;
                }

                Communication.ShowCommunicationResultMessage(new CommunicationResult()
                {
                    Result = Communication.Result.Success, Code = StarResultCode.Succeeded
                });
            }
        }
Ejemplo n.º 2
0
        private bool?ShowSelectDrawerOpenStatusWindow()
        {
            bool isHigh = true;

            SelectSettingWindow selectDrawerOpenStatusWindow = new SelectSettingWindow(FindResource("SelectDrawerOpenStatusWindow") as SelectSettingWindow);

            bool?result = selectDrawerOpenStatusWindow.ShowDialog();

            if (result == true)
            {
                switch (selectDrawerOpenStatusWindow.SelectedIndex)
                {
                default:
                case 0:
                    isHigh = true;
                    break;

                case 1:
                    isHigh = false;
                    break;
                }
            }
            else
            {
                return(null);
            }

            return(isHigh);
        }
        private static bool ShowDeleteConfigFileConfirmWindow()
        {
            SelectSettingWindow confirmWindow = new SelectSettingWindow();

            confirmWindow.Title        = "Confirm";
            confirmWindow.SettingTitle = "Delete AllReceipts config file?";

            return((bool)confirmWindow.ShowDialog());;
        }
Ejemplo n.º 4
0
        public static bool ShowConfirmMessage(string caption, string message)
        {
            SelectSettingWindow confirmWindow = new SelectSettingWindow(caption, message);

            confirmWindow.Owner = GetMainWindow();
            confirmWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;

            return((bool)confirmWindow.ShowDialog());;
        }
Ejemplo n.º 5
0
        public static void ShowMessage(string caption, string message)
        {
            SelectSettingWindow dialog = new SelectSettingWindow(caption, message, Visibility.Visible, Visibility.Collapsed);

            dialog.Owner = GetMainWindow();
            dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;

            dialog.ShowDialog();
        }
        private bool ShowModelConfirmWindow(ModelInformation.PrinterModel model)
        {
            ModelInformation modelInformation = new ModelInformation(model);

            SelectSettingWindow confirmWindow = new SelectSettingWindow();

            confirmWindow.Title = "Confirm";
            confirmWindow.AcceptButtonContent = "Yes";
            confirmWindow.CancelButtonContent = "No";
            confirmWindow.SettingTitle        = "Is your printer " + modelInformation.SimpleModelName + "?";

            return((bool)confirmWindow.ShowDialog());
        }
Ejemplo n.º 7
0
        private PaperSize ShowSelectPaperSizeWindow()
        {
            PaperSize paperSize = new PaperSize();

            SelectSettingWindow selectPaperSizeWindow = new SelectSettingWindow(SelectPaperSizeWindow);

            bool result = (bool)selectPaperSizeWindow.ShowDialog();

            if (result)
            {
                paperSize = selectPaperSizeWindow.SelecedPaperSize;
            }

            return(paperSize);
        }
Ejemplo n.º 8
0
        private Language ShowSelectLanguageWindow()
        {
            Language language = new Language();

            SelectSettingWindow selectLanguageWindow = new SelectSettingWindow(SelectLanguageWindow);

            bool result = (bool)selectLanguageWindow.ShowDialog();

            if (result)
            {
                language = selectLanguageWindow.SelecedLanguage;
            }

            return(language);
        }
Ejemplo n.º 9
0
        private PaperSize ShowSelectPaperSizeWindow(PaperSizeType defaultPaperSize)
        {
            PaperSize paperSize = null;

            SelectSettingWindow selectPaperSizeWindow = new SelectSettingWindow(SelectSettingWindow.Templete.PaperSize);

            selectPaperSizeWindow.SelectedIndex = (int)defaultPaperSize;

            bool?result = selectPaperSizeWindow.ShowDialog();

            if (result == true)
            {
                paperSize = selectPaperSizeWindow.SelectedPaperSize;
            }

            return(paperSize);
        }
Ejemplo n.º 10
0
        private static BlackMarkType?ShowSelectBlackMarkTypeWindow()
        {
            BlackMarkType?blackMarkType = null;

            SelectSettingWindow selectblackMarkWindow = new SelectSettingWindow(SelectSettingWindow.Templete.BlackMarkType);

            bool?result = selectblackMarkWindow.ShowDialog();

            if (result == true)
            {
                blackMarkType = selectblackMarkWindow.SelectedBlackMarkType;
            }
            else
            {
                return(null);
            }

            return(blackMarkType);
        }
Ejemplo n.º 11
0
        private ModelInformation ShowSelectModelWindow()
        {
            ModelInformation modelInformation = new ModelInformation();

            SelectSettingWindow selectModelWindow = new SelectSettingWindow(FindResource("SelectModelWindow") as SelectSettingWindow);

            bool?result = selectModelWindow.ShowDialog();

            if (result == true)
            {
                modelInformation = selectModelWindow.SelectedModel;
            }
            else
            {
                return(null);
            }

            return(modelInformation);
        }
Ejemplo n.º 12
0
        private InterfaceInformation ShowSelectInterfaceWindow()
        {
            InterfaceInformation interfaceInformation = new InterfaceInformation();

            SelectSettingWindow selectInterfaceWindow = new SelectSettingWindow(FindResource("SelectInterfaceWindow") as SelectSettingWindow);

            bool?result = selectInterfaceWindow.ShowDialog();

            if (result == true)
            {
                interfaceInformation = selectInterfaceWindow.SelecedInterfaceType;
            }
            else
            {
                return(null);
            }

            return(interfaceInformation);
        }
        public static void ShowResultMessage(bool isSuccess)
        {
            string message = "";

            if (isSuccess)
            {
                message = "Success";
            }
            else
            {
                message = "Failure";
            }

            SelectSettingWindow resultDialog = new SelectSettingWindow("Result", message, Visibility.Visible, Visibility.Collapsed);

            resultDialog.Owner = Util.GetMainWindow();
            resultDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;

            resultDialog.ShowDialog();
        }
        private static PrintableAreaType?ShowSelectPrintableAreaTypeWindow()
        {
            PrintableAreaType?type = null;

            SelectSettingWindow selectPrintableAreaTypeWindow = new SelectSettingWindow();

            selectPrintableAreaTypeWindow.Title         = "Select printable area type.";
            selectPrintableAreaTypeWindow.Settings      = new string[] { "Standard", "Type1", "Type2", "Type3", "Type4" };
            selectPrintableAreaTypeWindow.SelectedIndex = 0;

            bool?result = selectPrintableAreaTypeWindow.ShowDialog();

            if (result == true)
            {
                switch (selectPrintableAreaTypeWindow.SelectedIndex)
                {
                default:
                case 0:
                    type = PrintableAreaType.Standard;
                    break;

                case 1:
                    type = PrintableAreaType.Type1;
                    break;

                case 2:
                    type = PrintableAreaType.Type2;
                    break;

                case 3:
                    type = PrintableAreaType.Type3;
                    break;

                case 4:
                    type = PrintableAreaType.Type4;
                    break;
                }
            }

            return(type);
        }
        private bool ShowReconnectConfirmWindow()
        {
            if (isShowConfirmWindow)
            {
                return(false);
            }

            SelectSettingWindow confirmWindow = new SelectSettingWindow();

            confirmWindow.Title               = "Confirm";
            confirmWindow.SettingTitle        = "Printer driver job is completed. Start monitoring scale?";
            confirmWindow.AcceptButtonContent = "Yes";
            confirmWindow.CancelButtonContent = "No";

            isShowConfirmWindow = true;
            bool result = (bool)confirmWindow.ShowDialog();

            isShowConfirmWindow = false;

            return(result);
        }
        private bool ShowReleasePortConfirmWindow()
        {
            if (isShowConfirmWindow)
            {
                return(false);
            }

            SelectSettingWindow confirmWindow = new SelectSettingWindow();

            confirmWindow.Title               = "Confirm";
            confirmWindow.SettingTitle        = "Port is used, so can not print via printer driver. Release port?";
            confirmWindow.AcceptButtonContent = "Yes";
            confirmWindow.CancelButtonContent = "No";

            isShowConfirmWindow = true;
            bool result = (bool)confirmWindow.ShowDialog();

            isShowConfirmWindow = false;

            return(result);
        }