Beispiel #1
0
 public string GenerateRedirctUrl(string returnUrl, EnumScope scope = EnumScope.snsapi_base, string state = null)
 {
     returnUrl = WebUtility.UrlEncode(returnUrl);
     if (!string.IsNullOrWhiteSpace(state))
     {
         state = WebUtility.UrlEncode(state);
     }
     return($"https://open.weixin.qq.com/connect/oauth2/authorize?appid={WechatConfig.AppID}&redirect_uri={returnUrl}&response_type=code&scope={scope:G}&state={state}#wechat_redirect");
 }
Beispiel #2
0
 public WorkshopEnumType(EnumData enumData) : base(enumData.CodeName)
 {
     EnumData = enumData;
     foreach (var member in enumData.Members)
     {
         var scopedMember = new ScopedEnumMember(this, member);
         EnumScope.AddVariable(scopedMember, null, null);
     }
     EnumScope.ErrorName = "enum " + Name;
 }
Beispiel #3
0
        private TypeScope CreateInterfaceCommonType(string name, int offset)
        {
            TypeScope ctn = (TypeScope)members[offset];

            if (ctn != null)
            {
                return(ctn);
            }
            bool in_scope = false;

            if (name != null)
            {
                in_scope = true;
            }
            bool is_interface = br.ReadBoolean();

            if (is_interface)//ïðîïóñêàåì ôëàã - èíòåðôåéñíîñòè
            {
                name = GetString(br.ReadInt32());
            }
            else
            {
                name = br.ReadString();
            }
            //br.ReadInt32();
            //ssyy
            //×èòàåì, ÿâëÿåòñÿ ëè òèï èíòåðôåéñîì
            bool type_is_interface = (br.ReadByte() == 1);

            //×èòàåì, ÿâëÿåòñÿ ëè òèï äåëåãàòîì
            bool type_is_delegate = (br.ReadByte() == 1);
            //\ssyy

            bool type_is_generic_definition = (br.ReadByte() == 1);

            if (type_is_generic_definition)
            {
                throw new Exception();
            }
            TypeScope base_type     = GetTypeReference();
            bool      is_value_type = br.ReadBoolean();

            //ssyy
            //×èòàåì ïîääåðæèâàåìûå èíòåðôåéñû
            int interf_count            = br.ReadInt32();
            List <TypeScope> interfaces = new List <TypeScope>();

            for (int i = 0; i < interf_count; i++)
            {
                interfaces.Add(GetTypeReference());
            }
            //\ssyy
            object low_val   = null;
            object upper_val = null;

            PascalABCCompiler.SemanticTree.type_access_level tal = (PascalABCCompiler.SemanticTree.type_access_level)br.ReadByte();
            PascalABCCompiler.SemanticTree.type_special_kind tsk = (PascalABCCompiler.SemanticTree.type_special_kind)br.ReadByte();
            bool is_sealed   = br.ReadBoolean();
            bool is_abstract = br.ReadBoolean();

            if (tsk == PascalABCCompiler.SemanticTree.type_special_kind.diap_type)
            {
                low_val   = CreateExpression();
                upper_val = CreateExpression();
            }

            TypeScope element_type = null;

            if (CanReadObject())
            {
                element_type = GetTypeReference();
            }
            switch (tsk)
            {
            case PascalABCCompiler.SemanticTree.type_special_kind.none_kind: ctn = new TypeScope(SymbolKind.Class, cur_scope, base_type); break;

            case PascalABCCompiler.SemanticTree.type_special_kind.record: ctn = new TypeScope(SymbolKind.Struct, cur_scope, base_type); break;

            case PascalABCCompiler.SemanticTree.type_special_kind.array_wrapper: ctn = new ArrayScope(); break;

            case PascalABCCompiler.SemanticTree.type_special_kind.enum_kind: ctn = new EnumScope(SymbolKind.Enum, cur_scope, base_type); break;

            case PascalABCCompiler.SemanticTree.type_special_kind.set_type: ctn = new SetScope(element_type); break;

            case PascalABCCompiler.SemanticTree.type_special_kind.array_kind: if (!in_scope)
                {
                    ctn = new ArrayScope();
                }
                else
                {
                    return(null);
                } break;

            case PascalABCCompiler.SemanticTree.type_special_kind.diap_type: ctn = new DiapasonScope(low_val, upper_val); break;

            case PascalABCCompiler.SemanticTree.type_special_kind.typed_file: ctn = new FileScope(element_type, null); break;

            case PascalABCCompiler.SemanticTree.type_special_kind.binary_file: ctn = new FileScope(null, null); break;
            }
            ctn.declaringUnit = root_scope;
            ctn.si.name       = name;
            ctn.is_abstract   = is_abstract;
            ctn.is_final      = is_sealed;
            AddMember(ctn, offset);
            ctn.elementType = element_type;

            br.ReadInt32();
            br.ReadInt32();//attributes
            //common_namespace_node ns = cun.namespaces[0];
            byte flag         = br.ReadByte();
            int  def_prop_off = 0;

            if (flag == 1)
            {
                def_prop_off = br.ReadInt32();
            }
            ReadDebugInfo();
            ctn.si.description = ctn.GetDescription();
            //ñîçäàåì scope äëÿ êëàññà
            //ctn = new wrapped_common_type_node(this, base_type, name, tal, ns, scope, loc, offset);
            //members[offset] = ctn;
            //AddMember(ctn, offset);
            RestoreAllMembers(ctn);

            return(ctn);
        }
Beispiel #4
0
 static JDFAutoUsageCounter()
 {
     atrInfoTable[0] = new AtrInfoTable(AttributeName.COUNTERID, 0x33333111, AttributeInfo.EnumAttributeType.string_, null, null);
     atrInfoTable[1] = new AtrInfoTable(AttributeName.SCOPE, 0x22222111, AttributeInfo.EnumAttributeType.enumeration, EnumScope.getEnum(0), null);
     atrInfoTable[2] = new AtrInfoTable(AttributeName.COUNTERTYPES, 0x33333111, AttributeInfo.EnumAttributeType.NMTOKENS, null, null);
 }
Beispiel #5
0
 ///
 ///          <summary> * (9) get attribute Scope </summary>
 ///          * <returns> the value of the attribute </returns>
 ///
 public virtual EnumScope getScope()
 {
     return(EnumScope.getEnum(getAttribute(AttributeName.SCOPE, null, null)));
 }
Beispiel #6
0
 //         ---------------------------------------------------------------------
 //        Methods for Attribute Scope
 //        ---------------------------------------------------------------------
 ///
 ///          <summary> * (5) set attribute Scope </summary>
 ///          * <param name="enumVar">: the enumVar to set the attribute to </param>
 ///
 public virtual void setScope(EnumScope enumVar)
 {
     setAttribute(AttributeName.SCOPE, enumVar == null ? null : enumVar.getName(), null);
 }