Пример #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public static SkippedDataSourceList Load(PaProject project)
        {
            if (project != null)
            {
                SkippedDataSourceList sdsl = new SkippedDataSourceList();
                foreach (PaDataSource ds in project.DataSources)
                {
                    sdsl[ds.ToString(true)] = false;
                }

                string filename = project.ProjectPathFilePrefix + kDataSourceInfoFilePrefix;

                if (File.Exists(filename))
                {
                    InternalSkipList skipList = STUtils.DeserializeData(filename,
                                                                        typeof(InternalSkipList)) as InternalSkipList;

                    if (skipList != null)
                    {
                        foreach (string dsName in skipList)
                        {
                            if (sdsl.ContainsKey(dsName))
                            {
                                sdsl[dsName] = true;
                            }
                        }
                    }
                }

                return(sdsl);
            }

            return(new SkippedDataSourceList());
        }
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Keep the list of skipped data sources updated as the user changes values in the
 /// column we added for them to check or uncheck.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 void m_grid_CellValueChanged(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex >= 0 && m_grid.Columns[e.ColumnIndex].Name == kLoadColName)
     {
         string dsName = m_grid["sourcefiles", e.RowIndex].Value as string;
         if (m_skippedList.ContainsKey(dsName))
         {
             m_skippedList[dsName] = !(bool)m_grid[kLoadColName, e.RowIndex].Value;
         }
     }
 }