• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Provider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Provider的典型用法代码示例。如果您正苦于以下问题:C# Provider类的具体用法?C# Provider怎么用?C# Provider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Provider类属于命名空间,在下文中一共展示了Provider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ViewModel

 public ViewModel()
 {
     Provider = new Provider();
     Messages = new ObservableCollection<Core.Message>();
     ActivateCommands();
     SendRequests();
 }
开发者ID:bizmonger,项目名称:Pickup,代码行数:7,代码来源:ViewModel.cs


示例2: AddProviderWithDefaultUser

    public void AddProviderWithDefaultUser(Provider provider, User user)
    {
        using (TransactionScope scope = new TransactionScope())
        {
            using (var dataContext = new HealthReunionEntities())
            {

                if (CheckIfUserNameExists(user.UserName))
                    throw new Exception("User name already exist");

                if(CheckIfProviderNameExists(provider.ProviderName))
                    throw new Exception("Provider name already exist");

                // Add provider enity
                dataContext.Providers.Add(provider);

                // Save changes so that it will insert records into database.
                dataContext.SaveChanges();

                user.ProviderId = provider.ProviderId;

                user.Password = EncryptDecrypt.EncryptData(user.Password, EncryptDecrypt.ReadCert());

                // Add user entity
                dataContext.Users.Add(user);

                dataContext.SaveChanges();

                // Complete the transaction if everything goes well.
                scope.Complete();
            }
        }
    }
开发者ID:nagyist,项目名称:ranjance26-HealthReunionProviderPortal,代码行数:33,代码来源:ProviderRepository.cs


示例3: RunParameters

 public RunParameters(XmlElement e, Provider<IAgent, string> agentProvider)
 {
     exePath = e.SelectSingleNode("./cmd").InnerText;
     workingDirectory = e.SelectSingleNode("./dir").InnerText;
     parameters = e.SelectSingleNode("./args").InnerText;
     agent = agentProvider(e.SelectSingleNode("./agent").InnerText);
 }
开发者ID:chrisforbes,项目名称:profiler,代码行数:7,代码来源:RunParameters.cs


示例4: Config

 public Config()
 {
     CollectionPaths = null;
     DefinitionsCollection = new Definition[3];
     ProvidersCollection = new Provider[2];
     TrailerPath = "";
 }
开发者ID:flexage,项目名称:Trail-Blazer-Reloaded,代码行数:7,代码来源:Config.cs


示例5: Delegate_Leak_RemoveOnlyDelegate

        public void Delegate_Leak_RemoveOnlyDelegate()
        {
            freeAll();

            var memBegin = Process.GetCurrentProcess().PrivateMemorySize64;
            Debug.WriteLine("Begin: " + (memBegin / 1000000));

            var provider = new Provider();
            var consumer = new Consumer(provider.Notify);

            freeAll();

            var afterCreation = Process.GetCurrentProcess().PrivateMemorySize64 - memBegin;
            Debug.WriteLine("After creation (should be around 200MB): " + (afterCreation / 1000000));

            provider = null;
            freeAll();

            var afterDispose = Process.GetCurrentProcess().PrivateMemorySize64 - memBegin;
            Debug.WriteLine("After dispose (should be around 200MB): " + (afterDispose / 1000000));

            consumer.RemoveDelegate();
            freeAll();

            var afterDispose2 = Process.GetCurrentProcess().PrivateMemorySize64 - memBegin;
            Debug.WriteLine("After consumer dispose (should be around 100MB): " + (afterDispose2 / 1000000));
        }
开发者ID:ttu,项目名称:scratchpad,代码行数:27,代码来源:MemoryLeakTests.cs


示例6: Insert

 ///<summary>Inserts one Provider into the database.  Returns the new priKey.</summary>
 internal static long Insert(Provider provider)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         provider.ProvNum=DbHelper.GetNextOracleKey("provider","ProvNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(provider,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     provider.ProvNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(provider,false);
     }
 }
开发者ID:nampn,项目名称:ODental,代码行数:26,代码来源:ProviderCrud.cs


示例7: AddResourceProvider

        private bool AddResourceProvider(Provider provider, Dictionary<string, List<string>> locationMap)
        {
            if (locationMap == null || provider == null)
            {
                return false;
            }

            var providersLocations = provider.ResourceTypes
                .CoalesceEnumerable()
                .SelectMany(type => type.Locations)
                .Distinct(StringComparer.InvariantCultureIgnoreCase);

            providersLocations.ForEach(location =>
            {
                if (!locationMap.ContainsKey(location))
                {
                    locationMap[location] = new List<string>();
                }
                if (!locationMap[location].Contains(provider.NamespaceProperty))
                {
                    locationMap[location].Add(provider.NamespaceProperty);
                }
            });

            return true;
        }
开发者ID:devigned,项目名称:azure-powershell,代码行数:26,代码来源:GetAzureLocationCmdlet.cs


示例8: ConvertProviders

        private void ConvertProviders(Provider provider, Managed.Database.Provider newProvider)
        {
            newProvider.Name = provider.Name;
            newProvider.Description = provider.Description;
            newProvider.Web = provider.Web;
            newProvider.Pinned = provider.Pinned;

            foreach (var media in provider.Medias) {
                var stream = new Stream { Name = media.Name, Description = media.Description, Web = media.Web, ChatEmbed = media.ChatEmbed, StreamGuid = media.StreamGuid, StreamEmbed = media.StreamEmbed, Tags = media.Tags, Size = media.Size };
                foreach (var newEmbedData in media.ChatEmbedData.Select(embedData => new StreamDeskProperty { Name = embedData.Name, Value = embedData.Value }))
                {
                    stream.ChatEmbedData.Add(newEmbedData);
                }
                foreach (var newEmbedData in media.StreamEmbedData.Select(embedData => new StreamDeskProperty { Name = embedData.Name, Value = embedData.Value }))
                {
                    stream.StreamEmbedData.Add(newEmbedData);
                }
                newProvider.Streams.Add(stream);
            }

            foreach (var subProvider in provider.SubProviders)
            {
                var newSubProvider = new Managed.Database.Provider();
                ConvertProviders(subProvider, newSubProvider);
                newProvider.SubProviders.Add(newSubProvider);
            }
        }
开发者ID:StreamDesk,项目名称:StreamDesk-old,代码行数:27,代码来源:XML.cs


示例9: FindCitiesWithRadius

        public void FindCitiesWithRadius()
        {
            var providerCoventry = new Provider() { Name = "Coventry", Location = new Location() { Lat = 52.406822, Long = -1.519692999999961 }, Radius = 30 };
            var rugby = new Location()
                                 {
                                     Lat = 52.370878,
                                     Long = -1.2650320000000193
            };

            var warwik = new Location()
            {
                Lat = 52.28231599999999,
                Long = -1.5849269999999933
            };
            var leicester = new Location(){Lat = 52.6368778,Long = -1.1397591999999577};

            var london = new Location() { Lat = 51.5073509, Long = -0.12775829999998223 };

            var calculator = new Calculator();

            // Rugby and Warwik is closer than 30 km to Coventry
            var rugby_yes = calculator.IsWithin(rugby, providerCoventry.Location, providerCoventry.Radius);
            var warwik_yes = calculator.IsWithin(warwik, providerCoventry.Location, providerCoventry.Radius);

            // Leicester is further away than 30 km
            var leicester_no = calculator.IsWithin(leicester, providerCoventry.Location, providerCoventry.Radius);

            Assert.IsTrue(rugby_yes);
            Assert.IsTrue(warwik_yes);
            Assert.IsFalse(leicester_no);


        }
开发者ID:froberg,项目名称:FindProviders,代码行数:33,代码来源:UnitTest1.cs


示例10: EditNodeForm

 /// <summary>
 /// Initializes a new instance of the <see cref="EditNodeForm"/> class. 
 /// </summary>
 /// <param name="provider">
 /// The provider. 
 /// </param>
 /// <param name="oldVertexId">
 /// The old vertex id. 
 /// </param>
 public EditNodeForm(Provider.Provider provider, string oldVertexId)
 {
     this.InitializeComponent();
     this.provider = provider;
     this.oldVertexId = oldVertexId;
     this.FillForm();
 }
开发者ID:janas,项目名称:individual,代码行数:16,代码来源:EditNodeForm.cs


示例11: Instance

        /// <summary>
        /// 根据提供者信息,创建实现类
        /// </summary>
        /// <param name="dataProvider"></param>
        /// <returns></returns>
        public static Object Instance(Provider dataProvider)
        {
            if (dataProvider == null)
            {
                throw new Exception("Provider不存在,请确认配置文件中的节点Provider中的信息");
            }
            Type type = Type.GetType(dataProvider.Type);
            object newObject = null;
            if (type != null)
            {
                string connectionString = null;
                string databaseOwner = null;
                GetDataStoreParameters(dataProvider, out connectionString, out databaseOwner);
                newObject = Activator.CreateInstance(type, connectionString, databaseOwner);
                if (newObject == null)
                {
                    throw new Exception("建立实例出错");
                }
            }
            else
            {
                throw new Exception("加载类型出错");
            }

            return newObject;
        }
开发者ID:shaohaiou,项目名称:comopp,代码行数:31,代码来源:DataProvider.cs


示例12: btnSave_Click

        protected void btnSave_Click(object sender, EventArgs e)
        {
            try {
            //1st save off the region
            _selectedRegion.Title = txtTitle.Text.Trim();
            _selectedRegion.ProviderId = int.Parse(ddlProvider.SelectedValue);
            _selectedRegion.TemplateRegionId = int.Parse(ddlTemplateRegion.SelectedValue);
            int sortOrder = 1;
            int.TryParse(txtSortOrder.Text, out sortOrder);
            _selectedRegion.SortOrder = sortOrder;
            _selectedRegion.ShowTitle = chkShowTitle.Checked;
            _selectedRegion.Save(WebUtility.GetUserName());

            //2nd join it up with the page
            int rowsAffected = new RegionController().JoinToPage(_selectedRegion.RegionId, pageId);

            Provider provider = new Provider(int.Parse(ddlProvider.SelectedValue));
            Response.Redirect(string.Format("~/admin/provider.aspx?pageId={0}&regionId={1}&providerId={2}", pageId, _selectedRegion.RegionId, provider.ProviderId), true);
              }
              catch (System.Threading.ThreadAbortException) {
              throw;
              }
              catch(Exception ex) {
            Logger.Error(typeof(region).Name, ex);
            Master.MessageCenter.DisplayCriticalMessage(ex.Message);
              }
        }
开发者ID:freecin,项目名称:dashcommerce-3,代码行数:27,代码来源:region.aspx.cs


示例13: GetSettings

        public GlobalSettings GetSettings(Provider? provider)
        {
            var key = string.Format("GlobalSettingsFor{0}", provider);

            var global = (GlobalSettings) MemoryCache.Default.Get(key);

            if (global != null)
                return global;

            using (var session = nhibernateSessionFactory.OpenSession())
            {
                var settings = session.Query<Setting>().Where(x => x.Provider == provider || x.Provider == null).ToList();
                ProviderSettings providerSettings = null;

                if (provider.HasValue)
                {
                    providerSettings = session.Query<ProviderSettings>().FirstOrDefault(p => p.Provider == provider);
                }

                global = new GlobalSettings(settings, providerSettings);
            }

            MemoryCache.Default.Set(key, global, DateTimeOffset.Now.AddMinutes(5));

            return global;
        }
开发者ID:c0d3m0nky,项目名称:mty,代码行数:26,代码来源:GlobalSettingsService.cs


示例14: Symmetric

        /// <summary>
        ///     Instantiates a new symmetric encryption object using the specified provider.
        /// </summary>
        //public Symmetric(Provider provider)
        //{
        //    this.Symmetric(provider,true);
        //}
        public Symmetric(Provider provider, bool useDefaultInitializationVector)
        {
            switch (provider)
            {
                case Provider.DES:
                    _crypto = new DESCryptoServiceProvider();
                    break;
                case Provider.RC2:
                    _crypto = new RC2CryptoServiceProvider();
                    break;
                case Provider.Rijndael:
                    _crypto = new RijndaelManaged();
                    break;
                case Provider.TripleDES:
                    _crypto = new TripleDESCryptoServiceProvider();
                    break;
            }

            //-- make sure key and IV are always set, no matter what
            Key = RandomKey();
            if (useDefaultInitializationVector)
            {
                IntializationVector = new Data(_DefaultIntializationVector);
            }
            else
            {
                IntializationVector = RandomInitializationVector();
            }
        }
开发者ID:hiriumi,项目名称:EasyReporting,代码行数:36,代码来源:Symmetric.cs


示例15: GetProviderHost

 private static string GetProviderHost(Provider provider)
 {
     switch (provider)
     {
         default:
             return "cache-aws-us-east-1";
     }
 }
开发者ID:acropolium,项目名称:Rest4Net,代码行数:8,代码来源:IronCacheProvider.cs


示例16: BatchProcess

 /// <summary>
 /// Initializes a new instance of the <see cref="BatchProcess"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 public BatchProcess(Provider.Provider provider)
 {
     this.InitializeComponent();
     this.PrepareDialog();
     this.InitializeEditBox();
     this.provider = provider;
     this.IsAdd = false;
 }
开发者ID:rosaskc,项目名称:gptrees,代码行数:14,代码来源:BatchProcess.cs


示例17: BaseApplication

		/// <summary>
		/// Constianer to hold extra handler objects.
		/// </summary>
		//protected Handler[] handlers;
		
		/// <summary>
		/// Scene Holder container.
		/// </summary>
		//protected SceneHolder sceneHolder;
		
		public BaseApplication ()
		{
			_provider = new Kinetic.Provide.OpenTKProvider();
			_resourceManager = _provider.CreateResourceManager();
			_displays = null;
			_renderers = null;
			//handlers = null;
			//sceneHolder = null;
		}
开发者ID:jwmarsden,项目名称:Kinetic3,代码行数:19,代码来源:BaseApplication.cs


示例18: AddTree

 /// <summary>
 /// Initializes a new instance of the <see cref="AddTree"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider. 
 /// </param>
 /// <param name="fromFile">
 /// The from file. 
 /// </param>
 public AddTree(Provider.Provider provider, bool fromFile)
 {
     this.InitializeComponent();
     this.InitializeAdd();
     this.provider = provider;
     this.fromFile = fromFile;
     this.FillTrees();
     this.SetTitleLabel();
 }
开发者ID:rosaskc,项目名称:gptrees,代码行数:18,代码来源:AddTree.cs


示例19: processEventFrame

        public void processEventFrame(Provider.FrameEventArgs e)
        {
            touchscreenMutex.WaitOne();
            List<PointerTouchInfo> toFire = new List<PointerTouchInfo>();

            foreach (WiiContact contact in e.Contacts)
            {
                if (Settings.Default.pointer_customCursor && (contact.Type == ContactType.Hover || contact.Type == ContactType.EndFromHover))
                {
                    //If we are using the custom cursor and it's more than 1 touchpoints, we skip the hovering because otherwise it's not working with edge guestures for example.
                }
                else
                {
                    ContactType type = contact.Type;

                    if (Settings.Default.pointer_customCursor && (contact.Type == ContactType.EndToHover))
                    {
                        type = ContactType.End;
                    }

                    PointerTouchInfo touch = new PointerTouchInfo();
                    touch.PointerInfo.pointerType = PointerInputType.TOUCH;
                    touch.TouchFlags = TouchFlags.NONE;
                    //contact.Orientation = (uint)cur.getAngleDegrees();//this is only valid for TuioObjects
                    touch.Pressure = 0;
                    touch.TouchMasks = TouchMask.NONE;
                    touch.PointerInfo.PtPixelLocation.X = (int)contact.Position.X;
                    touch.PointerInfo.PtPixelLocation.Y = (int)contact.Position.Y;
                    touch.PointerInfo.PointerId = (uint)contact.ID;
                    touch.PointerInfo.PerformanceCount = e.Timestamp;

                    if (type == ContactType.Start)
                        touch.PointerInfo.PointerFlags = PointerFlags.DOWN | PointerFlags.INRANGE | PointerFlags.INCONTACT;
                    else if (type == ContactType.Move)
                        touch.PointerInfo.PointerFlags = PointerFlags.UPDATE | PointerFlags.INRANGE | PointerFlags.INCONTACT;
                    else if (type == ContactType.End)
                        touch.PointerInfo.PointerFlags = PointerFlags.UP;
                    else if (type == ContactType.EndToHover)
                        touch.PointerInfo.PointerFlags = PointerFlags.UP | PointerFlags.INRANGE;
                    else if (type == ContactType.Hover)
                        touch.PointerInfo.PointerFlags = PointerFlags.UPDATE | PointerFlags.INRANGE;
                    else if (type == ContactType.EndFromHover)
                        touch.PointerInfo.PointerFlags = PointerFlags.UPDATE;

                    toFire.Add(touch);
                }
            }
            //fire the events
            if (toFire.Count > 0)
            {
                if (!TCD.System.TouchInjection.TouchInjector.InjectTouchInput(toFire.Count, toFire.ToArray()))
                {
                    Console.WriteLine("Could not send touch input, count " + toFire.Count);
                }
            }
            touchscreenMutex.ReleaseMutex();
        }
开发者ID:joshreve,项目名称:Touchmote,代码行数:57,代码来源:TouchInjectProviderHandler.cs


示例20:

		IDictionary<string, string> IExtensionResponse.Serialize(Provider.IRequest authenticationRequest) {
			var fields = new Dictionary<string, string> {
				{ "mode", Succeeded ? SuccessMode : FailureMode },
			};
			if (!Succeeded && !string.IsNullOrEmpty(FailureReason))
				fields.Add("error", FailureReason);

			return fields;
		}
开发者ID:Belxjander,项目名称:Asuna,代码行数:9,代码来源:StoreResponse.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ProviderType类代码示例发布时间:2022-05-24
下一篇:
C# Protocols类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap