public void Add(DataSetInfo dataSet)
 {
     m_dataSetsByID.Add(dataSet.ID, dataSet);
     if (!m_dataSetsByName.ContainsKey(dataSet.DataSetName))
     {
         m_dataSetsByName.Add(dataSet.DataSetName, dataSet);
     }
 }
Example #2
0
        internal DataSetInfo GetByID(Guid ID)
        {
            DataSetInfo value = null;

            if (m_collectionByID != null)
            {
                m_collectionByID.TryGetValue(ID, out value);
            }
            return(value);
        }
        public DataSetInfo GetByName(string name)
        {
            DataSetInfo value = null;

            if (m_dataSetsByName != null)
            {
                m_dataSetsByName.TryGetValue(name, out value);
            }
            return(value);
        }
Example #4
0
 internal void Add(DataSetInfo dataSet, ICatalogItemContext report)
 {
     if (Guid.Empty == dataSet.ID)
     {
         AddToCollectionByReport(dataSet, report);
     }
     else
     {
         AddToCollectionByID(dataSet);
     }
 }
Example #5
0
 private void AddToCollectionByID(DataSetInfo dataSet)
 {
     if (m_collectionByID == null)
     {
         m_collectionByID = new Dictionary <Guid, DataSetInfo>();
     }
     else if (m_collectionByID.ContainsKey(dataSet.ID))
     {
         return;
     }
     m_collectionByID.Add(dataSet.ID, dataSet);
 }
Example #6
0
        internal DataSetInfo GetByName(string name, ICatalogItemContext item)
        {
            DataSetInfo result = null;

            if (m_collectionByReport != null)
            {
                DataSetInfoCollection value = null;
                if (m_collectionByReport.TryGetValue(item.StableItemPath, out value))
                {
                    result = value.GetByName(name);
                }
            }
            return(result);
        }
 public void CombineOnSetDataSets(DataSetInfoCollection newDataSets)
 {
     if (newDataSets == null)
     {
         return;
     }
     foreach (DataSetInfo newDataSet in newDataSets)
     {
         DataSetInfo byName = GetByName(newDataSet.DataSetName);
         if (byName == null)
         {
             throw new DataSetNotFoundException(newDataSet.DataSetName.MarkAsPrivate());
         }
         byName.AbsolutePath          = newDataSet.AbsolutePath;
         byName.LinkedSharedDataSetID = Guid.Empty;
     }
 }
Example #8
0
        private void AddToCollectionByReport(DataSetInfo dataSet, ICatalogItemContext report)
        {
            DataSetInfoCollection value = null;

            if (m_collectionByReport == null)
            {
                m_collectionByReport = new Dictionary <string, DataSetInfoCollection>(StringComparer.Ordinal);
            }
            else
            {
                m_collectionByReport.TryGetValue(report.StableItemPath, out value);
            }
            if (value == null)
            {
                value = new DataSetInfoCollection();
                m_collectionByReport.Add(report.StableItemPath, value);
            }
            value.Add(dataSet);
        }
        public DataSetInfoCollection CombineOnSetDefinition(DataSetInfoCollection newDataSets)
        {
            DataSetInfoCollection dataSetInfoCollection = new DataSetInfoCollection();

            if (newDataSets == null)
            {
                return(dataSetInfoCollection);
            }
            foreach (DataSetInfo newDataSet in newDataSets)
            {
                DataSetInfo byName = GetByName(newDataSet.DataSetName);
                if (byName == null)
                {
                    dataSetInfoCollection.Add(newDataSet);
                    continue;
                }
                byName.ID = newDataSet.ID;
                dataSetInfoCollection.Add(byName);
            }
            return(dataSetInfoCollection);
        }