예제 #1
0
 public Relation(Relation relation)
 {
     Name = relation.Name;
     Primary = relation.Primary;
     PrimaryLink = relation.PrimaryLink;
     Secondary = relation.Secondary;
     SecondaryLink = relation.SecondaryLink;
 }
예제 #2
0
        private string LoadRelation()
        {
            Relation relation = new Relation();

            string line;

            while( ( line = ReadTrimmedLine() ) != null && !IsHeader(line) )
            {
                string argument,value;

                ParseLine(line,out argument,out value);

                if( argument.Equals(DataDictionaryElements.DICT_NAME,StringComparison.InvariantCultureIgnoreCase) )
                    relation.Name = value.ToUpper();

                else if( argument.Equals(DataDictionaryElements.RELATION_PRIMARY,StringComparison.InvariantCultureIgnoreCase) )
                    relation.Primary = value;

                else if( argument.Equals(DataDictionaryElements.RELATION_PRIMARYLINK,StringComparison.InvariantCultureIgnoreCase) )
                    relation.PrimaryLink = value;

                else if( argument.Equals(DataDictionaryElements.RELATION_SECONDARY,StringComparison.InvariantCultureIgnoreCase) )
                    relation.Secondary = value;

                else if( argument.Equals(DataDictionaryElements.RELATION_SECONDARYLINK,StringComparison.InvariantCultureIgnoreCase) )
                    relation.SecondaryLink = value;

                else
                    throw new DataDictionaryReaderException(line);
            }

            _dictionary.Relations.Add(relation);

            return line;
        }
예제 #3
0
        private void SaveRelation(Relation relation)
        {
            _tw.WriteLine();
            _tw.WriteLine(DataDictionaryElements.DICT_RELATION);

            SaveOption(DataDictionaryElements.DICT_NAME,relation.Name);
            SaveOption(DataDictionaryElements.RELATION_PRIMARY,relation.Primary);
            SaveOption(DataDictionaryElements.RELATION_PRIMARYLINK,relation.PrimaryLink);
            SaveOption(DataDictionaryElements.RELATION_SECONDARY,relation.Secondary);
            SaveOption(DataDictionaryElements.RELATION_SECONDARYLINK,relation.SecondaryLink);
        }