Пример #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// This method will fill our list with the data sources from the specified project.
        /// The skipped values are saved before rebuilding the list so we can use them as the
        /// list is being built.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void InitializeFromProject(PaProject project)
        {
            SkippedDataSourceList tmpList = new SkippedDataSourceList();

            // Copy this list to a temp. list to save it's values before clearing this list.
            foreach (KeyValuePair <string, bool> kvp in this)
            {
                tmpList[kvp.Key] = kvp.Value;
            }

            Clear();

            // Go through the data sources, adding them to this list and setting each data
            // sources skip value to those found in the temp. list. If there is a data
            // source in the project that isn't in the temp. list, then don't skip it.
            foreach (PaDataSource ds in project.DataSources)
            {
                bool   fSkip;
                string dsName = ds.ToString(true);
                if (!tmpList.TryGetValue(dsName, out fSkip))
                {
                    fSkip = false;
                }

                this[dsName] = fSkip;
            }
        }