public void SetType(string strType) { try { Enum.TryParse(strType, out accType); } catch (Exception ex) { accType = FieldAccessType.AnyAcc; Log.Logs(ex.Message); } }
public FieldAccessor( object ob, string fieldName, FieldAccessType accessType ) { _ob = ob; _fieldName = fieldName; _accessType = accessType; _klass = ob.GetType(); _klassTree = new List <Type> { _klass }; }
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()); }
public void SetAccessType(FieldAccessType accessType) { AccessType = accessType; }
protected Field(FieldAccessType accessType) { this.accessType = accessType; }
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; }