本文整理汇总了C#中IProvider类的典型用法代码示例。如果您正苦于以下问题:C# IProvider类的具体用法?C# IProvider怎么用?C# IProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProvider类属于命名空间,在下文中一共展示了IProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetStream
public MediaContainer GetStream(IProvider prov)
{
if (MediaContainer.Childrens.Count > 0 && MediaContainer.Childrens[0].Type == "movie")
{
MediaContainer.ViewGroup = null;
MediaContainer.ViewMode = null;
}
bool removeandroid = false;
if (WebOperationContext.Current != null &&
WebOperationContext.Current.IncomingRequest.Headers.AllKeys.Contains("X-Plex-Product"))
{
//Fix for android hang, if the type is populated
string kh = WebOperationContext.Current.IncomingRequest.Headers.Get("X-Plex-Product").ToUpper();
if (kh.Contains("ANDROID"))
removeandroid = true;
}
MediaContainer.Childrens.ForEach(a =>
{
a.Group = null;
if (removeandroid)
a.Type = null;
});
return MediaContainer;
}
示例2: Layer
public Layer(string name, string title, IGridSet gridset,IProvider provider, ICache cache = null, ITileFilter cacheFilter = null)
{
// Set name
if (string.IsNullOrEmpty(name))
throw new ArgumentNullException("Layer Name cannot be null");
this._name = name;
// Set title
this._title = title;
// Set GridSet
if (gridset == null)
throw new ArgumentNullException("Layer GridSet cannot be null");
this._gridSet = gridset;
// Set Cache
this._cache = cache;
// Set Provider
if (provider == null)
throw new ArgumentNullException("Layer Provider cannot be null");
this._provider = provider;
this._cacheFitler = cacheFilter;
}
示例3: UnitOfWork
public UnitOfWork(IProvider dataProvider)
{
provider = dataProvider as Provider;
if (provider == null)
throw new Exception("Invalid Data Provider");
transaction = provider.Session.BeginTransaction();
}
示例4: ProviderNode
public ProviderNode(IProvider provider)
{
this.provider = provider;
this.Text = provider.Name;
this.ToolTipText = string.Format("{0}{1}{2}", provider.Title, Environment.NewLine, provider.URL);
this.UpdateStatus();
}
示例5: Provider
static Provider()
{
lock (typeof (Provider)) {
if (provider != null) {
return;
}
var extensions = GetOrderedExtensions (
"/Banshee/Platform/IOProvider",
ProviderConfiguration.ProviderSchema.Get (),
"Banshee.IO.Gio.Provider", "Banshee.IO.Unix.Provider", "Banshee.IO.SystemIO.Provider"
);
foreach (var node in extensions) {
try {
provider = (IProvider)node.CreateInstance (typeof (IProvider));
break;
} catch (Exception e) {
Log.Warning ("IO provider extension failed to load", e.Message);
}
}
if (provider == null) {
provider = new Banshee.IO.SystemIO.Provider ();
}
Log.DebugFormat ("IO provider extension loaded ({0})", provider.GetType ().FullName);
directory = (IDirectory)Activator.CreateInstance (provider.DirectoryProvider);
file = (IFile)Activator.CreateInstance (provider.FileProvider);
}
}
示例6: Execute
public IExecuteResult Execute(IProvider provider, object[] parentArgs, object[] userArgs)
{
if(parentArgs == null && !(this.parameters == null || this.parameters.Count == 0))
{
throw Error.ArgumentNull("arguments");
}
// construct new copy of query info
List<SqlParameterInfo> spis = new List<SqlParameterInfo>(this.queryInfo.Parameters);
// add call arguments
for(int i = 0, n = this.parameters.Count; i < n; i++)
{
spis.Add(new SqlParameterInfo(this.parameters[i], parentArgs[i]));
}
QueryInfo qi = new QueryInfo(
this.queryInfo.Query,
this.queryInfo.CommandText,
spis.AsReadOnly(),
this.queryInfo.ResultShape,
this.queryInfo.ResultType
);
// execute query
return provider.Execute(null, qi, this.factory, parentArgs, userArgs, subQueries, null);
}
示例7: constructControl
private HtmlGenericControl constructControl(IProvider provider)
{
string iconPath = Utility.GetSocialAuthConfiguration().IconFolder.Path ;
if (string.IsNullOrEmpty(iconPath))
iconPath = "images/socialauthicons/";
iconPath += provider.ProviderType.ToString() + ".png";
bool isconnected = SocialAuthUser.IsConnectedWith(provider.ProviderType);
bool iscurrent = (SocialAuthUser.CurrentProvider == provider.ProviderType);
HtmlGenericControl providerDiv = new HtmlGenericControl("div");
providerDiv.Attributes.Add("class", "provider");
ImageButton imgB = new ImageButton()
{
ID = "img" + provider.ProviderType,
CommandArgument = provider.ProviderType.ToString(),
ImageUrl = iconPath
};
if (isconnected)
{
HtmlGenericControl tickspan = new HtmlGenericControl("span");
tickspan.InnerHtml = "<img src='images/socialauthicons/" + (iscurrent ? "currentyes" : "yes") + ".png' style='top:0px;left:0px;z-index:100'/>";
tickspan.Style.Add("position", "absolute");
providerDiv.Controls.Add(tickspan);
}
//if (iscurrent)
// imgB.Style.Add("border", "1px solid yellow");
imgB.Command += new CommandEventHandler(imgB_Command);
providerDiv.Controls.Add(imgB);
return providerDiv;
}
示例8: Register
public static bool Register(IProvider provider)
{
bool retval = false;
if (provider != null)
{
object o = null;
if (provider.GetItem(typeof(IUserDao), out o))
{
_userDao = o as IUserDao;
retval = true;
}
if (provider.GetItem(typeof(IQueueDao), out o))
{
_queueDao = o as IQueueDao;
retval = true;
}
if (!retval)
{
Trace.WriteLine("AdminRegistry.Register(" + provider + "): no daos found");
}
}
else
{
Trace.WriteLine("QuestionaireRegistry.Register(" + provider + "): provider was null");
}
return retval;
}
示例9: Connect
public void Connect(IProvider provider)
{
if (provider.IsConnected)
return;
if (this.useMessageLoop)
{
this.form.BeginInvoke((Action)(() => provider.Connect()));
if ((int)provider.Id == 1 || (int)provider.Id == 2)
{
ProviderManager.WaitConnected(provider, (int)this.ConnectionTimeout.TotalMilliseconds);
}
else
{
ProviderHelperForm f = new ProviderHelperForm();
f.Init(provider, (int)this.ConnectionTimeout.TotalSeconds);
MethodInvoker methodInvoker = (MethodInvoker)(() =>
{
int temp_75 = (int)f.ShowDialog((IWin32Window)this.parentForm);
f.Dispose();
});
if (this.parentForm.InvokeRequired)
this.parentForm.Invoke((Delegate)methodInvoker);
else
methodInvoker();
}
}
else
provider.Connect((int)this.ConnectionTimeout.TotalMilliseconds);
}
示例10: ConnectionManager
internal ConnectionManager(IProvider provider, DbConnection con, int maxUsers, bool disposeConnection) {
this.provider = provider;
this.connection = con;
this.maxUsers = maxUsers;
this.users = new List<IConnectionUser>(maxUsers);
this.disposeConnection = disposeConnection;
}
示例11: EventMonitorWindow
public EventMonitorWindow()
{
this.InitializeComponent();
this.counter = new TotalCounter();
this.providerCounterRows = new Dictionary<IProvider, ProviderCounterViewRow>();
this.instrumentCounterRows = new Dictionary<IFIXInstrument, InstrumentCounterViewRow>();
this.selectedProvider = (IProvider)null;
}
示例12: CreateCountryLayer
public static Layer CreateCountryLayer(IProvider countrySource)
{
var countries = new Layer("Countries");
countries.DataSource = countrySource;
countries.DataSource.SRID = 3785;
countries.Styles.Add(CreateCountryTheme());
return countries;
}
示例13: Subscribe
public override bool Subscribe(IProvider provider, Hashtable parameterMap)
#endif
{
bool success = base.Subscribe(provider, parameterMap);
if (success)
FireProviderConnectionEvent(provider, PipeConnectionEvent.PROVIDER_CONNECT_PUSH, parameterMap);
return success;
}
示例14: ToSql
public IEnumerable<string> ToSql(IProvider provider, IRuntimeContext context)
{
return provider.AlterColumn(Parent.Parent.TableName, new Column(
Parent.ColumnName,
new DataType(_type, Size, Scale),
_isNullable,
DefaultValue));
}
示例15: SqlConnectionManager
internal SqlConnectionManager(IProvider provider, DbConnection con, int maxUsers, bool disposeConnection) {
this.provider = provider;
this.connection = con;
this.maxUsers = maxUsers;
this.infoMessagehandler = new SqlInfoMessageEventHandler(this.OnInfoMessage);
this.users = new List<IConnectionUser>(maxUsers);
this.disposeConnection = disposeConnection;
}