Microsoft.AnalysisServices.ModelComponentCollection.Contains(Microsoft.AnalysisServices.IModelComponent)

Here are the examples of the csharp api class Microsoft.AnalysisServices.ModelComponentCollection.Contains(Microsoft.AnalysisServices.IModelComponent) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

21 Examples 7

1. Example

Project: Analysis-Services
Source File: Perspective.cs
public bool ContainsOtherPerspectiveSelections(Perspective otherPerspective)
        {
            b/n ..... /n //View Source file for more details /n }

2. Example

Project: Analysis-Services
Source File: Table.cs
public void DeleteRelationship(string relationshipId)
        {
            if (_amoDimension.Relationships.Contains(relationshipId))
            {
                _amoDimension.Relationships.Remove(relationshipId);
            }

            // shell model
            if (_relationships.ContainsId(relationshipId))
            {
                _relationships.RemoveById(relationshipId);
            }
        }

3. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void DeleteDataSource(string id)
        {
            if (_amoDatabase.DataSources.Contains(id))
            {
                _amoDatabase.DataSources.Remove(id);
            }

            //check if DataSourceViews[0].DataSourceID refers to the datasource to be deleted
            if (_amoDatabase.DataSourceViews.Count > 0 && _amoDatabase.DataSourceViews[0].DataSourceID == id)
            {
                //set it to the first data source in the cube (should be fine because all the existing tables that use this datasource will also be deleted)
                if (_amoDatabase.DataSources.Count > 0)
                {
                    _amoDatabase.DataSourceViews[0].DataSourceID = _amoDatabase.DataSources[0].ID;
                }
                else
                {
                    _amoDatabase.DataSourceViews[0].DataSourceID = null;
                }
            }            

            // shell model
            if (_dataSources.ContainsId(id))
            {
                _dataSources.RemoveById(id);
            }
        }

4. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void CreateDataSource(DataSource dataSourceSource)
        {
            Microsoft.AnalysisServices.DataSource amoDataSourceTarget = dataSourceSource.AmoDataSource.Clone();

            // Need to check if there is an existing datasource with same ID (some clever clogs might have renamed the object in source and kept same ID).  If so, replace it with a new one and store it as substitute ID in source.
            if (_amoDatabase.DataSources.Contains(dataSourceSource.Id))
            {
                amoDataSourceTarget.ID = Convert.ToString(Guid.NewGuid());
                dataSourceSource.SubstituteId = amoDataSourceTarget.ID;
            }

            _amoDatabase.DataSources.Add(amoDataSourceTarget);

            // in the event we deleted the only datasource in the DeleteDataSource method above, ...
            if (_amoDatabase.DataSourceViews.Count > 0 && _amoDatabase.DataSourceViews[0].DataSourceID == null)
            {
                _amoDatabase.DataSourceViews[0].DataSourceID = amoDataSourceTarget.ID;
            }

            // shell model
            _dataSources.Add(new DataSource(this, amoDataSourceTarget));
        }

5. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void DeleteRole(string id)
        {
            if (_amoDatabase.Roles.Contains(id))
       /n ..... /n //View Source file for more details /n }

6. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void FinalCleanup()
        {
            //check for database permissions to non-existing roles.  Cannot do this when creating/updating dimensions because roles not yet created/deleted.
            foreach (Dimension dimension in _amoDatabase.Dimensions)
            {
                List<string> dimensionPermissionIdsToDelete = new List<string>();

                foreach (DimensionPermission dimensionPermission in dimension.DimensionPermissions)
                {
                    if (!_amoDatabase.Roles.Contains(dimensionPermission.RoleID))
                    {
                        dimensionPermissionIdsToDelete.Add(dimensionPermission.ID);
                    }
                }

                foreach (string dimensionPermissionIdToDelete in dimensionPermissionIdsToDelete)
                {
                    dimension.DimensionPermissions.Remove(dimensionPermissionIdToDelete);
                }
            }

            //check for redundant cube
            if (_amoDatabase.Dimensions.Count == 0)
            {
                _amoDatabase.Cubes.Clear();
                _amoDatabase.DataSourceViews.Clear();
            }
        }

7. Example

Project: BismNormalizer
Source File: TabularModel.cs
public void CreateDataSource(DataSource dataSourceSource)
        {
            Microsoft.AnalysisServices.DataSource amoDataSourceTarget = dataSourceSource.AmoDataSource.Clone();

            // Need to check if there is an existing datasource with same ID (some clever clogs might have renamed the object in source and kept same ID).  If so, replace it with a new one and store it as substitute ID in source.
            if (_amoDatabase.DataSources.Contains(dataSourceSource.Id))
            {
                amoDataSourceTarget.ID = Convert.ToString(Guid.NewGuid());
                dataSourceSource.SubstituteId = amoDataSourceTarget.ID;
            }

            _amoDatabase.DataSources.Add(amoDataSourceTarget);

            // in the event we deleted the only datasource in the DeleteDataSource method above, ...
            if (_amoDatabase.DataSourceViews.Count > 0 && _amoDatabase.DataSourceViews[0].DataSourceID == null)
            {
                _amoDatabase.DataSourceViews[0].DataSourceID = amoDataSourceTarget.ID;
            }

            // shell model
            _dataSources.Add(new DataSource(this, amoDataSourceTarget));
        }

8. Example

Project: BismNormalizer
Source File: TabularModel.cs
public void CreateAction(Action actionSource)
        {
            if (_amoDatabase.Cubes.Count > 0)
            {

                Microsoft.AnalysisServices.Action amoActionTarget = actionSource.AmoAction.Clone();

                // Need to check if there is an existing Action with same ID (some clever clogs might have renamed the object in source and kept same ID).  If so, replace it with a new one and store it as substitute ID in source.
                if (_amoDatabase.Cubes[0].Actions.Contains(actionSource.Id))
                {
                    amoActionTarget.ID = Convert.ToString(Guid.NewGuid());
                    actionSource.SubstituteId = amoActionTarget.ID;
                }

                _amoDatabase.Cubes[0].Actions.Add(amoActionTarget);

                // shell model
                _actions.Add(new Action(this, amoActionTarget));
            }
        }

9. Example

Project: Analysis-Services
Source File: Table.cs
public bool CreateRelationship(Microsoft.AnalysisServices.Relationship amoRelationshipSource, Dimens/n ..... /n //View Source file for more details /n }

10. Example

Project: Analysis-Services
Source File: TabularModel.cs
private void PopulateReferenceDimension(MeasureGroup measureGroup, string degenerateDimensionId, Rel/n ..... /n //View Source file for more details /n }

11. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void UpdateRelationshipsForChildrenOfUpdatedTables(Table tableTarget)
        {
            //n ..... /n //View Source file for more details /n }

12. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void CreatePerspective(Perspective perspectiveSource)
        {
            if (_amoDatabase./n ..... /n //View Source file for more details /n }

13. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void CreateRole(Role roleSource)
        {
            Microsoft.AnalysisServices.Role amoRol/n ..... /n //View Source file for more details /n }

14. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void CreateTable(Table tableSource, ref string sourceObjectSubstituteId, ref bool useSubstitu/n ..... /n //View Source file for more details /n }

15. Example

Project: BismNormalizer
Source File: TabularModel.cs
private void CreateMdxScriptCommand(Measure measure)
        {
            StringBuilder measuresCom/n ..... /n //View Source file for more details /n }

16. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void UpdateTable(Table tableSource, Table tableTarget, ref string sourceObjectSubstituteId, r/n ..... /n //View Source file for more details /n }

17. Example

Project: Analysis-Services
Source File: TabularModel.cs
public void UpdatePerspective(Perspective perspectiveSource, Perspective perspectiveTarget)
        /n ..... /n //View Source file for more details /n }

18. Example

Project: BismNormalizer
Source File: TabularModel.cs
public void PopulateMdxScript()
        {
            if (_amoDatabase.Cubes.Count > 0 && _amoDat/n ..... /n //View Source file for more details /n }

19. Example

Project: BismNormalizer
Source File: TabularModel.cs
public void UpdateTable(Table tableSource, Table tableTarget, ref string sourceObjectSubstituteId, r/n ..... /n //View Source file for more details /n }

20. Example

Project: BismNormalizer
Source File: TabularModel.cs
public void CreateRole(Role roleSource)
        {
            Microsoft.AnalysisServices.Role amoRol/n ..... /n //View Source file for more details /n }

21. Example

Project: BismNormalizer
Source File: TabularModel.cs
public void CreateTable(Table tableSource, ref string sourceObjectSubstituteId, ref bool useSubstitu/n ..... /n //View Source file for more details /n }