Beispiel #1
0
 public GMLError(eErrorKind _kind, string _error, GMLToken _token, params object[] _others)
 {
     Kind   = _kind;
     Error  = _error;
     Token  = _token;
     Params = new List <object>(_others);
 }
Beispiel #2
0
        public void Compile(GMAssets _assets)
        {
            switch (Kind)
            {
            case eAction.ACT_VARIABLE:
                if (Relative)
                {
                    Code = Code + Args[0] + " += " + Args[1];
                }
                else
                {
                    Code = Code + Args[0] + " = " + Args[1];
                }
                Kind = eAction.ACT_NORMAL;
                Args.Clear();
                break;

            case eAction.ACT_CODE:
                Code = Args[0];
                Kind = eAction.ACT_NORMAL;
                Args.Clear();
                if (Program.RemoveDND)
                {
                    List <GMLError> _errors            = null;
                    bool            inhibitErrorOutput = Program.InhibitErrorOutput;
                    Program.InhibitErrorOutput = true;
                    GMLCompile.Compile(_assets, "test_compile", Code, out _errors);
                    Program.InhibitErrorOutput = inhibitErrorOutput;
                    if (_errors.Count > 0)
                    {
                        foreach (GMLError item2 in _errors)
                        {
                            eErrorKind kind = item2.Kind;
                            if (kind == eErrorKind.Warning_Unclosed_Comment)
                            {
                                Code += "*/";
                            }
                        }
                    }
                }
                break;
            }
            if (IsQuestion && ExeType == eExecuteTypes.EXE_CODE)
            {
                Name = string.Format("__script{0}__", countScript);
                GMScript value = new GMScript(Code);
                KeyValuePair <string, GMScript> item = new KeyValuePair <string, GMScript>(Name, value);
                _assets.Scripts.Add(item);
                countScript++;
                ExeType = eExecuteTypes.EXE_FUNCTION;
            }
        }
Beispiel #3
0
        private void PrinterErrorProc(LabelPrinter printer, eErrorKind eError, int iErrCode, String sMsg)
        {
            String sTmpMsg = "";

            if (eError == eErrorKind.eErrConnect)
            {
                MessageBox.Show("Connect failure: " + iErrCode.ToString(), "Error");
            }
            else if (eError == eErrorKind.eErrPrinterCheck)
            {
                MessageBox.Show("PrinterCheck failure: " + iErrCode.ToString(), "Error");
            }
            else if (eError == eErrorKind.eErrPrint)
            {
                MessageBox.Show("Print failure: " + iErrCode.ToString(), "Error");
            }
            else if (eError == eErrorKind.eErrPrinterStatus)
            {
                sTmpMsg = "The printer can not print.\r\n" + sMsg;
                MessageBox.Show(sTmpMsg, "Printer Error");
            }
        }