当前位置: 首页>>代码示例>>C#>>正文


C# IProvider类代码示例

本文整理汇总了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;
        }
开发者ID:ElementalCrisis,项目名称:jmmserver,代码行数:25,代码来源:BaseObject.cs

示例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;
        }
开发者ID:jbrwn,项目名称:tc,代码行数:25,代码来源:Layer.cs

示例3: UnitOfWork

 public UnitOfWork(IProvider dataProvider)
 {
     provider = dataProvider as Provider;
     if (provider == null)
         throw new Exception("Invalid Data Provider");
     transaction = provider.Session.BeginTransaction();
 }
开发者ID:SpectralAngel,项目名称:Antem,代码行数:7,代码来源:UnitOfWork.cs

示例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();
 }
开发者ID:smther,项目名称:FreeOQ,代码行数:7,代码来源:ProviderNode.cs

示例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);
            }
        }
开发者ID:kelsieflynn,项目名称:banshee,代码行数:32,代码来源:Provider.cs

示例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);
		}
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:27,代码来源:CompiledSubQuery.cs

示例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;
    }
开发者ID:tamilstreetboy,项目名称:socialauth-net,代码行数:30,代码来源:SocialAuthLogin.ascx.cs

示例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;
        }
开发者ID:amalapannuru,项目名称:RFC,代码行数:29,代码来源:AdminRegistry.cs

示例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);
		}
开发者ID:smther,项目名称:FreeOQ,代码行数:29,代码来源:ProviderHelper.cs

示例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;
 }
开发者ID:modulexcite,项目名称:LinqToSQL2,代码行数:7,代码来源:ConnectionManager.cs

示例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;
 }
开发者ID:smther,项目名称:FreeOQ,代码行数:8,代码来源:EventMonitorWindow.cs

示例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;
 }
开发者ID:HackatonArGP,项目名称:Guardianes,代码行数:8,代码来源:ShapefileSample.cs

示例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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:8,代码来源:InMemoryPushPushPipe.cs

示例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));
 }
开发者ID:nachojammers,项目名称:MigSharp,代码行数:8,代码来源:AlterColumnDefinitionCommand.cs

示例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;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:SqlConnectionManager.cs


注:本文中的IProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。