Esempio n. 1
0
 public void SetType(string strType)
 {
     try
     {
         Enum.TryParse(strType, out accType);
     }
     catch (Exception ex)
     {
         accType = FieldAccessType.AnyAcc;
         Log.Logs(ex.Message);
     }
 }
Esempio n. 2
0
        public FieldAccessor(
            object ob,
            string fieldName,
            FieldAccessType accessType
            )
        {
            _ob         = ob;
            _fieldName  = fieldName;
            _accessType = accessType;

            _klass     = ob.GetType();
            _klassTree = new List <Type> {
                _klass
            };
        }
Esempio n. 3
0
        private static NSerializer GetSerializerAs(FieldFormatterType type, FieldAccessType accessType,
                                                   DateFormatType dateFormatType, bool withNulls)
        {
            var currentDirectory = Directory.GetParent(Directory.GetCurrentDirectory());
            var config           = new Dictionary <string, object>
            {
                { ConfigurationManager.MetadataDirKey, Path.Combine(currentDirectory.Parent?.Parent?.ToString(), "Resources") },
                { ConfigurationManager.IncludeNullValuesKey, withNulls },
                { ConfigurationManager.FieldFormattingMethodKey, type.ToString() },
                { ConfigurationManager.FieldAccessTypeKey, accessType.ToString() },
                { ConfigurationManager.DateFormatKey, dateFormatType.ToString() }
            };

            var configurationProvider = new MockConfigurationProvider(config);
            var environment           = new MockEnvironment();
            var cache = new MockCache();

            return(NSerializerBuilder.Build()
                   .WithCache(cache)
                   .WithConfigurationProvider(configurationProvider)
                   .WithEnvironment(environment)
                   .Get());
        }
Esempio n. 4
0
 public void SetAccessType(FieldAccessType accessType)
 {
     AccessType = accessType;
 }
Esempio n. 5
0
 protected Field(FieldAccessType accessType) {
     this.accessType = accessType;
 }
Esempio n. 6
0
 protected Field(FieldAccessType accessType)
 {
     this.accessType = accessType;
 }
Esempio n. 7
0
 public new void SetAccessType(FieldAccessType accessType)
 {
     throw new ArgumentException("Virtual properties have preset access type as PUBLIC_METHOD.");
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="accessType"></param>
 /// <param name="dataType"></param>
 /// <param name="fieldName"></param>
 public Field(FieldAccessType accessType, FieldDataType dataType, string fieldName)
 {
     _accessType = accessType;
     _dataType   = dataType;
     _fieldName  = fieldName;
 }