コード例 #1
0
ファイル: Profile.cs プロジェクト: sr3dna/big5sync
 public void CreateMapping(string logicalAddress, string physicalAddress,string guid)
 {
     ProfileMapping map = new ProfileMapping(logicalAddress, physicalAddress, guid);
     if (Contains(map))
     {
         throw new ProfileMappingExistException(map);
     }            
     _mappingList.Add(map);
     
 }
コード例 #2
0
ファイル: Profile.cs プロジェクト: sr3dna/big5sync
 /// <summary>
 /// Check if a Profilemapping is Contain in this profile.
 ///   throw ProfileMappingConflictException if Profile Mapping has Conflict.
 ///   conflict is identified as there is a similar in 1 or 2 field.
 /// </summary>
 /// <param name="mapping">The Mapping to Check</param>
 /// <returns>true if there is a mapping that is equals to the mapping. Else return false</returns>
 public bool Contains(ProfileMapping mapping)
 {
     foreach (ProfileMapping map in _mappingList)
     {
         if (map.Equals(mapping))
         {
             return true;
         }
     }
     return false;
 }
コード例 #3
0
ファイル: ProfileMapping.cs プロジェクト: sr3dna/big5sync
 public Boolean Equals(ProfileMapping mapping)
 {
     int equalCount = 0;
     if (this._guid.Equals(mapping.GUID))
     {
         equalCount++;
     }
     if (this._logicalAddress.Equals(mapping.LogicalAddress))
     {
         equalCount++;
     }
     if (equalCount == 0)
     {
         return false;
     }
     if (equalCount == 2)
     {
         return true;
     }
     throw new ProfileMappingConflictException(this, mapping);
     
 }
コード例 #4
0
ファイル: ProfilingXMLHelper.cs プロジェクト: sr3dna/big5sync
        public static XmlElement CreateElementForMapping(XmlDocument profilexml, ProfileMapping mapping)
        {
            XmlElement map = profilexml.CreateElement("drive");
            XmlElement logical = profilexml.CreateElement("logical");

            XmlElement guid = profilexml.CreateElement("guid");
            Debug.Assert(mapping.GUID != null);
            Debug.Assert(mapping.LogicalAddress != null);
            logical.InnerText = mapping.LogicalAddress;
            guid.InnerText = mapping.GUID;

            map.AppendChild(logical);

            map.AppendChild(guid);
            return map;
        }
コード例 #5
0
 public ProfileMappingConflictException(ProfileMapping mapping1, ProfileMapping mapping2):base(""+ErrorMessage.PROFILE_MAPPING_CONFLICT_EXCEPTION)
 {
     this.mapping1 = mapping1;
     this.mapping2 = mapping2;
 }
コード例 #6
0
ファイル: Profile.cs プロジェクト: sr3dna/big5sync
 public void CreateMapping(ProfileMapping mapping)
 {
     this.CreateMapping(mapping.LogicalAddress, mapping.PhyiscalAddress, mapping.GUID);
 }
コード例 #7
0
        public ProfileMappingExistException(ProfileMapping mapping)
            : base(ErrorMessage.PROFILE_MAPPING_EXIST_EXCEPTION)
        {

        }