コード例 #1
0
 /// <summary>
 /// Remove o valor do campo com o nome informado.
 /// </summary>
 /// <param name="fieldName">Nome do campo que será removido.</param>
 public void RemoveValueByField(OperationContextFieldName fieldName)
 {
     if (_fieldValueTable != null)
     {
         _fieldValueTable.Remove(fieldName);
     }
 }
コード例 #2
0
ファイル: OperationContext.cs プロジェクト: yongwuhou/NCache
        public static OperationContext Create(PoolManager poolManager, OperationContextFieldName fieldName, object fieldValue)
        {
            var instance = Create(poolManager);

            instance.Add(fieldName, fieldValue);
            return(instance);
        }
コード例 #3
0
        public object GetValueByField(OperationContextFieldName fieldName)
        {
            object result = null;

            if (_fieldValueTable != null)
                result = _fieldValueTable[fieldName];

            return result;
        }
コード例 #4
0
        /// <summary>
        /// Recupera o valor pelo nome do campo informado.
        /// </summary>
        /// <param name="fieldName"></param>
        /// <returns></returns>
        public object GetValueByField(OperationContextFieldName fieldName)
        {
            object obj2 = null;

            if (_fieldValueTable != null)
            {
                obj2 = _fieldValueTable[fieldName];
            }
            return(obj2);
        }
コード例 #5
0
        public void Add(OperationContextFieldName fieldName, object fieldValue)
        {
            lock (this)
            {
                if (_fieldValueTable == null)
                    _fieldValueTable = new Hashtable();

                _fieldValueTable[fieldName] = fieldValue;
            }
        }
コード例 #6
0
        /// <summary>
        /// Verifica se no contexto existe algum valor para o nome de campo informado.
        /// </summary>
        /// <param name="fieldName"></param>
        /// <returns></returns>
        public bool Contains(OperationContextFieldName fieldName)
        {
            bool flag = false;

            if (_fieldValueTable != null)
            {
                flag = _fieldValueTable.Contains(fieldName);
            }
            return(flag);
        }
コード例 #7
0
 /// <summary>
 /// Adiciona um novo campo para o contexto.
 /// </summary>
 /// <param name="fieldName">Nome do campo.</param>
 /// <param name="fieldValue">Valor do campo.</param>
 public void Add(OperationContextFieldName fieldName, object fieldValue)
 {
     lock (this)
     {
         if (_fieldValueTable == null)
         {
             _fieldValueTable = new Hashtable();
         }
         _fieldValueTable[fieldName] = fieldValue;
     }
 }
コード例 #8
0
        public bool Contains(OperationContextFieldName fieldName)
        {
            bool contains = false;

            if (_fieldValueTable != null)
            {
                contains = _fieldValueTable.Contains(fieldName);
            }

            return(contains);
        }
コード例 #9
0
        public object GetValueByField(OperationContextFieldName fieldName)
        {
            object result = null;

            if (_fieldValueTable != null)
            {
                result = _fieldValueTable[fieldName];
            }

            return(result);
        }
コード例 #10
0
 public static OperationContext CreateWith(OperationContextFieldName field, object value)
 {
     return(new OperationContext().With(field, value));
 }
コード例 #11
0
ファイル: OperationContext.cs プロジェクト: yongwuhou/NCache
 public OperationContext(OperationContextFieldName fieldName, object fieldValue) : this()
 {
     Add(fieldName, fieldValue);
 }
コード例 #12
0
 public OperationContext(OperationContextFieldName fieldName, object fieldValue)
 {
     CreateOperationId();
     Add(fieldName, fieldValue);
 }
コード例 #13
0
ファイル: OperationContext.cs プロジェクト: yongwuhou/NCache
        public static OperationContext CreateAndMarkInUse(PoolManager poolManager, int moduleRefId, OperationContextFieldName fieldName, object fieldValue)
        {
            var instance = Create(poolManager, fieldName, fieldValue);

            instance.MarkInUse(moduleRefId);
            return(instance);
        }
コード例 #14
0
 public void RemoveValueByField(OperationContextFieldName fieldName)
 {
     lock (this)
     {
         if (_fieldValueTable != null)
             _fieldValueTable.Remove(fieldName);
     }
 }
コード例 #15
0
 public OperationContext(OperationContextFieldName fieldName, object fieldValue)
 {
     CreateOperationId();
     Add(fieldName, fieldValue);
 }
コード例 #16
0
        public bool Contains(OperationContextFieldName fieldName)
        {
            bool contains = false;

            if (_fieldValueTable != null)
                contains = _fieldValueTable.Contains(fieldName);

            return contains;
        }
コード例 #17
0
 public OperationContext With(OperationContextFieldName field, object value)
 {
     Add(field, value);
     return(this);
 }