本文整理汇总了C#中ProviderType类的典型用法代码示例。如果您正苦于以下问题:C# ProviderType类的具体用法?C# ProviderType怎么用?C# ProviderType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProviderType类属于命名空间,在下文中一共展示了ProviderType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SqlGrouping
internal SqlGrouping(Type clrType, ProviderType sqlType, SqlExpression key, SqlExpression group, Expression sourceExpression)
: base(SqlNodeType.Grouping, clrType, sqlType, sourceExpression) {
if (key == null) throw Error.ArgumentNull("key");
if (group == null) throw Error.ArgumentNull("group");
this.key = key;
this.group = group;
}
示例2: CryptoServiceProviderHash
internal CryptoServiceProviderHash(
String provider,
ProviderType providerType,
AlgorithmId algorithm)
: base(provider, providerType, algorithm)
{
}
示例3: LoadFiles
public virtual ActionResult LoadFiles(int id, ProviderType type)
{
var toRet = new List<ImageJson>();
//to recover files state in case of error
var filesFromCache = _ObjectStore.Get<PictureDataContainer>(PictureData.GetKey(type));
if (filesFromCache == null)
{
var provider = GetProvider(type, id);
if (provider == null)
return Json(toRet, "text/html");
filesFromCache = new PictureDataContainer(provider);
}
var urlHelper = new UrlHelper(ControllerContext.RequestContext);
var folder = PictureData.GetFolder(type);
foreach (var file in filesFromCache.Files)
{
var url = ControllerHelpers.GetUserImagePath(file.FileName, true, folder);
var deleteUrl = urlHelper.Action(MVC.UploadImage.DeleteImage(file.FileName));
toRet.Add(new ImageJson
{
name = file.FileName,
delete_url = deleteUrl,
thumbnail_url = url,
url = url,
is_default = file.IsDefault ? "true" : null,
is_logo = file.IsLogo ? "true" : null
});
}
return Json(toRet, "text/html");
}
示例4: SqlBinary
internal SqlBinary(SqlNodeType nt, Type clrType, ProviderType sqlType, SqlExpression left, SqlExpression right, MethodInfo method)
: base(nt, clrType, sqlType, right.SourceExpression) {
switch (nt) {
case SqlNodeType.Add:
case SqlNodeType.Sub:
case SqlNodeType.Mul:
case SqlNodeType.Div:
case SqlNodeType.Mod:
case SqlNodeType.BitAnd:
case SqlNodeType.BitOr:
case SqlNodeType.BitXor:
case SqlNodeType.And:
case SqlNodeType.Or:
case SqlNodeType.GE:
case SqlNodeType.GT:
case SqlNodeType.LE:
case SqlNodeType.LT:
case SqlNodeType.EQ:
case SqlNodeType.NE:
case SqlNodeType.EQ2V:
case SqlNodeType.NE2V:
case SqlNodeType.Concat:
case SqlNodeType.Coalesce:
break;
default:
throw Error.UnexpectedNode(nt);
}
this.Left = left;
this.Right = right;
this.method = method;
}
示例5: SqlUnary
internal SqlUnary(SqlNodeType nt, Type clrType, ProviderType sqlType, SqlExpression expr, MethodInfo method, Expression sourceExpression)
: base(nt, clrType, sqlType, sourceExpression) {
switch (nt) {
case SqlNodeType.Not:
case SqlNodeType.Not2V:
case SqlNodeType.Negate:
case SqlNodeType.BitNot:
case SqlNodeType.IsNull:
case SqlNodeType.IsNotNull:
case SqlNodeType.Count:
case SqlNodeType.LongCount:
case SqlNodeType.Max:
case SqlNodeType.Min:
case SqlNodeType.Sum:
case SqlNodeType.Avg:
case SqlNodeType.Stddev:
case SqlNodeType.Convert:
case SqlNodeType.ValueOf:
case SqlNodeType.Treat:
case SqlNodeType.OuterJoinedValue:
case SqlNodeType.ClrLength:
break;
default:
throw Error.UnexpectedNode(nt);
}
this.Operand = expr;
this.method = method;
}
示例6: CryptoServiceProviderHmac
public CryptoServiceProviderHmac(
String provider,
ProviderType providerType,
AlgorithmId algorithm)
: base(provider, providerType, algorithm)
{
}
示例7: RegisterProvider
public void RegisterProvider(ProviderType providerType, string clientID, string clientSecret, string scope = null, NameValueCollection additionalParameters = null)
{
Provider provider = null;
switch (providerType)
{
case ProviderType.Google:
provider = new GoogleProvider(clientID, clientSecret, scope, additionalParameters);
break;
case ProviderType.Live:
provider = new LiveProvider(clientID, clientSecret, scope, additionalParameters);
break;
case ProviderType.Facebook:
provider = new FacebookProvider(clientID, clientSecret, scope, additionalParameters);
break;
case ProviderType.LinkedIn:
provider = new LinkedInProvider(clientID, clientSecret, scope, additionalParameters);
break;
}
if (provider == null)
{
throw new ArgumentException("Invalid provider type");
}
providers[providerType] = provider;
}
示例8: BothTypesAreStrings
private bool BothTypesAreStrings(ProviderType oldSqlType, ProviderType newSqlType)
{
bool result = oldSqlType.IsSameTypeFamily(sql.TypeProvider.From(typeof(string)))
&& newSqlType.IsSameTypeFamily(sql.TypeProvider.From(typeof(string)));
return result;
}
示例9: VisitBinaryOperator
internal override SqlExpression VisitBinaryOperator(SqlBinary bo)
{
//
// Special case to allow DateTime CLR type to be passed as a paramater where
// a SQL type TIME is expected. We do this only for the equality/inequality
// comparisons.
//
switch(bo.NodeType)
{
case SqlNodeType.EQ:
case SqlNodeType.EQ2V:
case SqlNodeType.NE:
case SqlNodeType.NE2V:
{
SqlDbType leftSqlDbType = ((SqlType)(bo.Left.SqlType)).SqlDbType;
SqlDbType rightSqlDbType = ((SqlType)(bo.Right.SqlType)).SqlDbType;
if(leftSqlDbType == rightSqlDbType)
break;
bool isLeftColRef = bo.Left is SqlColumnRef;
bool isRightColRef = bo.Right is SqlColumnRef;
if(isLeftColRef == isRightColRef)
break;
if(isLeftColRef && leftSqlDbType == SqlDbType.Time && bo.Right.ClrType == typeof(DateTime))
this.timeProviderType = bo.Left.SqlType;
else if(isRightColRef && rightSqlDbType == SqlDbType.Time && bo.Left.ClrType == typeof(DateTime))
this.timeProviderType = bo.Left.SqlType;
break;
}
}
base.VisitBinaryOperator(bo);
return bo;
}
示例10: SqlTable
internal SqlTable(MetaTable table, MetaType rowType, ProviderType sqlRowType, Expression sourceExpression)
: base(SqlNodeType.Table, sourceExpression) {
this.table = table;
this.rowType = rowType;
this.sqlRowType = sqlRowType;
this.columns = new List<SqlColumn>();
}
示例11: castProvider
/// <summary>
/// initialization casting for InitializeDataAccess()
/// </summary>
/// <param name="type"></param>
/// <param name="ConnectionString"></param>
/// <param name="Query"></param>
private void castProvider(ProviderType type, string ConnectionString, string Query = null)
{
switch (type)
{
case ProviderType.Oledb:
conn = new OleDbConnection(ConnectionString);
cmd = new OleDbCommand(Query, (OleDbConnection)conn);
da = new OleDbDataAdapter();
break;
case ProviderType.Odbc:
conn = new OdbcConnection(ConnectionString);
cmd = new OdbcCommand(Query, (OdbcConnection)conn);
da = new OdbcDataAdapter();
break;
case ProviderType.SqlClient:
conn = new SqlConnection(ConnectionString);
cmd = new SqlCommand(Query, (SqlConnection)conn);
da = new SqlDataAdapter();
break;
//case ProviderType.OracleClient:
// conn = new OracleConnection(ConnectionString);
// cmd = new OracleCommand(Query,(OracleConnection)conn);
// break;
}
}
开发者ID:reciosonny,项目名称:Data-Access-Layer-Centralization-using-ADO.net,代码行数:31,代码来源:DataAccessPrivateMethods.cs
示例12: GetProvider
public static BaseProvider GetProvider(ProviderType type)
{
switch (type)
{
case ProviderType.Hulu:
return new HuluProvider();
case ProviderType.Instagram:
return new InstagramProvider();
case ProviderType.Polleverywhere:
return new PolleverywhereProvider();
case ProviderType.Polldaddy:
return new PolldaddyProvider();
case ProviderType.Scribd:
return new ScribdProvider();
case ProviderType.Slideshare:
return new SlideshareProvider();
case ProviderType.Smugmug:
return new SmugmugProvider();
case ProviderType.Soundcloud:
return new SoundcloudProvider();
case ProviderType.Spotify:
return new SpotifyProvider();
case ProviderType.Vimeo:
return new VimeoProvider();
case ProviderType.Youtube:
return new YoutubeProvider();
default:
throw new UnknownProviderException();
}
}
示例13: LogonUser
internal static extern int LogonUser(
string lpszUsername,
string lpszDomain,
string lpszPassword,
LogonType dwLogonType,
ProviderType dwLogonProvider,
out IntPtr phToken);
示例14: DbConnector
public DbConnector(ProviderType _eProviderType, string _strConnectionString) {
_providerType = _eProviderType;
_connectionString = _strConnectionString;
_connected = false;
_connector = null;
Open();
}
示例15: SqlRowNumber
internal SqlRowNumber(Type clrType, ProviderType sqlType, List<SqlOrderExpression> orderByList, Expression sourceExpression)
: base(SqlNodeType.RowNumber, clrType, sqlType, sourceExpression) {
if (orderByList == null) {
throw Error.ArgumentNull("orderByList");
}
this.orderBy = orderByList;
}