/// <summary> /// 定位方法 /// </summary> /// <returns></returns> private bool ToFunc(Window win) { // 匹配方法定义代码 string pattern = @"\w_ \.\<\>\[\]\t\n"; switch (_funcInfo.ParamNum) { // -1不匹配参数个数 case -1: pattern = $@"public\svirtual\s[a-zA-Z]+\s{_funcInfo.Func}\([^\)]*\)"; break; case 0: pattern = $@"public\svirtual\s[a-zA-Z]+\s{_funcInfo.Func}\(\)"; break; case 1: pattern = $@"public\svirtual\s[a-zA-Z]+\s{_funcInfo.Func}\([{pattern}]+\)"; break; default: pattern = $@"public\svirtual\s[a-zA-Z]+\s{_funcInfo.Func}\(([{pattern}]+,){{{_funcInfo.ParamNum - 1}}}[{pattern}]+\)"; break; } return(ExtUtil.ToCode(win, pattern)); }
private void LoadData(string chaseno) { string query = string.Format("select f_applicant, f_content, f_type, f_start, f_end, f_approver, f_title from TB_FORM where f_chaseno = '{0}'", chaseno); using (IDataReader reader = DataService.GetInstance().ExecuteReader(query)) { while (reader.Read()) { txtName.Text = reader.GetString(0); Byte[] content = new Byte[Convert.ToInt32((reader.GetBytes(1, 0, null, 0, Int32.MaxValue)))]; long bytesReceived = reader.GetBytes(1, 0, content, 0, content.Length); ASCIIEncoding encoding = new ASCIIEncoding(); rtbContent.Rtf = encoding.GetString(content, 0, Convert.ToInt32(bytesReceived)); string category = reader.GetString(2); if (category == "IT技術支援") { ckbSupport.Checked = true; } if (category == "IT意見箱") { ckbComment.Checked = true; } txtStart.Text = reader.GetString(3); txtEnd.Text = reader.GetString(4); txtApprover.Text = reader.GetString(5); txtTitle.Text = reader.GetString(6); } } lblExt.Text = "Ext. : " + ExtUtil.GetExt(txtName.Text.Trim()); }
/** * recursively write out a node of the instance * @param out * @param e * @param ref * @throws IOException */ private void writeTreeElement(BinaryWriter out_, TreeElement e) { TreeElement templ = instance.getTemplatePath(e.getRef()); Boolean isGroup = !templ.isLeaf(); if (isGroup) { ArrayList childTypesHandled = new ArrayList(); for (int i = 0; i < templ.getNumChildren(); i++) { String childName = templ.getChildAt(i).getName(); if (!childTypesHandled.Contains(childName)) { childTypesHandled.Add(childName); int mult = e.getChildMultiplicity(childName); if (mult > 0 && !e.getChild(childName, 0).isRelevant()) { mult = 0; } ExtUtil.writeNumeric(out_, mult); for (int j = 0; j < mult; j++) { writeTreeElement(out_, e.getChild(childName, j)); } } } } else { ExtUtil.write(out_, new ExtWrapAnswerData(this, e.dataType, e.getValue())); } }
/* === (DE)SERIALIZATION === */ /// <summary> Read the object from stream.</summary> //UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public virtual void readExternal(System.IO.BinaryReader dis, PrototypeFactory pf) { fallbackDefaultLocale = ExtUtil.readBool(dis); fallbackDefaultForm = ExtUtil.readBool(dis); localeResources =(OrderedMap < String, List< LocaleDataSource >>) ExtUtil.read(dis, new ExtWrapMap(String. }
public static FormDef getFormFromSerializedResource(System.String resource) { FormDef returnForm = null; //UPGRADE_ISSUE: Method 'java.lang.Class.getResourceAsStream' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangClassgetResourceAsStream_javalangString'" //UPGRADE_ISSUE: Class 'java.lang.System' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangSystem'" System.IO.Stream is_Renamed = typeof(Type).Assembly.GetManifestResourceStream(resource); //UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" System.IO.BinaryReader dis = null; try { if (is_Renamed != null) { dis = new System.IO.BinaryReader(is_Renamed); returnForm = (FormDef)ExtUtil.read(dis, typeof(FormDef)); } else { //#if debug.output==verbose System.Console.Out.WriteLine("ResourceStream NULL"); //#endif } } catch (System.IO.IOException e) { Console.Error.WriteLine(e.StackTrace); } catch (DeserializationException e) { Console.Error.WriteLine(e.StackTrace); } finally { if (is_Renamed != null) { try { is_Renamed.Close(); } catch (System.IO.IOException e) { Console.Error.WriteLine(e.StackTrace); } } if (dis != null) { try { //UPGRADE_TODO: Method 'java.io.FilterInputStream.close' was converted to 'System.IO.BinaryReader.Close' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioFilterInputStreamclose'" dis.Close(); } catch (System.IO.IOException e) { Console.Error.WriteLine(e.StackTrace); } } } return(returnForm); }
public void writeExternal(BinaryWriter out_) { ExtUtil.writeNumeric(out_, len); for (int i = 0; i < len; i++) { ExtUtil.writeDecimal(out_, gp[i]); } }
public void readExternal(BinaryReader in_, PrototypeFactory pf) { len = (int)ExtUtil.readNumeric(in_); for (int i = 0; i < len; i++) { gp[i] = ExtUtil.readDecimal(in_); } }
public void writeExternal(BinaryWriter out_) { out_.Write(data.Length); for (int i = 0; i < data.Length; ++i) { ExtUtil.write(out_, new ExtWrapTagged(data[i])); } }
public void readExternal(BinaryReader in_, PrototypeFactory pf) { ref_ = (IDataReference)ExtUtil.read(in_, new ExtWrapTagged(typeof(IDataReference))); method = ExtUtil.readString(in_); action = ExtUtil.readString(in_); mediaType = ExtUtil.nullIfEmpty(ExtUtil.readString(in_)); attributeMap = (Dictionary <String, String>)ExtUtil.read(in_, new ExtWrapMap(typeof(String), typeof(String))); }
public void readExternal(BinaryReader in_renamed, PrototypeFactory pf) { isLocalizable_ = ExtUtil.readBool(in_renamed); setLabelInnerText(ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed))); TextID = ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed)); value = ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed)); //index will be set by questiondef }
public IJwsSigner Get(IDictionary <string, object> extParams = null) { var signer = new Rs256Signer(); ExtUtil.ResolveParams(EXT_PARAMS, extParams, signer.Params); signer.Init(); return(signer); }
public void writeExternal(BinaryWriter out_renamed) { ExtUtil.writeBool(out_renamed, isLocalizable_); ExtUtil.writeString(out_renamed, ExtUtil.emptyIfNull(labelInnerText)); ExtUtil.writeString(out_renamed, ExtUtil.emptyIfNull(textID)); ExtUtil.writeString(out_renamed, ExtUtil.emptyIfNull(value)); //don't serialize index; it will be restored from questiondef }
public void writeExternal(BinaryWriter out_) { ExtUtil.write(out_, new ExtWrapTagged(ref_)); ExtUtil.writeString(out_, method); ExtUtil.writeString(out_, action); ExtUtil.writeString(out_, ExtUtil.emptyIfNull(mediaType)); ExtUtil.write(out_, new ExtWrapMap(attributeMap)); }
//UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public virtual void readExternal(System.IO.BinaryReader in_Renamed, PrototypeFactory pf) { ref_Renamed = (IDataReference) ExtUtil.read(in_Renamed, new ExtWrapTagged(typeof(IDataReference))); method = ExtUtil.readString(in_Renamed); action = ExtUtil.nullIfEmpty(ExtUtil.readString(in_Renamed)); mediaType = ExtUtil.nullIfEmpty(ExtUtil.readString(in_Renamed)); attributeMap =(HashMap < String, String >) ExtUtil.read(in, new ExtWrapMap(String. }
/** * Write the object to stream. */ public void writeExternal(BinaryWriter dos) { ExtUtil.writeBool(dos, fallbackDefaultLocale); ExtUtil.writeBool(dos, fallbackDefaultForm); ExtUtil.write(dos, new ExtWrapMap(localeResources, new ExtWrapListPoly())); ExtUtil.write(dos, new ExtWrapList(locales)); ExtUtil.write(dos, new ExtWrapNullable(defaultLocale)); ExtUtil.write(dos, new ExtWrapNullable(currentLocale)); }
/* (non-Javadoc) * @see org.javarosa.core.util.externalizable.Externalizable#writeExternal(java.io.DataOutputStream) */ //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'" public virtual void writeExternal(System.IO.BinaryWriter out_Renamed) { out_Renamed.Write(payload.Length); if (payload.Length > 0) { out_Renamed.Write(payload); } ExtUtil.writeString(out_Renamed, ExtUtil.emptyIfNull(id)); }
/* * (non-Javadoc) * * @see * org.javarosa.core.services.storage.utilities.Externalizable#writeExternal * (java.io.DataOutputStream) */ public void writeExternal(BinaryWriter out_) { ExtUtil.writeNumeric(out_, id); ExtUtil.writeNumeric(out_, formId); ExtUtil.write(out_, new ExtWrapNullable(name)); ExtUtil.write(out_, new ExtWrapNullable(schema)); ExtUtil.write(out_, new ExtWrapNullable(dateSaved)); ExtUtil.write(out_, new ExtWrapMap(namespaces)); ExtUtil.write(out_, getRoot()); }
/// <summary> /// 根据service名称获取require引用代码 /// </summary> /// <param name="service"></param> /// <returns>例如:Mysoft.Gtxt.GtFaMng.AppServices.GtFaAppService</returns> private string GetJs(string service) { // appService = require("Mysoft.Gtxt.GtFaMng.AppServices.GtFaAppService") string text = ExtUtil.FindCode(Dte.ActiveWindow, $@"\b{service}\s+=\s+require\([""|'].+?[""|']\)"); string pattern = $@"(?<=\brequire\([""|']).+?(?=[""|']\))"; string value = Regex.Match(text, pattern, RegexOptions.IgnoreCase).Value; return(value.Trim()); }
/* (non-Javadoc) * @see org.javarosa.core.services.storage.utilities.Externalizable#writeExternal(java.io.DataOutputStream) */ public void writeExternal(BinaryWriter out_) { ExtUtil.write(out_, new ExtWrapNullable(ID)); ExtUtil.writeNumeric(out_, DataType); ExtUtil.write(out_, new ExtWrapNullable(Preload)); ExtUtil.write(out_, new ExtWrapNullable(PreloadParams)); ExtUtil.write(out_, new ExtWrapTagged(ref_)); //don't bother writing relevancy/required/readonly/constraint/calculate right now; they're only used during parse anyway }
public void readExternal(BinaryReader in_, PrototypeFactory pf) { int length = in_.ReadInt32(); data = new IDataPointer[length]; for (int i = 0; i < data.Length; ++i) { data[i] = (IDataPointer)ExtUtil.read(in_, new ExtWrapTagged()); } }
public Boolean equals(Object o) { if (!(o is TableLocaleSource)) { return(false); } TableLocaleSource l = (TableLocaleSource)o; return(ExtUtil.Equals(localeData, l.localeData)); }
/* (non-Javadoc) * @see org.javarosa.core.services.storage.utilities.Externalizable#readExternal(java.io.DataInputStream) */ public void readExternal(BinaryReader in_, PrototypeFactory pf) { ID = ((String)ExtUtil.read(in_, new ExtWrapNullable(typeof(String)), pf)); DataType = (ExtUtil.readInt(in_)); Preload = ((String)ExtUtil.read(in_, new ExtWrapNullable(typeof(String)), pf)); PreloadParams = ((String)ExtUtil.read(in_, new ExtWrapNullable(typeof(String)), pf)); ref_ = (IDataReference)ExtUtil.read(in_, new ExtWrapTagged()); //don't bother reading relevancy/required/readonly/constraint/calculate right now; they're only used during parse anyway }
/* (non-Javadoc) * @see org.javarosa.core.util.externalizable.Externalizable#readExternal(java.io.DataInputStream, org.javarosa.core.util.externalizable.PrototypeFactory) */ //UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public virtual void readExternal(System.IO.BinaryReader in_Renamed, PrototypeFactory pf) { int length = in_Renamed.ReadInt32(); if (length > 0) { this.payload = new byte[length]; in_Renamed.Read(this.payload, 0, this.payload.Length); } id = ExtUtil.nullIfEmpty(ExtUtil.readString(in_Renamed)); }
public void readExternal(BinaryReader in_, PrototypeFactory pf) { x = (XPathExpression)ExtUtil.read(in_, new ExtWrapTagged(), pf); ArrayList v = (ArrayList)ExtUtil.read(in_, new ExtWrapListPoly(), pf); predicates = new XPathExpression[v.Count]; for (int i = 0; i < predicates.Length; i++) { predicates[i] = (XPathExpression)v[i]; } }
public void readExternal(BinaryReader in_renamed, PrototypeFactory pf) { id = (XPathQName)ExtUtil.read(in_renamed, typeof(XPathQName)); ArrayList v = (ArrayList)ExtUtil.read(in_renamed, new ExtWrapListPoly(), pf); args = new XPathExpression[v.Count]; for (int i = 0; i < args.Length; i++) { args[i] = (XPathExpression)v[i]; } }
public void readExternal(BinaryReader in_, PrototypeFactory pf) { if (in_.ReadByte() == (byte)0x00) { d = ExtUtil.readNumeric(in_); } else { d = ExtUtil.readDecimal(in_); } }
/* * (non-Javadoc) * * @see * org.javarosa.core.services.storage.utilities.Externalizable#readExternal * (java.io.DataInputStream) */ public void readExternal(BinaryReader in_, PrototypeFactory pf) { id = ExtUtil.readInt(in_); formId = ExtUtil.readInt(in_); name = (String)ExtUtil.read(in_, new ExtWrapNullable(typeof(String)), pf); schema = (String)ExtUtil.read(in_, new ExtWrapNullable(typeof(String)), pf); dateSaved = (DateTime)ExtUtil.read(in_, new ExtWrapNullable(typeof(DateTime)), pf); namespaces = (Hashtable)ExtUtil.read(in_, new ExtWrapMap(typeof(String), typeof(String))); setRoot((TreeElement)ExtUtil.read(in_, typeof(TreeElement), pf)); }
public Boolean equals(Object o) { if (o is XPathQName) { XPathQName x = (XPathQName)o; return(ExtUtil.Equals(namespace_, x.namespace_) && name.Equals(x.name)); } else { return(false); } }
public void writeExternal(BinaryWriter out_) { ArrayList v = new ArrayList(); for (int i = 0; i < predicates.Length; i++) { v.Add(predicates[i]); } ExtUtil.write(out_, new ExtWrapTagged(x)); ExtUtil.write(out_, new ExtWrapListPoly(v)); }
public void writeExternal(BinaryWriter out_renamed) { ArrayList v = new ArrayList(); for (int i = 0; i < args.Length; i++) { v.Add(args[i]); } ExtUtil.write(out_renamed, id); ExtUtil.write(out_renamed, new ExtWrapListPoly(v)); }