public async Task <IActionResult> Sign(SignMethod sign) { string defaultView = sign == SignMethod.SignIn ? "signin" : "signup"; if (!HttpContext.Request.Cookies.ContainsKey("Token")) { ViewBag.Token = CookieController.GetOrGenerateToken(HttpContext); return(View(defaultView)); } //Check token in the cookie var token = CookieController.GetOrGenerateToken(HttpContext); try { //Check token and user in DB await userService.GetUserById(await tokenService.GetUserIdByToken(token)); return(RedirectToAction("Index", "Profile")); } //Catching all exceptions for returning to user a view (DataBase is in safety) catch (Exception) { return(View(defaultView)); } }
private void btnFirmar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtFichero.Text)) { MessageBox.Show("Debe seleccionar un fichero para firmar."); return; } if (rbInternnallyDetached.Checked) { string mimeType = MimeTypeInfo.GetMimeType(txtFichero.Text); EstablecerPolitica(); _firmaXades.SetContentInternallyDetached(txtFichero.Text, mimeType); } else if (rbExternallyDetached.Checked) { _firmaXades.SetContentExternallyDetached(txtFichero.Text); } else if (rbEnveloped.Checked) { _firmaXades.SetContentEnveloped(txtFichero.Text); } SignMethod tipoMetodoFirma = ObtenerAlgoritmo(); _firmaXades.Sign(_firmaXades.SelectCertificate(), tipoMetodoFirma); MessageBox.Show("Firma completada, ahora puede Guardar la firma o ampliarla a Xades-T.", "Test firma XADES", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnContraFirma_Click(object sender, EventArgs e) { EstablecerPolitica(); SignMethod tipoMetodoFirma = ObtenerAlgoritmo(); _firmaXades.CounterSign(_firmaXades.SelectCertificate(), tipoMetodoFirma); MessageBox.Show("Firma completada correctamente.", "Test firma XADES", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void btnFirmarHuella_Click(object sender, EventArgs e) { if (!rbInternnallyDetached.Checked) { MessageBox.Show("Por favor, seleccione el tipo de firma internally detached."); return; } if (string.IsNullOrEmpty(txtFichero.Text)) { MessageBox.Show("Debe seleccionar un fichero para firmar."); return; } _firmaXades.SetContentInternallyDetached(txtFichero.Text, "hash/sha256"); SignMethod tipoMetodoFirma = ObtenerAlgoritmo(); _firmaXades.Sign(_firmaXades.SelectCertificate(), tipoMetodoFirma); MessageBox.Show("Firma completada, ahora puede Guardar la firma o ampliarla a Xades-T.", "Test firma XADES", MessageBoxButtons.OK, MessageBoxIcon.Information); }
/// <summary> /// Realiza el proceso de firmado /// </summary> /// <param name="certificate"></param> /// <param name="signMethod"></param> public void Sign(X509Certificate2 certificate, SignMethod? signMethod = null) { if (certificate == null) { throw new Exception("Es necesario un certificado válido para la firma."); } if (signMethod.HasValue) { this.SignMethod = signMethod.Value; } if (!string.IsNullOrEmpty(_signatureId) && _document != null && _document.SelectSingleNode("//*[@Id='" + _signatureId + "']") != null) { throw new Exception("El documento ya ha sido firmado, debe seleccionar otro método de firma."); } if (string.IsNullOrEmpty(_signatureId)) { SetSignatureId(); } _signCertificate = certificate; AddCertificateInfo(); AddXadesInfo(); foreach (Reference reference in _xadesSignedXml.SignedInfo.References) { reference.DigestMethod = _refsMethodUri; } _xadesSignedXml.SignedInfo.SignatureMethod = _signMethodUri; ComputeSignature(); UpdateDocument(); XmlNode xmlNode = _document.SelectSingleNode("//*[@Id='" + _signatureId + "']"); _xadesSignedXml = new XadesSignedXml(_document); _xadesSignedXml.LoadXml((XmlElement)xmlNode); }
/// <summary> /// Realiza la contrafirma de la firma actual /// </summary> /// <param name="certificate"></param> /// <param name="signMethod"></param> public void CounterSign(X509Certificate2 certificate, SignMethod? signMethod = null) { SetSignatureId(); if (_xadesSignedXml == null) { throw new Exception("No hay ninguna firma XADES cargada previamente."); } if (certificate == null) { throw new Exception("Es necesario un certificado válido para la firma."); } if (signMethod.HasValue) { this.SignMethod = signMethod.Value; } _signCertificate = certificate; XadesSignedXml counterSignature = new XadesSignedXml(_document); SetCryptoServiceProvider(); counterSignature.SigningKey = _rsaKey; Reference reference = new Reference(); reference.Uri = "#" + _xadesSignedXml.SignatureValueId; reference.Id = "Reference-" + Guid.NewGuid().ToString(); reference.Type = "http://uri.etsi.org/01903#CountersignedSignature"; reference.AddTransform(new XmlDsigC14NTransform()); counterSignature.AddReference(reference); _objectReference = reference.Id; KeyInfo keyInfo = new KeyInfo(); keyInfo.Id = "KeyInfoId-" + _signatureId; keyInfo.AddClause(new KeyInfoX509Data((X509Certificate)_signCertificate)); keyInfo.AddClause(new RSAKeyValue((RSA)_rsaKey)); counterSignature.KeyInfo = keyInfo; Reference referenceKeyInfo = new Reference(); referenceKeyInfo.Id = "ReferenceKeyInfo-" + _signatureId; referenceKeyInfo.Uri = "#KeyInfoId-" + _signatureId; counterSignature.AddReference(referenceKeyInfo); counterSignature.Signature.Id = _signatureId; counterSignature.SignatureValueId = _signatureValueId; XadesObject counterSignatureXadesObject = new XadesObject(); counterSignatureXadesObject.Id = "CounterSignatureXadesObject-" + Guid.NewGuid().ToString(); counterSignatureXadesObject.QualifyingProperties.Target = "#" + _signatureId; counterSignatureXadesObject.QualifyingProperties.SignedProperties.Id = "SignedProperties-" + _signatureId; AddSignatureProperties(counterSignatureXadesObject.QualifyingProperties.SignedProperties.SignedSignatureProperties, counterSignatureXadesObject.QualifyingProperties.SignedProperties.SignedDataObjectProperties, counterSignatureXadesObject.QualifyingProperties.UnsignedProperties.UnsignedSignatureProperties, "text/xml", _signCertificate); counterSignature.AddXadesObject(counterSignatureXadesObject); foreach (Reference signReference in counterSignature.SignedInfo.References) { signReference.DigestMethod = _refsMethodUri; } counterSignature.AddXadesNamespace = true; counterSignature.ComputeSignature(); UnsignedProperties unsignedProperties = _xadesSignedXml.UnsignedProperties; unsignedProperties.UnsignedSignatureProperties.CounterSignatureCollection.Add(counterSignature); _xadesSignedXml.UnsignedProperties = unsignedProperties; UpdateDocument(); _xadesSignedXml = new XadesSignedXml(_document); XmlNode xmlNode = _document.SelectSingleNode("//*[@Id='" + _signatureId + "']"); _xadesSignedXml.LoadXml((XmlElement)xmlNode); }
/// <summary> /// Añade una firma al documento /// </summary> /// <param name="certificate"></param> /// <param name="signMethod"></param> public void CoSign(X509Certificate2 certificate, SignMethod? signMethod = null) { if (_xadesSignedXml == null) { throw new Exception("No hay ninguna firma XADES creada previamente."); } if (certificate == null) { throw new Exception("Es necesario un certificado válido para la firma."); } Reference refContent = _xadesSignedXml.SignedInfo.References[0] as Reference; if (refContent == null) { throw new Exception("No se ha podido encontrar la referencia del contenido firmado."); } if (_xadesSignedXml.XadesObject.QualifyingProperties.SignedProperties.SignedDataObjectProperties.DataObjectFormatCollection.Count > 0) { foreach (DataObjectFormat dof in _xadesSignedXml.XadesObject.QualifyingProperties.SignedProperties.SignedDataObjectProperties.DataObjectFormatCollection) { if (dof.ObjectReferenceAttribute == ("#" + refContent.Id)) { _mimeType = dof.MimeType; break; } } } var destination = _xadesSignedXml.GetSignatureElement().ParentNode; _xadesSignedXml = new XadesSignedXml(_document); refContent.Id = "Reference-" + Guid.NewGuid().ToString(); _xadesSignedXml.AddReference(refContent); if (destination.NodeType != XmlNodeType.Document) { _xadesSignedXml.SignatureNodeDestination = (XmlElement)destination; } else { _xadesSignedXml.SignatureNodeDestination = ((XmlDocument)destination).DocumentElement; } _objectReference = refContent.Id; SetSignatureId(); Sign(certificate, signMethod); }
static FunctionMethodCreator() { methodList = new Dictionary <string, FunctionMethod>(); //キャラクタデータ系 methodList["GETCHARA"] = new GetcharaMethod(); methodList["GETSPCHARA"] = new GetspcharaMethod(); methodList["CSVNAME"] = new CsvStrDataMethod(CharacterStrData.NAME); methodList["CSVCALLNAME"] = new CsvStrDataMethod(CharacterStrData.CALLNAME); methodList["CSVNICKNAME"] = new CsvStrDataMethod(CharacterStrData.NICKNAME); methodList["CSVMASTERNAME"] = new CsvStrDataMethod(CharacterStrData.MASTERNAME); methodList["CSVCSTR"] = new CsvcstrMethod(); methodList["CSVBASE"] = new CsvDataMethod(CharacterIntData.BASE); methodList["CSVABL"] = new CsvDataMethod(CharacterIntData.ABL); methodList["CSVMARK"] = new CsvDataMethod(CharacterIntData.MARK); methodList["CSVEXP"] = new CsvDataMethod(CharacterIntData.EXP); methodList["CSVRELATION"] = new CsvDataMethod(CharacterIntData.RELATION); methodList["CSVTALENT"] = new CsvDataMethod(CharacterIntData.TALENT); methodList["CSVCFLAG"] = new CsvDataMethod(CharacterIntData.CFLAG); methodList["CSVEQUIP"] = new CsvDataMethod(CharacterIntData.EQUIP); methodList["CSVJUEL"] = new CsvDataMethod(CharacterIntData.JUEL); methodList["FINDCHARA"] = new FindcharaMethod(false); methodList["FINDLASTCHARA"] = new FindcharaMethod(true); methodList["EXISTCSV"] = new ExistCsvMethod(); //汎用処理系 methodList["VARSIZE"] = new VarsizeMethod(); methodList["CHKFONT"] = new CheckfontMethod(); methodList["CHKDATA"] = new CheckdataMethod("CHKDATA", EraSaveFileType.Normal); methodList["ISSKIP"] = new IsSkipMethod(); methodList["MOUSESKIP"] = new MesSkipMethod(true); methodList["MESSKIP"] = new MesSkipMethod(false); methodList["GETCOLOR"] = new GetColorMethod(false); methodList["GETDEFCOLOR"] = new GetColorMethod(true); methodList["GETFOCUSCOLOR"] = new GetFocusColorMethod(); methodList["GETBGCOLOR"] = new GetBGColorMethod(false); methodList["GETDEFBGCOLOR"] = new GetBGColorMethod(true); methodList["GETSTYLE"] = new GetStyleMethod(); methodList["GETFONT"] = new GetFontMethod(); methodList["BARSTR"] = new BarStringMethod(); methodList["CURRENTALIGN"] = new CurrentAlignMethod(); methodList["CURRENTREDRAW"] = new CurrentRedrawMethod(); methodList["COLOR_FROMNAME"] = new ColorFromNameMethod(); methodList["COLOR_FROMRGB"] = new ColorFromRGBMethod(); //TODO:1810 //methodList["CHKVARDATA"] = new CheckdataStrMethod("CHKVARDATA", EraSaveFileType.Var); methodList["CHKCHARADATA"] = new CheckdataStrMethod("CHKCHARADATA", EraSaveFileType.CharVar); //methodList["CHKGLOBALDATA"] = new CheckdataMethod("CHKGLOBALDATA", EraSaveFileType.Global); //methodList["FIND_VARDATA"] = new FindFilesMethod("FIND_VARDATA", EraSaveFileType.Var); methodList["FIND_CHARADATA"] = new FindFilesMethod("FIND_CHARADATA", EraSaveFileType.CharVar); //定数取得 methodList["MONEYSTR"] = new MoneyStrMethod(); methodList["PRINTCPERLINE"] = new GetPrintCPerLineMethod(); methodList["PRINTCLENGTH"] = new PrintCLengthMethod(); methodList["SAVENOS"] = new GetSaveNosMethod(); methodList["GETTIME"] = new GettimeMethod(); methodList["GETTIMES"] = new GettimesMethod(); methodList["GETMILLISECOND"] = new GetmsMethod(); methodList["GETSECOND"] = new GetSecondMethod(); //数学関数 methodList["RAND"] = new RandMethod(); methodList["MIN"] = new MaxMethod(false); methodList["MAX"] = new MaxMethod(true); methodList["ABS"] = new AbsMethod(); methodList["POWER"] = new PowerMethod(); methodList["SQRT"] = new SqrtMethod(); methodList["CBRT"] = new CbrtMethod(); methodList["LOG"] = new LogMethod(); methodList["LOG10"] = new LogMethod(10.0d); methodList["EXPONENT"] = new ExpMethod(); methodList["SIGN"] = new SignMethod(); methodList["LIMIT"] = new GetLimitMethod(); //変数操作系 methodList["SUMARRAY"] = new SumArrayMethod(); methodList["SUMCARRAY"] = new SumArrayMethod(true); methodList["MATCH"] = new MatchMethod(); methodList["CMATCH"] = new MatchMethod(true); methodList["GROUPMATCH"] = new GroupMatchMethod(); methodList["NOSAMES"] = new NosamesMethod(); methodList["ALLSAMES"] = new AllsamesMethod(); methodList["MAXARRAY"] = new MaxArrayMethod(); methodList["MAXCARRAY"] = new MaxArrayMethod(true); methodList["MINARRAY"] = new MaxArrayMethod(false, false); methodList["MINCARRAY"] = new MaxArrayMethod(true, false); methodList["GETBIT"] = new GetbitMethod(); methodList["GETNUM"] = new GetnumMethod(); methodList["GETPALAMLV"] = new GetPalamLVMethod(); methodList["GETEXPLV"] = new GetExpLVMethod(); methodList["FINDELEMENT"] = new FindElementMethod(false); methodList["FINDLASTELEMENT"] = new FindElementMethod(true); methodList["INRANGE"] = new InRangeMethod(); methodList["INRANGEARRAY"] = new InRangeArrayMethod(); methodList["INRANGECARRAY"] = new InRangeArrayMethod(true); methodList["GETNUMB"] = new GetnumMethod(); //文字列操作系 methodList["STRLENS"] = new StrlenMethod(); methodList["STRLENSU"] = new StrlenuMethod(); methodList["SUBSTRING"] = new SubstringMethod(); methodList["SUBSTRINGU"] = new SubstringuMethod(); methodList["STRFIND"] = new StrfindMethod(false); methodList["STRFINDU"] = new StrfindMethod(true); methodList["STRCOUNT"] = new StrCountMethod(); methodList["TOSTR"] = new ToStrMethod(); methodList["TOINT"] = new ToIntMethod(); methodList["TOUPPER"] = new StrChangeStyleMethod(StrFormType.Upper); methodList["TOLOWER"] = new StrChangeStyleMethod(StrFormType.Lower); methodList["TOHALF"] = new StrChangeStyleMethod(StrFormType.Half); methodList["TOFULL"] = new StrChangeStyleMethod(StrFormType.Full); methodList["LINEISEMPTY"] = new LineIsEmptyMethod(); methodList["REPLACE"] = new ReplaceMethod(); methodList["UNICODE"] = new UnicodeMethod(); methodList["UNICODEBYTE"] = new UnicodeByteMethod(); methodList["CONVERT"] = new ConvertIntMethod(); methodList["ISNUMERIC"] = new IsNumericMethod(); methodList["ESCAPE"] = new EscapeMethod(); methodList["ENCODETOUNI"] = new EncodeToUniMethod(); methodList["CHARATU"] = new CharAtMethod(); methodList["GETLINESTR"] = new GetLineStrMethod(); methodList["STRFORM"] = new StrFormMethod(); methodList["GETCONFIG"] = new GetConfigMethod(true); methodList["GETCONFIGS"] = new GetConfigMethod(false); //html系 methodList["HTML_GETPRINTEDSTR"] = new HtmlGetPrintedStrMethod(); methodList["HTML_POPPRINTINGSTR"] = new HtmlPopPrintingStrMethod(); methodList["HTML_TOPLAINTEXT"] = new HtmlToPlainTextMethod(); methodList["HTML_ESCAPE"] = new HtmlEscapeMethod(); }
static FunctionMethodCreator() { methodList = new Dictionary<string, FunctionMethod>(); //キャラクタデータ系 methodList["GETCHARA"] = new GetcharaMethod(); methodList["GETSPCHARA"] = new GetspcharaMethod(); methodList["CSVNAME"] = new CsvStrDataMethod(CharacterStrData.NAME); methodList["CSVCALLNAME"] = new CsvStrDataMethod(CharacterStrData.CALLNAME); methodList["CSVNICKNAME"] = new CsvStrDataMethod(CharacterStrData.NICKNAME); methodList["CSVMASTERNAME"] = new CsvStrDataMethod(CharacterStrData.MASTERNAME); methodList["CSVCSTR"] = new CsvcstrMethod(); methodList["CSVBASE"] = new CsvDataMethod(CharacterIntData.BASE); methodList["CSVABL"] = new CsvDataMethod(CharacterIntData.ABL); methodList["CSVMARK"] = new CsvDataMethod(CharacterIntData.MARK); methodList["CSVEXP"] = new CsvDataMethod(CharacterIntData.EXP); methodList["CSVRELATION"] = new CsvDataMethod(CharacterIntData.RELATION); methodList["CSVTALENT"] = new CsvDataMethod(CharacterIntData.TALENT); methodList["CSVCFLAG"] = new CsvDataMethod(CharacterIntData.CFLAG); methodList["CSVEQUIP"] = new CsvDataMethod(CharacterIntData.EQUIP); methodList["CSVJUEL"] = new CsvDataMethod(CharacterIntData.JUEL); methodList["FINDCHARA"] = new FindcharaMethod(false); methodList["FINDLASTCHARA"] = new FindcharaMethod(true); methodList["EXISTCSV"] = new ExistCsvMethod(); //汎用処理系 methodList["VARSIZE"] = new VarsizeMethod(); methodList["CHKFONT"] = new CheckfontMethod(); methodList["CHKDATA"] = new CheckdataMethod("CHKDATA", EraSaveFileType.Normal); methodList["ISSKIP"] = new IsSkipMethod(); methodList["MOUSESKIP"] = new MouseSkipMethod(); methodList["GETCOLOR"] = new GetColorMethod(false); methodList["GETDEFCOLOR"] = new GetColorMethod(true); methodList["GETFOCUSCOLOR"] = new GetFocusColorMethod(); methodList["GETBGCOLOR"] = new GetBGColorMethod(false); methodList["GETDEFBGCOLOR"] = new GetBGColorMethod(true); methodList["GETSTYLE"] = new GetStyleMethod(); methodList["GETFONT"] = new GetFontMethod(); methodList["BARSTR"] = new BarStringMethod(); methodList["CURRENTALIGN"] = new CurrentAlignMethod(); methodList["CURRENTREDRAW"] = new CurrentRedrawMethod(); methodList["CHKVARDATA"] = new CheckdataMethod("CHKVARDATA", EraSaveFileType.Var); methodList["CHKCHARADATA"] = new CheckdataMethod("CHKCHARADATA", EraSaveFileType.CharVar); //methodList["CHKGLOBALDATA"] = new CheckdataMethod("CHKGLOBALDATA", EraSaveFileType.Global); //定数取得 methodList["MONEYSTR"] = new MoneyStrMethod(); methodList["PRINTCPERLINE"] = new GetPrintCPerLineMethod(); methodList["SAVENOS"] = new GetSaveNosMethod(); methodList["GETTIME"] = new GettimeMethod(); methodList["GETTIMES"] = new GettimesMethod(); methodList["GETMILLISECOND"] = new GetmsMethod(); methodList["GETSECOND"] = new GetSecondMethod(); //数学関数 methodList["RAND"] = new RandMethod(); methodList["MIN"] = new MaxMethod(false); methodList["MAX"] = new MaxMethod(true); methodList["ABS"] = new AbsMethod(); methodList["POWER"] = new PowerMethod(); methodList["SQRT"] = new SqrtMethod(); methodList["CBRT"] = new CbrtMethod(); methodList["LOG"] = new LogMethod(); methodList["LOG10"] = new LogMethod(10.0d); methodList["EXPONENT"] = new ExpMethod(); methodList["SIGN"] = new SignMethod(); methodList["LIMIT"] = new GetLimitMethod(); //変数操作系 methodList["SUMARRAY"] = new SumArrayMethod(); methodList["SUMCARRAY"] = new SumArrayMethod(true); methodList["MATCH"] = new MatchMethod(); methodList["CMATCH"] = new MatchMethod(true); methodList["GROUPMATCH"] = new GroupMatchMethod(); methodList["NOSAMES"] = new NosamesMethod(); methodList["ALLSAMES"] = new AllsamesMethod(); methodList["MAXARRAY"] = new MaxArrayMethod(); methodList["MAXCARRAY"] = new MaxArrayMethod(true); methodList["MINARRAY"] = new MaxArrayMethod(false, false); methodList["MINCARRAY"] = new MaxArrayMethod(true, false); methodList["GETBIT"] = new GetbitMethod(); methodList["GETNUM"] = new GetnumMethod(); methodList["GETPALAMLV"] = new GetPalamLVMethod(); methodList["GETEXPLV"] = new GetExpLVMethod(); methodList["FINDELEMENT"] = new FindElementMethod(false); methodList["FINDLASTELEMENT"] = new FindElementMethod(true); methodList["INRANGE"] = new InRangeMethod(); methodList["INRANGEARRAY"] = new InRangeArrayMethod(); methodList["INRANGECARRAY"] = new InRangeArrayMethod(true); //文字列操作系 methodList["STRLENS"] = new StrlenMethod(); methodList["STRLENSU"] = new StrlenuMethod(); methodList["SUBSTRING"] = new SubstringMethod(); methodList["SUBSTRINGU"] = new SubstringuMethod(); methodList["STRFIND"] = new StrfindMethod(false); methodList["STRFINDU"] = new StrfindMethod(true); methodList["STRCOUNT"] = new StrCountMethod(); methodList["TOSTR"] = new ToStrMethod(); methodList["TOINT"] = new ToIntMethod(); methodList["TOUPPER"] = new StrChangeStyleMethod(StrFormType.Upper); methodList["TOLOWER"] = new StrChangeStyleMethod(StrFormType.Lower); methodList["TOHALF"] = new StrChangeStyleMethod(StrFormType.Half); methodList["TOFULL"] = new StrChangeStyleMethod(StrFormType.Full); methodList["LINEISEMPTY"] = new LineIsEmptyMethod(); methodList["REPLACE"] = new ReplaceMethod(); methodList["UNICODE"] = new UnicodeMethod(); methodList["UNICODEBYTE"] = new UnicodeByteMethod(); methodList["CONVERT"] = new ConvertIntMethod(); methodList["ISNUMERIC"] = new IsNumericMethod(); methodList["ESCAPE"] = new EscapeMethod(); methodList["ENCODETOUNI"] = new EncodeToUniMethod(); methodList["CHARATU"] = new CharAtMethod(); methodList["GETLINESTR"] = new GetLineStrMethod(); }
static FunctionMethodCreator() { methodList = new Dictionary <string, FunctionMethod>(); //キャラクタデータ系 methodList["GETCHARA"] = new GetcharaMethod(); methodList["GETSPCHARA"] = new GetspcharaMethod(); methodList["CSVNAME"] = new CsvStrDataMethod(CharacterStrData.NAME); methodList["CSVCALLNAME"] = new CsvStrDataMethod(CharacterStrData.CALLNAME); methodList["CSVNICKNAME"] = new CsvStrDataMethod(CharacterStrData.NICKNAME); methodList["CSVMASTERNAME"] = new CsvStrDataMethod(CharacterStrData.MASTERNAME); methodList["CSVCSTR"] = new CsvcstrMethod(); methodList["CSVBASE"] = new CsvDataMethod(CharacterIntData.BASE); methodList["CSVABL"] = new CsvDataMethod(CharacterIntData.ABL); methodList["CSVMARK"] = new CsvDataMethod(CharacterIntData.MARK); methodList["CSVEXP"] = new CsvDataMethod(CharacterIntData.EXP); methodList["CSVRELATION"] = new CsvDataMethod(CharacterIntData.RELATION); methodList["CSVTALENT"] = new CsvDataMethod(CharacterIntData.TALENT); methodList["CSVCFLAG"] = new CsvDataMethod(CharacterIntData.CFLAG); methodList["CSVEQUIP"] = new CsvDataMethod(CharacterIntData.EQUIP); methodList["CSVJUEL"] = new CsvDataMethod(CharacterIntData.JUEL); methodList["FINDCHARA"] = new FindcharaMethod(false); methodList["FINDLASTCHARA"] = new FindcharaMethod(true); methodList["EXISTCSV"] = new ExistCsvMethod(); //汎用処理系 methodList["VARSIZE"] = new VarsizeMethod(); methodList["CHKFONT"] = new CheckfontMethod(); methodList["CHKDATA"] = new CheckdataMethod("CHKDATA", EraSaveFileType.Normal); methodList["ISSKIP"] = new IsSkipMethod(); methodList["MOUSESKIP"] = new MesSkipMethod(true); methodList["MESSKIP"] = new MesSkipMethod(false); methodList["GETCOLOR"] = new GetColorMethod(false); methodList["GETDEFCOLOR"] = new GetColorMethod(true); methodList["GETFOCUSCOLOR"] = new GetFocusColorMethod(); methodList["GETBGCOLOR"] = new GetBGColorMethod(false); methodList["GETDEFBGCOLOR"] = new GetBGColorMethod(true); methodList["GETSTYLE"] = new GetStyleMethod(); methodList["GETFONT"] = new GetFontMethod(); methodList["BARSTR"] = new BarStringMethod(); methodList["CURRENTALIGN"] = new CurrentAlignMethod(); methodList["CURRENTREDRAW"] = new CurrentRedrawMethod(); methodList["COLOR_FROMNAME"] = new ColorFromNameMethod(); methodList["COLOR_FROMRGB"] = new ColorFromRGBMethod(); //TODO:1810 //methodList["CHKVARDATA"] = new CheckdataStrMethod("CHKVARDATA", EraSaveFileType.Var); methodList["CHKCHARADATA"] = new CheckdataStrMethod("CHKCHARADATA", EraSaveFileType.CharVar); //methodList["CHKGLOBALDATA"] = new CheckdataMethod("CHKGLOBALDATA", EraSaveFileType.Global); //methodList["FIND_VARDATA"] = new FindFilesMethod("FIND_VARDATA", EraSaveFileType.Var); methodList["FIND_CHARADATA"] = new FindFilesMethod("FIND_CHARADATA", EraSaveFileType.CharVar); //定数取得 methodList["MONEYSTR"] = new MoneyStrMethod(); methodList["PRINTCPERLINE"] = new GetPrintCPerLineMethod(); methodList["PRINTCLENGTH"] = new PrintCLengthMethod(); methodList["SAVENOS"] = new GetSaveNosMethod(); methodList["GETTIME"] = new GettimeMethod(); methodList["GETTIMES"] = new GettimesMethod(); methodList["GETMILLISECOND"] = new GetmsMethod(); methodList["GETSECOND"] = new GetSecondMethod(); //数学関数 methodList["RAND"] = new RandMethod(); methodList["MIN"] = new MaxMethod(false); methodList["MAX"] = new MaxMethod(true); methodList["ABS"] = new AbsMethod(); methodList["POWER"] = new PowerMethod(); methodList["SQRT"] = new SqrtMethod(); methodList["CBRT"] = new CbrtMethod(); methodList["LOG"] = new LogMethod(); methodList["LOG10"] = new LogMethod(10.0d); methodList["EXPONENT"] = new ExpMethod(); methodList["SIGN"] = new SignMethod(); methodList["LIMIT"] = new GetLimitMethod(); //変数操作系 methodList["SUMARRAY"] = new SumArrayMethod(); methodList["SUMCARRAY"] = new SumArrayMethod(true); methodList["MATCH"] = new MatchMethod(); methodList["CMATCH"] = new MatchMethod(true); methodList["GROUPMATCH"] = new GroupMatchMethod(); methodList["NOSAMES"] = new NosamesMethod(); methodList["ALLSAMES"] = new AllsamesMethod(); methodList["MAXARRAY"] = new MaxArrayMethod(); methodList["MAXCARRAY"] = new MaxArrayMethod(true); methodList["MINARRAY"] = new MaxArrayMethod(false, false); methodList["MINCARRAY"] = new MaxArrayMethod(true, false); methodList["GETBIT"] = new GetbitMethod(); methodList["GETNUM"] = new GetnumMethod(); methodList["GETPALAMLV"] = new GetPalamLVMethod(); methodList["GETEXPLV"] = new GetExpLVMethod(); methodList["FINDELEMENT"] = new FindElementMethod(false); methodList["FINDLASTELEMENT"] = new FindElementMethod(true); methodList["INRANGE"] = new InRangeMethod(); methodList["INRANGEARRAY"] = new InRangeArrayMethod(); methodList["INRANGECARRAY"] = new InRangeArrayMethod(true); methodList["GETNUMB"] = new GetnumMethod(); methodList["ARRAYMSORT"] = new ArrayMultiSortMethod(); //文字列操作系 methodList["STRLENS"] = new StrlenMethod(); methodList["STRLENSU"] = new StrlenuMethod(); methodList["SUBSTRING"] = new SubstringMethod(); methodList["SUBSTRINGU"] = new SubstringuMethod(); methodList["STRFIND"] = new StrfindMethod(false); methodList["STRFINDU"] = new StrfindMethod(true); methodList["STRCOUNT"] = new StrCountMethod(); methodList["TOSTR"] = new ToStrMethod(); methodList["TOINT"] = new ToIntMethod(); methodList["TOUPPER"] = new StrChangeStyleMethod(StrFormType.Upper); methodList["TOLOWER"] = new StrChangeStyleMethod(StrFormType.Lower); methodList["TOHALF"] = new StrChangeStyleMethod(StrFormType.Half); methodList["TOFULL"] = new StrChangeStyleMethod(StrFormType.Full); methodList["LINEISEMPTY"] = new LineIsEmptyMethod(); methodList["REPLACE"] = new ReplaceMethod(); methodList["UNICODE"] = new UnicodeMethod(); methodList["UNICODEBYTE"] = new UnicodeByteMethod(); methodList["CONVERT"] = new ConvertIntMethod(); methodList["ISNUMERIC"] = new IsNumericMethod(); methodList["ESCAPE"] = new EscapeMethod(); methodList["ENCODETOUNI"] = new EncodeToUniMethod(); methodList["CHARATU"] = new CharAtMethod(); methodList["GETLINESTR"] = new GetLineStrMethod(); methodList["STRFORM"] = new StrFormMethod(); methodList["STRJOIN"] = new JoinMethod(); methodList["GETCONFIG"] = new GetConfigMethod(true); methodList["GETCONFIGS"] = new GetConfigMethod(false); //html系 methodList["HTML_GETPRINTEDSTR"] = new HtmlGetPrintedStrMethod(); methodList["HTML_POPPRINTINGSTR"] = new HtmlPopPrintingStrMethod(); methodList["HTML_TOPLAINTEXT"] = new HtmlToPlainTextMethod(); methodList["HTML_ESCAPE"] = new HtmlEscapeMethod(); //画像処理系 methodList["SPRITECREATED"] = new SpriteStateMethod(); methodList["SPRITEWIDTH"] = new SpriteStateMethod(); methodList["SPRITEHEIGHT"] = new SpriteStateMethod(); methodList["SPRITEMOVE"] = new SpriteSetPosMethod(); methodList["SPRITESETPOS"] = new SpriteSetPosMethod(); methodList["SPRITEPOSX"] = new SpriteStateMethod(); methodList["SPRITEPOSY"] = new SpriteStateMethod(); methodList["CLIENTWIDTH"] = new ClientSizeMethod(); methodList["CLIENTHEIGHT"] = new ClientSizeMethod(); methodList["GETKEY"] = new GetKeyStateMethod(); methodList["GETKEYTRIGGERED"] = new GetKeyStateMethod(); methodList["MOUSEX"] = new MousePosMethod(); methodList["MOUSEY"] = new MousePosMethod(); methodList["ISACTIVE"] = new IsActiveMethod(); methodList["SAVETEXT"] = new SaveTextMethod(); methodList["LOADTEXT"] = new LoadTextMethod(); /*1824まで封印 * //methodList["GCREATED"] = new GraphicsStateMethod();// ("GCREATED"); * //methodList["GWIDTH"] = new GraphicsStateMethod();//("GWIDTH"); * //methodList["GHEIGHT"] = new GraphicsStateMethod();//("GHEIGHT"); * //methodList["GGETCOLOR"] = new GraphicsGetColorMethod(); * //methodList["SPRITEGETCOLOR"] = new SpriteGetColorMethod(); * * //methodList["GCREATE"] = new GraphicsCreateMethod(); * //methodList["GCREATEFROMFILE"] = new GraphicsCreateFromFileMethod(); * //methodList["GDISPOSE"] = new GraphicsDisposeMethod(); * //methodList["GCLEAR"] = new GraphicsClearMethod(); * //methodList["GFILLRECTANGLE"] = new GraphicsFillRectangleMethod(); * //methodList["GDRAWSPRITE"] = new GraphicsDrawSpriteMethod(); * //methodList["GSETCOLOR"] = new GraphicsSetColorMethod(); * //methodList["GDRAWG"] = new GraphicsDrawGMethod(); * //methodList["GDRAWGWITHMASK"] = new GraphicsDrawGWithMaskMethod(); * * //methodList["GSETBRUSH"] = new GraphicsSetBrushMethod(); * //methodList["GSETFONT"] = new GraphicsSetFontMethod(); * //methodList["GSETPEN"] = new GraphicsSetPenMethod(); * * //methodList["SPRITECREATE"] = new SpriteCreateMethod(); * //methodList["SPRITEDISPOSE"] = new SpriteDisposeMethod(); * * //methodList["CBGSETG"] = new CBGSetGraphicsMethod(); * //methodList["CBGSETSPRITE"] = new CBGSetCIMGMethod(); * //methodList["CBGCLEAR"] = new CBGClearMethod(); * * //methodList["CBGCLEARBUTTON"] = new CBGClearButtonMethod(); * //methodList["CBGREMOVERANGE"] = new CBGRemoveRangeMethod(); * //methodList["CBGREMOVEBMAP"] = new CBGRemoveBMapMethod(); * //methodList["CBGSETBMAPG"] = new CBGSetBMapGMethod(); * //methodList["CBGSETBUTTONSPRITE"] = new CBGSETButtonSpriteMethod(); * * //methodList["GSAVE"] = new GraphicsSaveMethod(); * //methodList["GLOAD"] = new GraphicsLoadMethod(); */ //1823 自分の関数名を知っていた方が何かと便利なので覚えさせることにした foreach (var pair in methodList) { pair.Value.SetMethodName(pair.Key); } }