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


C# ConnectionProvider类代码示例

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


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

示例1: ExecuteSqlScript

        private static bool ExecuteSqlScript(ConnectionProvider provider, string scriptFile)
        {
            if (!File.Exists(scriptFile))
            {
                stdio.ErrorFormat("no input file found : {0}", scriptFile);
                return false;
            }

            stdio.WriteLine("Execute {0}", scriptFile);
            var script = new SqlScript(provider, scriptFile);
            script.Reported += (sender, e) =>
            {
                // stdio.WriteLine("processed: {0}>{1}", e.Value1, e.Value2);
            };

            bool hasError = false;
            script.Error += (sender, e) =>
            {
                hasError = true;
                stdio.ErrorFormat("line:{0}, {1}, SQL:{2}", e.Line, e.Exception.Message, e.Command);
            };

            Func<bool> stopOnError = () =>
            {
                return !stdio.YesOrNo("are you sure to contune (yes/no)?:");
            };

            script.Execute(stopOnError);
            stdio.WriteLine("completed to run {0}", scriptFile);

            return !hasError;
        }
开发者ID:fjiang2,项目名称:sqlcon,代码行数:32,代码来源:Side.cs

示例2: Slot

 /// <summary>
 /// Initializes a new instance of the <see cref="Slot"/> class.
 /// </summary>
 /// <param name="address">The address.</param>
 /// <param name="connection">The connection.</param>
 /// <param name="id">The id.</param>
 public Slot(uint address, ConnectionProvider connection, InventoryID id)
 {
     this.address = address;
     this.id = id;
     this.memory = connection.Memory;
     this.connection = connection;
 }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:13,代码来源:Slot.cs

示例3: RiaDbConnection

 public RiaDbConnection(ConnectionProvider provider)
 {
     this.Provider = provider;
     this.ConnectionString = Provider.ConnectionString;
     this.DataSource = Provider.DataSource;
     this.database = Provider.InitialCatalog;
 }
开发者ID:fjiang2,项目名称:sqlcon,代码行数:7,代码来源:RiaDbConnection.cs

示例4: SqlEditor

        public SqlEditor(Configuration cfg, ConnectionProvider provider, FileLink link)
        {
            InitializeComponent(cfg);

            this.cfg = cfg;
            this.provider = provider;

            textBox.Document.Blocks.Clear();
            if (link != null)
            {
                this.link = link;
                string text = link.ReadAllText();
                textBox.Document.Blocks.Add(new Paragraph(new Run(text)));
            }
            else
            {
                this.link = FileLink.CreateLink(untitled);
            }
            UpdateTitle();

            tabControl.SelectionChanged += TabControl_SelectionChanged;
            textBox.SelectionChanged += TextBox_SelectionChanged;
            textBox.TextChanged += TextBox_TextChanged;
            textBox.Focus();
        }
开发者ID:fjiang2,项目名称:sqlcon,代码行数:25,代码来源:SqlEditor.cs

示例5: Create

        public static RemoveTextPacket Create(ConnectionProvider connection, string TextName)
        {
            PipePacketBuilder p = new PipePacketBuilder(connection, PipePacketType.RemoveText);
            p.AddString(TextName);

            return new RemoveTextPacket(connection, p.GetPacket());
        }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:7,代码来源:RemoveTextPacket.cs

示例6: Create

        public static InjectDisplayPacket Create(ConnectionProvider connection, bool Injected)
        {
            PipePacketBuilder p = new PipePacketBuilder(connection, PipePacketType.InjectDisplayText);
            p.AddByte(Convert.ToByte(Injected));

            return new InjectDisplayPacket(connection, p.GetPacket());
        }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:7,代码来源:InjectDisplayPacket.cs

示例7: MessageProvider

 /// <summary>
 /// Initializes a new instance of the <see cref="MessageProvider"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 public MessageProvider(ConnectionProvider connection)
 {
     Connection = connection;
     Server = new Actions.Messages.Server(connection);
     System = new Actions.Messages.System(connection);
     Screen = new Actions.Messages.Screen(connection);
 }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:11,代码来源:MessageProvider.cs

示例8: Create

        public static RemoveCreatureTextPacket Create(ConnectionProvider connection, int CreatureID, string CreatureName)
        {
            PipePacketBuilder p = new PipePacketBuilder(connection, PipePacketType.RemoveCreatureText);
            p.AddLong(CreatureID);
            p.AddString(CreatureName);

            return new RemoveCreatureTextPacket(connection, p.GetPacket());
        }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:8,代码来源:RemoveCreatureTextPacket.cs

示例9: BindPacket

 /// <summary>
 /// Binds the packet.
 /// </summary>
 /// <param name="encryptedData">The encrypted data.</param>
 /// <param name="connection">The connection.</param>
 /// <param name="cripto">The cripto.</param>
 /// <returns></returns>
 public static Packet BindPacket(byte[] data, ConnectionProvider connection)
 {
     return new Packet {
         Data = data,
         ConnectionSource = connection,
         InterceptedDate = DateTime.Now,
     };
 }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:15,代码来源:PacketFactory.cs

示例10: SqlScript

        public SqlScript(ConnectionProvider provider, string scriptFile)
        {
            this.provider = provider;
            this.scriptFile = scriptFile;

            if (!File.Exists(scriptFile))
                throw new FileNotFoundException("cannot find file", scriptFile);
        }
开发者ID:fjiang2,项目名称:sqlcon,代码行数:8,代码来源:SqlScript.cs

示例11: XmlDbConnection

        public XmlDbConnection(ConnectionProvider provider)
        {
            this.Provider = provider;
            this.ConnectionString = Provider.ConnectionString;
            this.DataSource = Provider.DataSource;
            this.database = Provider.InitialCatalog;

            this.FileLink = FileLink.CreateLink(provider.DataSource, provider.UserId, provider.Password);
        }
开发者ID:fjiang2,项目名称:sqlcon,代码行数:9,代码来源:XmlDbConnection.cs

示例12: Create

        public static UpdateCreatureTextPacket Create(ConnectionProvider connection, int CreatureID, string CreatureName, Location TextLoc, string NewText)
        {
            PipePacketBuilder p = new PipePacketBuilder(connection, PipePacketType.UpdateCreatureText);
            p.AddLong(CreatureID);
            p.AddString(CreatureName);
            p.AddShort(TextLoc.X);
            p.AddShort(TextLoc.Y);
            p.AddString(NewText);

            return new UpdateCreatureTextPacket(connection, p.GetPacket());
        }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:11,代码来源:UpdateCreatureTextPacket.cs

示例13: IsSupported

		protected virtual bool IsSupported (ConnectionProvider provider)
		{
			if (HasFlag (InstrumentationConnectionFlags.RequireMonoClient) && !SupportsMonoExtensions (provider))
				return false;
			if (HasFlag (InstrumentationConnectionFlags.RequireEcDhe) && !SupportsEcDhe (provider))
				return false;
			if ((provider.Flags & ConnectionProviderFlags.SupportsTls12) == 0)
				return false;

			return true;
		}
开发者ID:VimalKumarS,项目名称:mono-tls,代码行数:11,代码来源:InstrumentationConnectionFilter.cs

示例14: Edit

 public ActionResult Edit(int id, ConnectionProvider connectionProvider)
 {
     try
     {
         _dbConnectionProviderRepository.Update(connectionProvider);
         return RedirectToAction("Index");
     }
     catch
     {
         return View(connectionProvider);
     }
 }
开发者ID:leloulight,项目名称:LucentDb,代码行数:12,代码来源:ConnectionProviderController.cs

示例15: Update

 public void Update(string name, string value, int id)
 {
     using (var client = new HttpClient(_messageHandler))
     {
         client.BaseAddress = new Uri(_baseAddress);
         client.DefaultRequestHeaders.Accept.Clear();
         client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
         var connectionProvider = new ConnectionProvider(id, name, value);
         var response = client.PutAsync(UrlBase, connectionProvider, new JsonMediaTypeFormatter()).Result;
         response.EnsureSuccessStatusCode();
     }
 }
开发者ID:leloulight,项目名称:LucentDb,代码行数:12,代码来源:WebApiConnectionProviderRepository.cs


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