Esempio n. 1
0
        internal void SchemaChanged(JoinSourceType type)
        {
            if (type == JoinSourceType.Target)
            {
                return;
            }

            _view.ClearJoins();
            FdoConnection conn = GetConnection(type);

            if (conn != null)
            {
                using (FdoFeatureService service = conn.CreateFeatureService())
                {
                    switch (type)
                    {
                    case JoinSourceType.Left:
                        _view.LeftClasses = service.GetClassNames(_view.SelectedLeftSchema);
                        ClassChanged(type);
                        break;

                    case JoinSourceType.Right:
                        _view.RightClasses = service.GetClassNames(_view.SelectedRightSchema);
                        ClassChanged(type);
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
        internal void ConnectionChanged(JoinSourceType type)
        {
            if (type != JoinSourceType.Target)
            {
                _view.ClearJoins();
            }

            FdoConnection conn = GetConnection(type);

            if (conn != null)
            {
                using (FdoFeatureService service = conn.CreateFeatureService())
                {
                    switch (type)
                    {
                    case JoinSourceType.Left:
                        _view.LeftSchemas = service.GetSchemaNames();
                        SchemaChanged(type);
                        break;

                    case JoinSourceType.Right:
                        _view.RightSchemas = service.GetSchemaNames();
                        SchemaChanged(type);
                        break;

                    case JoinSourceType.Target:
                        _view.TargetSchemas = service.GetSchemaNames();
                        SchemaChanged(type);
                        break;
                    }
                }
            }
        }
Esempio n. 3
0
        internal void ClassChanged(JoinSourceType type)
        {
            if (type == JoinSourceType.Target)
            {
                return;
            }

            _view.ClearJoins();

            FdoConnection conn = GetConnection(type);

            if (conn != null)
            {
                using (FdoFeatureService service = conn.CreateFeatureService())
                {
                    switch (type)
                    {
                    case JoinSourceType.Left:
                    {
                        string schema    = _view.SelectedLeftSchema;
                        string className = _view.SelectedLeftClass;

                        ClassDefinition cd = service.GetClassByName(schema, className);
                        if (cd != null)
                        {
                            List <string> properties = new List <string>();
                            foreach (PropertyDefinition pd in cd.Properties)
                            {
                                properties.Add(pd.Name);
                            }
                            _view.LeftProperties = properties;
                        }
                    }
                    break;

                    case JoinSourceType.Right:
                    {
                        string schema    = _view.SelectedRightSchema;
                        string className = _view.SelectedRightClass;

                        ClassDefinition cd = service.GetClassByName(schema, className);
                        if (cd != null)
                        {
                            List <string> properties = new List <string>();
                            foreach (PropertyDefinition pd in cd.Properties)
                            {
                                properties.Add(pd.Name);
                            }
                            _view.RightProperties = properties;
                        }
                    }
                    break;
                    }
                }
            }

            SetTargetGeometries();
        }
Esempio n. 4
0
        private static string GetOptionName(JoinSourceType type)
        {
            switch (type)
            {
            case JoinSourceType.Dbf:
                return("Table");

            case JoinSourceType.Xls:
                return("Worksheet");

            case JoinSourceType.Csv:
                return("Separator");
            }

            return("Table");
        }
Esempio n. 5
0
        internal FdoConnection GetConnection(JoinSourceType type)
        {
            switch (type)
            {
            case JoinSourceType.Left:
                return(_connMgr.GetConnection(_view.SelectedLeftConnection));

            case JoinSourceType.Right:
                return(_connMgr.GetConnection(_view.SelectedRightConnection));

            case JoinSourceType.Target:
                return(_connMgr.GetConnection(_view.SelectedTargetConnection));

            default:
                return(null);
            }
        }
Esempio n. 6
0
        internal void ClassChanged(JoinSourceType type)
        {
            if(type == JoinSourceType.Target)
                return;
            
            _view.ClearJoins();

            FdoConnection conn = GetConnection(type);
            if(conn != null)
            {
                using(FdoFeatureService service = conn.CreateFeatureService())
                {
                    switch (type)
                    {
                        case JoinSourceType.Left:
                            {
                                string schema = _view.SelectedLeftSchema;
                                string className = _view.SelectedLeftClass;

                                ClassDefinition cd = service.GetClassByName(schema, className);
                                if (cd != null)
                                {
                                    List<string> properties = new List<string>();
                                    foreach(PropertyDefinition pd in cd.Properties)
                                    {
                                        properties.Add(pd.Name);
                                    }
                                    _view.LeftProperties = properties;
                                }
                            }
                            break;
                        case JoinSourceType.Right:
                            {
                                string schema = _view.SelectedRightSchema;
                                string className = _view.SelectedRightClass;

                                ClassDefinition cd = service.GetClassByName(schema, className);
                                if (cd != null)
                                {
                                    List<string> properties = new List<string>();
                                    foreach (PropertyDefinition pd in cd.Properties)
                                    {
                                        properties.Add(pd.Name);
                                    }
                                    _view.RightProperties = properties;
                                }
                            }
                            break;
                    }
                }
            }

            SetTargetGeometries();
        }
Esempio n. 7
0
        internal void SchemaChanged(JoinSourceType type)
        {
            if (type == JoinSourceType.Target)
                return;

            _view.ClearJoins();
            FdoConnection conn = GetConnection(type);
            if (conn != null)
            {
                using (FdoFeatureService service = conn.CreateFeatureService())
                {
                    switch (type)
                    {
                        case JoinSourceType.Left:
                            _view.LeftClasses = service.GetClassNames(_view.SelectedLeftSchema);
                            ClassChanged(type);
                            break;
                        case JoinSourceType.Right:
                            _view.RightClasses = service.GetClassNames(_view.SelectedRightSchema);
                            ClassChanged(type);
                            break;
                    }
                }
            }
        }
Esempio n. 8
0
        internal void ConnectionChanged(JoinSourceType type)
        {
            if(type != JoinSourceType.Target)
                _view.ClearJoins();

            FdoConnection conn = GetConnection(type);
            if (conn != null)
            {
                using (FdoFeatureService service = conn.CreateFeatureService())
                {
                    switch (type)
                    {
                        case JoinSourceType.Left:
                            _view.LeftSchemas = service.GetSchemaNames();
                            SchemaChanged(type);
                            break;
                        case JoinSourceType.Right:
                            _view.RightSchemas = service.GetSchemaNames();
                            SchemaChanged(type);
                            break;
                        case JoinSourceType.Target:
                            _view.TargetSchemas = service.GetSchemaNames();
                            SchemaChanged(type);
                            break;
                    }
                }
            }
        }
Esempio n. 9
0
 internal FdoConnection GetConnection(JoinSourceType type)
 {
     switch (type)
     {
         case JoinSourceType.Left:
             return _connMgr.GetConnection(_view.SelectedLeftConnection);
         case JoinSourceType.Right:
             return _connMgr.GetConnection(_view.SelectedRightConnection);
         case JoinSourceType.Target:
             return _connMgr.GetConnection(_view.SelectedTargetConnection);
         default:
             return null;
     }
 }