예제 #1
0
        public static SourceCodeMappings getSourceCodeMappingsFromDataGridView(DataGridView dgvDataGridView)
        {
            if (dgvDataGridView.Columns.Count != 2)
            {
                DI.log.error(
                    "in getSourceCodeMappingsFromDataGridView: invalid DataGridView : dgvDataGridView.Columns.Count != 2 ");
                return(null);
            }

            var lmMappings = new List <SourceCodeMappingsMapping>();

            foreach (DataGridViewRow rRow in dgvDataGridView.Rows)
            {
                if (rRow.Cells[0].Value != null && rRow.Cells[1].Value != null)
                {
                    var mMapping = new SourceCodeMappingsMapping
                    {
                        replaceThisString = rRow.Cells[0].Value.ToString(),
                        withThisString    = rRow.Cells[1].Value.ToString()
                    };
                    lmMappings.Add(mMapping);
                }
            }
            var scmSourceCodeMappings = new SourceCodeMappings {
                Mapping = lmMappings.ToArray()
            };

            return(scmSourceCodeMappings);
        }
예제 #2
0
        public static void tryToFixSourceCodeReferences(O2AssessmentData_OunceV6 oadO2AssessmentDataOunceV6)
        {
            PublicDI.log.debug("Trying To Fix Source Code References");
            SourceCodeMappings scmSourceCodeMappings = SourceCodeMappingsUtils.getSourceCodeMappings();

            foreach (SourceCodeMappingsMapping mMapping in scmSourceCodeMappings.Mapping)
            {
                fixAllFileReferencesOnAssessmentDataObject(oadO2AssessmentDataOunceV6, mMapping.replaceThisString,
                                                           mMapping.withThisString);
            }
        }
예제 #3
0
        public static SourceCodeMappings getSourceCodeMappings()
        {
            if (File.Exists(getSourceCodeMappingsFile()))
            {
                return
                    ((SourceCodeMappings)
                     Serialize.getDeSerializedObjectFromXmlFile(getSourceCodeMappingsFile(), typeof(SourceCodeMappings)));
            }

            var scmSourceCodeMappings = new SourceCodeMappings {
                Mapping = new SourceCodeMappingsMapping[] {}
            };

            return(scmSourceCodeMappings);
        }
        public static SourceCodeMappings getSourceCodeMappings()
        {
            try
            {
                if (File.Exists(getSourceCodeMappingsFile()))
                {
                    return
                        ((SourceCodeMappings)Serialize.getDeSerializedObjectFromXmlFile(getSourceCodeMappingsFile(), typeof(SourceCodeMappings)));
                }
            }
            catch (Exception ex)
            {
                "[getSourceCodeMappings] {0}".error(ex.Message);
            }

            var scmSourceCodeMappings = new SourceCodeMappings();

            scmSourceCodeMappings.Mapping = new SourceCodeMappingsMapping[] {};
            return(scmSourceCodeMappings);
        }
예제 #5
0
 public static void saveSourceCodeMappings(SourceCodeMappings scmSourceCodeMappings)
 {
     Serialize.createSerializedXmlFileFromObject(scmSourceCodeMappings, getSourceCodeMappingsFile(), null);
 }
 static SourceCodeMappingsUtils()
 {
     sourceCodeMappingFileName = "SourceCodeMappingsFile.xml";                   // must be set before the call to getSourceCodeMappings();
     sourceCodeMappings        = SourceCodeMappingsUtils.getSourceCodeMappings();
 }