public InstanceProperty(MemberObject m, int type_id)
 {
     this.m = m;
     this.TypeId = type_id;
 }
Beispiel #2
0
 public void AddMember(MemberObject m)
 {
     this.Members.Add(m);
 }
Beispiel #3
0
 public static int CompareAccessibility(MemberObject m1, MemberObject m2)
 {
     if (CSLite_System.PosCh('[', m1.Name) < 0)
     {
         if (CSLite_System.PosCh('[', m2.Name) >= 0)
         {
             return 0;
         }
         if (m1.HasModifier(Modifier.Public))
         {
             if (m2.HasModifier(Modifier.Public) || m2.HasModifier(Modifier.Friend))
             {
                 return 0;
             }
             return 1;
         }
         if (m1.HasModifier(Modifier.Friend))
         {
             if (m2.HasModifier(Modifier.Public) || m2.HasModifier(Modifier.Friend))
             {
                 return 0;
             }
             return 1;
         }
         if (m1.HasModifier(Modifier.Protected))
         {
             if (m2.HasModifier(Modifier.Public))
             {
                 return -1;
             }
             if (m2.HasModifier(Modifier.Protected))
             {
                 return 0;
             }
             return 1;
         }
         if (m2.HasModifier(Modifier.Public))
         {
             return -1;
         }
         if (m2.HasModifier(Modifier.Protected))
         {
             return -1;
         }
     }
     return 0;
 }
Beispiel #4
0
 public void RegisterInstance(string full_name, object instance, bool need_check)
 {
     if (!need_check || (this.LookupFullName(full_name, true) <= 0))
     {
         char ch;
         string str = CSLite_System.ExtractName(full_name);
         string str2 = CSLite_System.ExtractOwner(full_name, out ch);
         Type t = instance.GetType();
         int num = this.RegisterType(t, true);
         int num2 = this.RegisterNamespace(str2);
         int id = this.AppVar();
         this[id].Name = str;
         this[id].Level = num2;
         this[id].Kind = MemberKind.Var;
         this[id].TypeId = this.RegisterType(t, false);
         this[id].Val = instance;
         MemberObject m = new MemberObject(this.scripter, id, num2);
         m.Modifiers.Add(Modifier.Public);
         m.Modifiers.Add(Modifier.Static);
         ((ClassObject) this[num2].Val).AddMember(m);
     }
 }
Beispiel #5
0
 public int Add(MemberObject m)
 {
     this.items.Add(m);
     return this.Count;
 }
Beispiel #6
0
 private void OperCreateUsingAlias()
 {
     int nameIndex = this.symbol_table[this.r.arg1].NameIndex;
     bool upcase = this.GetUpcase();
     ClassObject classObject = this.GetClassObject(this.r.arg2);
     MemberObject memberByNameIndex = classObject.GetMemberByNameIndex(nameIndex, upcase);
     if (memberByNameIndex == null)
     {
         memberByNameIndex = new MemberObject(this.scripter, this.r.arg1, classObject.Id);
         memberByNameIndex.PCodeLine = this.n;
         memberByNameIndex.Kind = MemberKind.Alias;
         classObject.AddMember(memberByNameIndex);
         this.PutVal(memberByNameIndex.Id, memberByNameIndex);
     }
     else
     {
         this.scripter.CreateErrorObjectEx("CS1537. The using alias 'alias' appeared previously in this namespace.", new object[] { memberByNameIndex.Name });
         return;
     }
     this.symbol_table[this.r.arg1].Kind = MemberKind.Alias;
     this.n++;
 }