Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        /**
         * 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()));
            }
        }
Ejemplo n.º 4
0
		/* === (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.
		}
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 public void writeExternal(BinaryWriter out_)
 {
     ExtUtil.writeNumeric(out_, len);
     for (int i = 0; i < len; i++)
     {
         ExtUtil.writeDecimal(out_, gp[i]);
     }
 }
Ejemplo n.º 7
0
 public void readExternal(BinaryReader in_, PrototypeFactory pf)
 {
     len = (int)ExtUtil.readNumeric(in_);
     for (int i = 0; i < len; i++)
     {
         gp[i] = ExtUtil.readDecimal(in_);
     }
 }
Ejemplo n.º 8
0
 public void writeExternal(BinaryWriter out_)
 {
     out_.Write(data.Length);
     for (int i = 0; i < data.Length; ++i)
     {
         ExtUtil.write(out_, new ExtWrapTagged(data[i]));
     }
 }
Ejemplo n.º 9
0
 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)));
 }
Ejemplo n.º 10
0
 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
 }
Ejemplo n.º 11
0
        public IJwsSigner Get(IDictionary <string, object> extParams = null)
        {
            var signer = new Rs256Signer();

            ExtUtil.ResolveParams(EXT_PARAMS, extParams, signer.Params);
            signer.Init();
            return(signer);
        }
Ejemplo n.º 12
0
 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
 }
Ejemplo n.º 13
0
 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));
 }
Ejemplo n.º 14
0
		//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.
		}
Ejemplo n.º 15
0
 /**
  * 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));
 }
Ejemplo n.º 16
0
 /* (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));
 }
Ejemplo n.º 17
0
 /*
  * (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());
 }
Ejemplo n.º 18
0
        /// <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());
        }
Ejemplo n.º 19
0
        /* (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
        }
Ejemplo n.º 20
0
        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());
            }
        }
Ejemplo n.º 21
0
        public Boolean equals(Object o)
        {
            if (!(o is TableLocaleSource))
            {
                return(false);
            }
            TableLocaleSource l = (TableLocaleSource)o;

            return(ExtUtil.Equals(localeData, l.localeData));
        }
Ejemplo n.º 22
0
        /* (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
        }
Ejemplo n.º 23
0
        /* (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));
        }
Ejemplo n.º 24
0
        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];
            }
        }
Ejemplo n.º 25
0
        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];
            }
        }
Ejemplo n.º 26
0
 public void readExternal(BinaryReader in_, PrototypeFactory pf)
 {
     if (in_.ReadByte() == (byte)0x00)
     {
         d = ExtUtil.readNumeric(in_);
     }
     else
     {
         d = ExtUtil.readDecimal(in_);
     }
 }
Ejemplo n.º 27
0
        /*
         * (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));
        }
Ejemplo n.º 28
0
 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);
     }
 }
Ejemplo n.º 29
0
        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));
        }
Ejemplo n.º 30
0
        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));
        }