Beispiel #1
0
 public ViewColumn(IFieldRef fld)
 {
     this._title      = fld.Title;
     this._itemName   = fld.Name;
     this._isField    = true;
     this._fieldRef   = fld;
     this._canConvert = true;
 }
Beispiel #2
0
 public ViewColumn(IFieldRef fld, bool isDesc)
 {
     this._title            = fld.Title;
     this._itemName         = fld.Name;
     this._isField          = true;
     this._fieldRef         = fld;
     this._canConvert       = true;
     this._isSortDescending = isDesc;
 }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            if (!(obj is IFieldRef))
            {
                return(false);
            }
            IFieldRef other = (IFieldRef)obj;

            return(_name.Equals(other.Name) && _type.Equals(other.Type));
        }
Beispiel #4
0
        protected override IFieldRef CreateFieldRef(BaseTypeRef ret_type, string field_name)
        {
            /* Note: Using FullName here as we are caching in a static hashtable */
            string key = FullName + ret_type.FullName + field_name;

            IFieldRef fr = (IFieldRef)s_field_table [key];

            if (fr == null)
            {
                fr = new TypeSpecFieldRef(this, ret_type, field_name);
                s_field_table [key] = fr;
            }

            return(fr);
        }
Beispiel #5
0
        public PEAPI.Field ResolveField(string name, BaseTypeRef ret_type, CodeGen code_gen)
        {
            FieldDef fielddef = (FieldDef)field_table[new DictionaryEntry(name, ret_type.FullName)];

            if (fielddef != null)
            {
                return(fielddef.Resolve(code_gen, classdef));
            }

            ExternTypeRef type_ref = code_gen.ThisModule.GetTypeRef(FullName, false);
            IFieldRef     fieldref = type_ref.GetFieldRef(ret_type, name);

            fieldref.Resolve(code_gen);

            return(fieldref.PeapiField);
        }
Beispiel #6
0
 /// <summary>
 /// グループ項目追加
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddGroup_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.lsvFieldForGroup.SelectedItems.Count == 0)
         {
             return;
         }
         IFieldRef fld = this.lsvFieldForGroup.SelectedItems[0].Tag as IFieldRef;
         this._targetView.GroupColumns.Add(new ViewColumn(fld));
         InitGroupColumnTab();
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         RSM.ShowMessage(this, ex);
     }
 }
Beispiel #7
0
 /// <summary>
 /// 列設定情報リストビューを初期化する
 /// </summary>
 /// <param name="lstView"></param>
 /// <param name="columns"></param>
 /// <param name="showAsc"></param>
 private void InitViewColumns(ListView lstView, List <IViewColumn> columns, bool showAsc)
 {
     lstView.Items.Clear();
     foreach (IViewColumn column in columns)
     {
         IFieldRef fld = column.FieldRef;
         if (fld == null)
         {
             continue;
         }
         string       name   = string.IsNullOrEmpty(fld.Title) ? fld.Name : fld.Title;
         ListViewItem lvItem = lstView.Items.Add(name);
         lvItem.SubItems.Add(GetEnumName(fld.TargetType));
         if (showAsc)
         {
             string desc = column.IsSortDescending ? "降順" : "昇順";
             lvItem.SubItems.Add(desc);
         }
         lvItem.Tag = column;
     }
 }
Beispiel #8
0
        public virtual IFieldRef GetFieldRef(BaseTypeRef ret_type, string name)
        {
            IFieldRef fr  = null;
            string    key = ret_type.FullName + name;

            if (field_table == null)
            {
                field_table = new Hashtable();
            }
            else
            {
                fr = (IFieldRef)field_table [key];
            }

            if (fr == null)
            {
                fr = CreateFieldRef(ret_type, name);
                field_table [key] = fr;
            }

            return(fr);
        }
Beispiel #9
0
 private static FieldReference Resolve(IFieldRef fieldRef)
 {
     return(((CecilFieldRef)fieldRef).Field);
 }
Beispiel #10
0
 public FieldValue(IComparisonOperandAnchor root, IFieldRef field) : base(root)
 {
     _field = field;
 }
Beispiel #11
0
 internal Order(QueryContext context, IFieldRef field, bool desc)
     : base(context)
 {
     context.OrderByFields.Add(field, desc);
 }
Beispiel #12
0
 internal Group(QueryContext context, IFieldRef field)
     : base(context)
 {
     context.GroupByField = field;
 }
Beispiel #13
0
 public Order OrderBy(IFieldRef field, bool desc)
 {
     return new Order(this.Context, field, desc);
 }
Beispiel #14
0
 public Order OrderBy(IFieldRef field)
 {
     return new Order(this.Context, field, true);
 }
Beispiel #15
0
 public LdtokenInstr(IFieldRef field_ref, Location loc)
     : base(loc)
 {
     this.field_ref = field_ref;
 }
Beispiel #16
0
 public void LoadStaticField(IFieldRef fieldRef)
 {
     _il.Emit(OpCodes.Ldsfld, GetReference(fieldRef));
 }
Beispiel #17
0
 private static FieldReference GetReference(IFieldRef fieldRef)
 {
     return(CecilFieldRef.GetReference(fieldRef));
 }
        public void BindField(FieldInfo field)
        {
            Contracts.Require.IsNotNull("field", field);

            if (_boundField != null)
                throw new InvalidOperationException(String.Format("Already bound to field: {0}", _boundField.Name));
            if (IsStatic != field.IsStatic) throw new ArgumentException("Backing field and property scope must agree; either both static or both non-static");
            _boundField = new RawFieldRef(field);
        }
Beispiel #19
0
                public LdtokenInstr (IFieldRef field_ref, Location loc)
			: base (loc)
                {
                        this.field_ref = field_ref;
                }
Beispiel #20
0
 public FieldInstr(PEAPI.FieldOp op, IFieldRef operand, Location loc)
     : base(loc)
 {
     this.op      = op;
     this.operand = operand;
 }
Beispiel #21
0
                public FieldInstr (PEAPI.FieldOp op, IFieldRef operand, Location loc)
			: base (loc)
                {
                        this.op = op;
                        this.operand = operand;
                }
Beispiel #22
0
 public void LoadStaticField(IFieldRef fieldRef)
 {
     _il.Emit(OpCodes.Ldsfld, GetReference(fieldRef));
 }
		public FieldValue(IComparisonOperandAnchor root, IFieldRef field) : base(root)
		{
			_field = field;
		}
Beispiel #24
0
 public Order OrderBy(IFieldRef field, bool desc)
 {
     this.Context.OrderByFields.Add(field, desc);
     return this;
 }
Beispiel #25
0
 private static FieldReference GetReference(IFieldRef fieldRef)
 {
     return CecilFieldRef.GetReference(fieldRef);
 }
Beispiel #26
0
 private void WriteFieldRef(XmlWriter writer, IFieldRef fld)
 {
     writer.WriteStartElement("FieldRef");
     writer.WriteAttributeString("Name", fld.RealName);
     writer.WriteEndElement();
 }