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

C# Feature.FdoConnection类代码示例

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

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



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

示例1: FdoAggregateQueryCtl

 public FdoAggregateQueryCtl(FdoConnection conn)
     : this()
 {
     _conn = conn;
     _presenter = new FdoAggregateQueryPresenter(this, conn);
     joinCriteriaCtrl.Connection = conn;
 }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:7,代码来源:FdoAggregateQueryCtl.cs


示例2: Execute

        /// <summary>
        /// Copies all spatial contexts
        /// </summary>
        /// <param name="spatialContexts">The spatial contexts.</param>
        /// <param name="target">The target.</param>
        /// <param name="overwrite">if set to <c>true</c> [overwrite].</param>
        public override void Execute(ICollection<SpatialContextInfo> spatialContexts, FdoConnection target, bool overwrite)
        {
            //MySQL supports multiple spatial contexts and IDestorySpatialContext
            //so in this case if overwrite == true, we want to destroy any ones that
            //already exist in the target before creating new ones in its place. This does not
            //prevent creating a series of spatial contexts if overwrite == false and one of
            //the spatial contexts being copied already exists. This is an unfortunate leaky 
            //abstraction in the FDO API.

            using (FdoFeatureService service = target.CreateFeatureService())
            {
                if (overwrite)
                {
                    ReadOnlyCollection<SpatialContextInfo> targetContexts = service.GetSpatialContexts();

                    foreach (SpatialContextInfo sc in spatialContexts)
                    {
                        //Only destroy spatial context if it exists in target connection
                        if (SpatialContextExists(targetContexts, sc))
                            service.DestroySpatialContext(sc);
                    }
                }

                foreach (SpatialContextInfo sc in spatialContexts)
                {
                    service.CreateSpatialContext(sc, false);
                }
            }
        }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:35,代码来源:MySqlCopySpatialContextOverride.cs


示例3: SchemaDesignContext

        public SchemaDesignContext(FdoConnection conn)
        {
            _spatialContexts = new BindingList<SpatialContextInfo>();

            if (conn == null)
            {
                _schemas = new FeatureSchemaCollection(null);
                _mappings = new PhysicalSchemaMappingCollection();
            }
            else
            {
                using (var svc = conn.CreateFeatureService())
                {
                    _schemas = svc.DescribeSchema();
                    _mappings = svc.DescribeSchemaMapping(true);
                    if (_mappings == null)
                        _mappings = new PhysicalSchemaMappingCollection();

                    var spatialContexts = svc.GetSpatialContexts();
                    foreach (var sc in spatialContexts)
                    {
                        _spatialContexts.Add(sc);
                    }
                }
            }

            this.Connection = conn;

            EvaluateCapabilities();
        }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:30,代码来源:SchemaDesignContext.cs


示例4: CreateConnection

        /// <summary>
        /// Creates the connection.
        /// </summary>
        /// <param name="provider">The provider.</param>
        /// <param name="connStr">The connection string.</param>
        /// <param name="configPath">The configuration path</param>
        /// <param name="name">The name that will be assigned to the connection.</param>
        /// <returns></returns>
        protected override FdoConnection CreateConnection(string provider, string connStr, string configPath, ref string name)
        {
            IFdoConnectionManager connMgr = ServiceManager.Instance.GetService<IFdoConnectionManager>();
            //Try to find by name first
            FdoConnection conn = null;
            conn = connMgr.GetConnection(name);
            //Named connection matches all the details
            if (conn != null)
            {
                if (conn.Provider == provider && conn.ConnectionString == connStr)
                    return conn;
            }

            //Then to find matching open connection
            foreach (string connName in connMgr.GetConnectionNames())
            {
                FdoConnection c = connMgr.GetConnection(connName);
                if (c.Provider == provider && c.ConnectionString == connStr)
                {
                    name = connName;
                    return c;
                }
            }

            //Make a new connection
            LoggingService.Info(ResourceService.GetString("INFO_REFERENCED_CONNECTION_NOT_FOUND"));
            conn = new FdoConnection(provider, connStr);
            if (!string.IsNullOrEmpty(configPath) && System.IO.File.Exists(configPath))
                conn.SetConfiguration(configPath);
            connMgr.AddConnection(name, conn);
            return conn;
        }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:40,代码来源:TaskLoader.cs


示例5: FdoBulkUpdatePresenter

 public FdoBulkUpdatePresenter(IFdoBulkUpdateView view, FdoConnection conn, string className)
 {
     _view = view;
     _conn = conn;
     _className = className;
     _view.Title = ICSharpCode.Core.ResourceService.GetString("TITLE_BULK_UPDATE_FEATURE");
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:7,代码来源:FdoBulkUpdateCtlPresentation.cs


示例6: TestConnection

        public void TestConnection()
        {
            FdoProviderInfo provider = _view.SelectedProvider;
            string connStr = ExpressUtility.ConvertFromNameValueCollection(_view.ConnectProperties);

            FdoConnection conn = new FdoConnection(provider.Name, connStr);
            try
            {
                FdoConnectionState state = conn.Open();
                if (state == FdoConnectionState.Open || state == FdoConnectionState.Pending)
                {
                    _view.ShowMessage(null, "Test successful");
                    conn.Close();
                }
                else
                {
                    _view.ShowError("Connection test failed");
                }
            }
            catch (FdoException ex)
            {
                _view.ShowError(ex.InnerException.Message);
            }
            finally
            {
                conn.Dispose();
            }
        }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:28,代码来源:FdoConnectCtlPresentation.cs


示例7: FdoCopySpatialContextOperation

 /// <summary>
 /// Initializes a new instance of the <see cref="FdoCopySpatialContextOperation"/> class.
 /// </summary>
 /// <param name="src">The source connection.</param>
 /// <param name="dst">The target connection.</param>
 /// <param name="sourceSpatialContextNames">The source spatial context names.</param>
 /// <param name="overwrite">if set to <c>true</c> [overwrite].</param>
 public FdoCopySpatialContextOperation(FdoConnection src, FdoConnection dst, string[] sourceSpatialContextNames, bool overwrite)
 {
     _source = src;
     _target = dst;
     _scNames = sourceSpatialContextNames;
     _overwrite = overwrite;
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:14,代码来源:FdoCopySpatialContextOperation.cs


示例8: Execute

        /// <summary>
        /// Copies the spatial contexts given in the list
        /// </summary>
        /// <param name="source">The source connection</param>
        /// <param name="target">The target connection</param>
        /// <param name="overwrite">If true will overwrite any existing spatial contexts</param>
        /// <param name="spatialContextNames">The list of spatial contexts to copy</param>
        public override void Execute(FdoConnection source, FdoConnection target, bool overwrite, string[] spatialContextNames)
        {
            if (spatialContextNames.Length == 0)
                return;

            FdoFeatureService srcService = source.CreateFeatureService();
            FdoFeatureService destService = target.CreateFeatureService();
            ReadOnlyCollection<SpatialContextInfo> srcContexts = srcService.GetSpatialContexts();
            ReadOnlyCollection<SpatialContextInfo> destContexts = destService.GetSpatialContexts();
            foreach (SpatialContextInfo ctx in srcContexts)
            {
                if (SpatialContextInSpecifiedList(ctx, spatialContextNames))
                {
                    try
                    {
                        //Find target spatial context of the same name
                        SpatialContextInfo sci = destService.GetSpatialContext(ctx.Name);
                        if (sci != null && overwrite)
                        {
                            //If found, destroy then create
                            destService.DestroySpatialContext(ctx.Name);
                            destService.CreateSpatialContext(ctx, false);
                        }
                        else
                        {
                            destService.CreateSpatialContext(ctx, false);
                        }
                    }
                    catch (Exception)
                    {

                    }
                }
            }
        }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:42,代码来源:MsSqlCopySpatialContextOverride.cs


示例9: FdoAggregateQueryPresenter

 public FdoAggregateQueryPresenter(IFdoAggregateQueryView view, FdoConnection conn)
 {
     _view = view;
     _conn = conn;
     _service = _conn.CreateFeatureService();
     _view.OrderingEnabled = false;
     _walker = SchemaWalker.GetWalker(conn);
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:8,代码来源:FdoAggregateQueryCtlPresentation.cs


示例10: FdoSpatialContextBrowserDlg

 public FdoSpatialContextBrowserDlg(FdoConnection conn)
     : this()
 {
     using (FdoFeatureService service = conn.CreateFeatureService())
     {
         grdSpatialContexts.DataSource = service.GetSpatialContexts();
     }
 }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:8,代码来源:FdoSpatialContextBrowserDlg.cs


示例11: FdoJoinDialog

 public FdoJoinDialog(FdoConnection conn, string primarySchemaName, string primaryClassName, string primaryClassAlias)
 {
     InitializeComponent();
     _conn = conn;
     _primarySchemaName = primarySchemaName;
     _primaryClassName = primaryClassName;
     _primaryClassAlias = primaryClassAlias;
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:8,代码来源:FdoJoinDialog.cs


示例12: TestCopyTaskMsSql

        public void TestCopyTaskMsSql()
        {
            MockRepository mocks = new MockRepository();
            FdoConnection conn = new FdoConnection("OSGeo.SQLServerSpatial", "");

            ICopySpatialContext ctx = CopySpatialContextOverrideFactory.GetCopySpatialContextOverride(conn);
            Assert.IsTrue(ctx is MsSqlCopySpatialContextOverride);
        }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:8,代码来源:OverrideTests.cs


示例13: FdoSqlOutputOperation

 public FdoSqlOutputOperation(FdoConnection conn, string className, NameValueCollection propertyMappings)
     : base(conn, className, propertyMappings)
 {
     if (!conn.Capability.GetBooleanCapability(CapabilityType.FdoCapabilityType_SupportsSQL))
     {
         throw new ArgumentException("Only providers that support SQL can be used");
     }
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:8,代码来源:FdoSqlOutputOperation.cs


示例14: ConnectArcSdePresenter

 public ConnectArcSdePresenter(IConnectArcSdeView view, IFdoConnectionManager connMgr)
 {
     _view = view;
     _connMgr = connMgr;
     _conn = new FdoConnection("OSGeo.ArcSDE");
     _view.DataStoreEnabled = false;
     _view.SubmitEnabled = false; 
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:8,代码来源:ConnectArcSdePresentation.cs


示例15: DumpFeatureClassCtl

 public DumpFeatureClassCtl(FdoConnection source, string schemaName, string className)
 {
     InitializeComponent();
     this.Title = "Dump Feature Class";
     _source = source;
     _schemaName = schemaName;
     _className = className;
 }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:8,代码来源:DumpFeatureClassCtl.cs


示例16: FdoStandardQueryPresenter

 public FdoStandardQueryPresenter(IFdoStandardQueryView view, FdoConnection conn)
 {
     _view = view;
     _conn = conn;
     _service = _conn.CreateFeatureService();
     _view.OrderingEnabled = conn.Capability.GetBooleanCapability(CapabilityType.FdoCapabilityType_SupportsSelectOrdering);
     _walker = SchemaWalker.GetWalker(conn);
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:8,代码来源:FdoStandardQueryPresentation.cs


示例17: ParseExpressionType

        /// <summary>
        /// Parses the type of the expression.
        /// </summary>
        /// <param name="exprStr">The expr STR.</param>
        /// <param name="conn">The conn.</param>
        /// <returns></returns>
        public static FdoPropertyType? ParseExpressionType(string exprStr, FdoConnection conn)
        {
            Expression expr = null;
            try
            {
                expr = Expression.Parse(exprStr);
            }
            catch (OSGeo.FDO.Common.Exception)
            {
                return null;
            }

            if (expr.GetType() == typeof(Function))
            {
                Function func = expr as Function;
                FunctionDefinitionCollection funcDefs = (FunctionDefinitionCollection)conn.Capability.GetObjectCapability(CapabilityType.FdoCapabilityType_ExpressionFunctions);
                FunctionDefinition funcDef = null;

                //Try to get the return type
                foreach (FunctionDefinition fd in funcDefs)
                {
                    if (fd.Name == func.Name)
                    {
                        funcDef = fd;
                        break;
                    }
                }

                if (funcDef == null)
                    return null;

                switch (funcDef.ReturnPropertyType)
                {
                    case PropertyType.PropertyType_AssociationProperty:
                        return FdoPropertyType.Association;
                    case PropertyType.PropertyType_GeometricProperty:
                        return FdoPropertyType.Geometry;
                    case PropertyType.PropertyType_ObjectProperty:
                        return FdoPropertyType.Object;
                    case PropertyType.PropertyType_RasterProperty:
                        return FdoPropertyType.Raster;
                    case PropertyType.PropertyType_DataProperty:
                        {
                            return ValueConverter.GetPropertyType(funcDef.ReturnType);
                        }
                }
            }
            else if (expr.GetType() == typeof(BinaryExpression))
            {
                return FdoPropertyType.Boolean;
            }
            else if (expr.GetType() == typeof(DataValue))
            {
                DataValue dv = (DataValue)expr;
                return ValueConverter.GetPropertyType(dv.DataType);
            }
            return null;
        }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:64,代码来源:ExpressionUtility.cs


示例18: GetCopySpatialContextOverride

 /// <summary>
 /// Gets the registered override object
 /// </summary>
 /// <param name="targetConn"></param>
 /// <returns></returns>
 public static ICopySpatialContext GetCopySpatialContextOverride(FdoConnection targetConn)
 {
     string providerName = targetConn.Provider;
     if (_CopySpatialContextOverrides.ContainsKey(providerName))
     {
         return (ICopySpatialContext)Activator.CreateInstance(_CopySpatialContextOverrides[providerName]);
     }
     return new CopySpatialContext();
 }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:14,代码来源:CopySpatialContextOverrideFactory.cs


示例19: FdoBulkDeleteCtlPresenter

 public FdoBulkDeleteCtlPresenter(IFdoBulkDeleteView view, FdoConnection conn, string className)
 {
     _view = view;
     _conn = conn;
     _className = className;
     _view.ClassName = className;
     _view.Title = ICSharpCode.Core.ResourceService.GetString("TITLE_BULK_DELETE");
     _view.TransactionEnabled = (_conn.Capability.GetBooleanCapability(CapabilityType.FdoCapabilityType_SupportsTransactions));
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:9,代码来源:FdoBulkDeleteCtlPresentation.cs


示例20: GetSpatialContext

 public static SpatialContextInfo GetSpatialContext(FdoConnection conn)
 {
     FdoSpatialContextBrowserDlg diag = new FdoSpatialContextBrowserDlg(conn);
     if (diag.ShowDialog() == DialogResult.OK)
     {
         return diag.SelectedSpatialContext;
     }
     return null;
 }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:9,代码来源:FdoSpatialContextBrowserDlg.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Dapper.DynamicParameters类代码示例发布时间:2022-05-24
下一篇:
C# Alapfunkciok.FakUserInterface类代码示例发布时间: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