Пример #1
0
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     if (string.IsNullOrEmpty(_endpointName))
     {
         result = new VismaNetDynamicEndpoint(binder.Name.ToLower(), _auth, _isResourceEndpoint);
         return(true);
     }
     else
     {
         result = new VismaNetDynamicEndpoint($"{_endpointName}/{binder.Name.ToLower()}", _auth, _isResourceEndpoint);
         return(true);
     }
 }
Пример #2
0
        public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result)
        {
            var index = indexes[0]?.ToString().ToLower();

            if (string.IsNullOrEmpty(_endpointName))
            {
                result = new VismaNetDynamicEndpoint(index, _auth, _isResourceEndpoint);
                return(true);
            }
            else
            {
                result = new VismaNetDynamicEndpoint($"{_endpointName}/{index}", _auth, _isResourceEndpoint);
                return(true);
            }
        }
Пример #3
0
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     if (string.Equals(binder.Name, "resources", System.StringComparison.OrdinalIgnoreCase))
     {
         result = new VismaNetDynamicEndpoint(null, Auth, true);
     }
     else if (string.Equals(binder.Name, "dynamic", System.StringComparison.OrdinalIgnoreCase))
     {
         result = new VismaNetDynamicEndpoint(null, Auth);
     }
     else
     {
         result = new VismaNetDynamicEndpoint(binder.Name, Auth);
     }
     return(true);
 }
 public override bool TryGetMember(GetMemberBinder binder, out object result)
 {
     result = new VismaNetDynamicEndpoint(binder.Name, Auth);
     return(true);
 }