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


C# IConnectionInfo类代码示例

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


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

示例1: GetSchema

        public override List<ExplorerItem> GetSchema(IConnectionInfo connectionInfo, Type customType)
        {
            var indexDirectory = connectionInfo.DriverData.FromXElement<LuceneDriverData>().IndexDirectory;

            //TODO: Fields with configured delimiters should show up as a tree
            //TODO: Show Numeric and String fields with their types
            //TODO: If the directory selected contains sub-directories, maybe we should show them all...

            using (var directory = FSDirectory.Open(new DirectoryInfo(indexDirectory)))
            using (var indexReader = IndexReader.Open(directory, true))
            {
                return indexReader
                    .GetFieldNames(IndexReader.FieldOption.ALL)
                    .Select(fieldName =>
                    {
                        //var field = //TODO: Get the first document with this field and get its types.
                        return new ExplorerItem(fieldName, ExplorerItemKind.QueryableObject, ExplorerIcon.Column)
                        {
                            IsEnumerable = false,       //TODO: Should be true when its a multi-field
                            ToolTipText = "Cool tip"
                        };
                    })
                    .ToList();
            }
        }
开发者ID:ChristopherHaws,项目名称:LinqPad-Lucene-Driver,代码行数:25,代码来源:LuceneIndexDriver.cs

示例2: ConnectionManager

 public ConnectionManager(IPreferences preferences, IPowerManager powerManager, IConnectionInfo connectionInfo, IBlackoutTime blackoutTime)
 {
     Preferences = preferences;
     PowerManager = powerManager;
     ConnectionInfo = connectionInfo;
     BlackoutTime = blackoutTime;
 }
开发者ID:B2MSolutions,项目名称:reyna-net45,代码行数:7,代码来源:ConnectionManager.cs

示例3: PostgreSqlTablesProvider

 public PostgreSqlTablesProvider(IConnectionInfo cxInfo, ModuleBuilder moduleBuilder, IDbConnection connection, string nameSpace)
 {
    this.cxInfo = cxInfo;
    this.moduleBuilder = moduleBuilder;
    this.connection = connection;
    this.nameSpace = nameSpace;
 }
开发者ID:henrik-m,项目名称:linqpad-postgresql-driver,代码行数:7,代码来源:PostgreSqlTablesProvider.cs

示例4: MainWindow

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="cxInfo">IConnectionInfo</param>
 /// <param name="isNewConnection">Indicate if this is new connection request or update existing connection</param>
 public MainWindow(IConnectionInfo cxInfo, bool isNewConnection)
 {
     InitializeComponent();
     // Instantiate ViewModel and pass parameters.
     vm = new MainWindowViewModel(cxInfo, isNewConnection);
     myGrid.DataContext = vm;
 }
开发者ID:JamesPosada,项目名称:EmailBlaster,代码行数:12,代码来源:MainWindow.xaml.cs

示例5: GetNamespacesToAdd

 public override IEnumerable<string> GetNamespacesToAdd(IConnectionInfo cxInfo)
 {
    yield return "System.Net"; // for IPAddress type
    yield return "System.Net.NetworkInformation"; // for PhysicalAddress type
    yield return "LinqToDB";
    yield return "NpgsqlTypes";
 }
开发者ID:henrik-m,项目名称:linqpad-postgresql-driver,代码行数:7,代码来源:DynamicPostgreSqlDriver.cs

示例6: FailoverRoundRobin

        public FailoverRoundRobin(IConnectionInfo connectionDetails)
        {
            if (!(connectionDetails.BrokerCount > 0))
            {
                throw new ArgumentException("At least one broker details must be specified.");
            }

            _connectionDetails = connectionDetails;

            //There is no current broker at startup so set it to -1.
            _currentBrokerIndex = -1;

            String cycleRetries = _connectionDetails.GetFailoverOption(ConnectionUrlConstants.OPTIONS_FAILOVER_CYCLE);

            if (cycleRetries != null)
            {
                try
                {
                    _cycleRetries = int.Parse(cycleRetries);
                }
                catch (FormatException)
                {
                    _cycleRetries = DEFAULT_CYCLE_RETRIES;
                }
            }

            _currentCycleRetries = 0;

            _serverRetries = 0;
            _currentServerRetry = -1;
        }
开发者ID:drzo,项目名称:opensim4opencog,代码行数:31,代码来源:FailoverRoundRobin.cs

示例7: ShowConnectionDialog

 public override bool ShowConnectionDialog(IConnectionInfo repository, bool isNewRepository)
 {
     using (CxForm form = new CxForm((Repository) repository, isNewRepository))
     {
         return (form.ShowDialog() == DialogResult.OK);
     }
 }
开发者ID:CuneytKukrer,项目名称:TestProject,代码行数:7,代码来源:AstoriaDynamicDriver.cs

示例8: GetConnectionDescription

    public override string GetConnectionDescription(IConnectionInfo cxInfo) {
      // Save the cxInfo to use elsewhere.  Note this method is called a lot, but it seems to be the first time we'll see the cxInfo.
      _cxInfo = cxInfo;

      // We show the namespace qualified typename.
      return cxInfo.CustomTypeInfo.CustomTypeName;
    }
开发者ID:IdeaBlade,项目名称:DevForce.Utilities,代码行数:7,代码来源:DevForceLINQPadDriver.cs

示例9: GetContextConstructorArguments

		public override object[] GetContextConstructorArguments(IConnectionInfo cxInfo)
		{
			var connInfo = CassandraConnectionInfo.Load(cxInfo);
			CacheDefinitionIfNessisary(connInfo);

			return new[] { connInfo.CreateContext() };
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:7,代码来源:CassandraDriver.cs

示例10: GetContextConstructorParameters

		public override ParameterDescriptor[] GetContextConstructorParameters(IConnectionInfo cxInfo)
		{
			var connInfo = CassandraConnectionInfo.Load(cxInfo);
			CacheDefinitionIfNessisary(connInfo);

			return new[] { new ParameterDescriptor("context", "FluentCassandra.CassandraContext") };
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:7,代码来源:CassandraDriver.cs

示例11: GetConnectionDescription

		/// <summary>Returns the text to display in the root Schema Explorer node for a given connection info.</summary>
		public override string GetConnectionDescription(IConnectionInfo cxInfo)
		{
			var connInfo = CassandraConnectionInfo.Load(cxInfo);
			CacheDefinitionIfNessisary(connInfo);

			return String.Format("{0}/{1} - {2}", connInfo.Host, connInfo.Port, connInfo.Keyspace);
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:8,代码来源:CassandraDriver.cs

示例12: GetContextConstructorArguments

    /// <summary>
    /// We're using the parameterless EM constructor, so no constructor arguments are provided.
    /// </summary>
    public override object[] GetContextConstructorArguments(IConnectionInfo cxInfo) {

      // We need to fix MEF probing in some circumstances, so let's check and do it before creating the EM.  
      DevForceTypes.CheckComposition(cxInfo);

      return null;
    }
开发者ID:IdeaBlade,项目名称:DevForce.Utilities,代码行数:10,代码来源:DevForceLINQPadDriver.cs

示例13: InitializeContext

        public override void InitializeContext(IConnectionInfo cxInfo, object context, QueryExecutionManager executionManager)
        {
            // This method gets called after a DataServiceContext has been instantiated. It gives us a chance to
            // perform further initialization work.
            //
            // And as it happens, we have an interesting problem to solve! The typed data service context class
            // that Astoria's EntityClassGenerator generates handles the ResolveType delegate as follows:
            //
            //   return this.GetType().Assembly.GetType (string.Concat ("<namespace>", typeName.Substring (19)), true);
            //
            // Because LINQPad subclasses the typed data context when generating a query, GetType().Assembly returns
            // the assembly of the user query rather than the typed data context! To work around this, we must take
            // over the ResolveType delegate and resolve using the context's base type instead:

            var dsContext = (DataServiceContext)context;
            var typedDataServiceContextType = context.GetType ().BaseType;

            dsContext.ResolveType = name => typedDataServiceContextType.Assembly.GetType
                (typedDataServiceContextType.Namespace + "." + name.Split ('.').Last ());

            // The next step is to feed any supplied credentials into the Astoria service.
            // (This could be enhanced to support other authentication modes, too).
            var props = new AstoriaProperties (cxInfo);
            dsContext.Credentials = props.GetCredentials ();

            // Finally, we handle the SendingRequest event so that it writes the request text to the SQL translation window:
            dsContext.SendingRequest += (sender, e) => executionManager.SqlTranslationWriter.WriteLine (e.Request.RequestUri);
        }
开发者ID:votrongdao,项目名称:NWheels,代码行数:28,代码来源:AstoriaDynamicDriver.cs

示例14: ConnectionDialog

 public ConnectionDialog(IConnectionInfo connectionInfo)
 {
     this.connectionInfo = connectionInfo;
     this.driverData = new LuceneDriverData();
     DataContext = this.driverData;
     InitializeComponent();
 }
开发者ID:ChristopherHaws,项目名称:LinqPad-Lucene-Driver,代码行数:7,代码来源:ConnectionDialog.xaml.cs

示例15: AreRepositoriesEquivalent

        /// <summary>
        /// Determines whether two repositories are equivalent.
        /// </summary>
        /// <param name="connection1">The connection information of the first repository.</param>
        /// <param name="connection2">The connection information of the second repository.</param>
        /// <returns><c>true</c> if both repositories use the same account name; <c>false</c> otherwise.</returns>
        public override bool AreRepositoriesEquivalent(IConnectionInfo connection1, IConnectionInfo connection2)
        {
            var account1 = (string)connection1.DriverData.Element("AccountName") ?? string.Empty;
            var account2 = (string)connection2.DriverData.Element("AccountName") ?? string.Empty;

            return account1.Equals(account2);
        }
开发者ID:ryan1234,项目名称:AzureStorageDriver,代码行数:13,代码来源:AzureDriver.cs


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