IsValueModified() private method

private IsValueModified ( string name ) : bool
name string
return bool
 internal ConfigurationLockCollection UnMergeLockList(
     ConfigurationLockCollection sourceLockList,
     ConfigurationLockCollection parentLockList,
     ConfigurationSaveMode saveMode) {
     if (sourceLockList.ExceptionList == false) {
         switch (saveMode) {
             case ConfigurationSaveMode.Modified: {
                     ConfigurationLockCollection tempLockList = new ConfigurationLockCollection(this, sourceLockList.LockType);
                     foreach (string lockedAttributeName in sourceLockList)
                         if (!parentLockList.Contains(lockedAttributeName) ||
                             sourceLockList.IsValueModified(lockedAttributeName)) {
                             tempLockList.Add(lockedAttributeName, ConfigurationValueFlags.Default);
                         }
                     return tempLockList;
                 }
             case ConfigurationSaveMode.Minimal: {
                     ConfigurationLockCollection tempLockList = new ConfigurationLockCollection(this, sourceLockList.LockType);
                     foreach (string lockedAttributeName in sourceLockList)
                         if (!parentLockList.Contains(lockedAttributeName)) {
                             tempLockList.Add(lockedAttributeName, ConfigurationValueFlags.Default);
                         }
                     return tempLockList;
                 }
         }
     }
     else {
         // exception list write out the entire collection unless the entire collection
         // came from the parent.
         if (saveMode == ConfigurationSaveMode.Modified || saveMode == ConfigurationSaveMode.Minimal) {
             bool sameAsParent = false;
             if (sourceLockList.Count == parentLockList.Count) {
                 sameAsParent = true;
                 foreach (string lockedAttributeName in sourceLockList) {
                     if (!parentLockList.Contains(lockedAttributeName) ||
                         (sourceLockList.IsValueModified(lockedAttributeName) &&
                          saveMode == ConfigurationSaveMode.Modified)) {
                         sameAsParent = false;
                     }
                 }
             }
             if (sameAsParent == true) {
                 return null;
             }
         }
     }
     return sourceLockList;
 }
 internal ConfigurationLockCollection UnMergeLockList(ConfigurationLockCollection sourceLockList, ConfigurationLockCollection parentLockList, ConfigurationSaveMode saveMode)
 {
     if (!sourceLockList.ExceptionList)
     {
         switch (saveMode)
         {
             case ConfigurationSaveMode.Modified:
             {
                 ConfigurationLockCollection locks = new ConfigurationLockCollection(this, sourceLockList.LockType);
                 foreach (string str in sourceLockList)
                 {
                     if (!parentLockList.Contains(str) || sourceLockList.IsValueModified(str))
                     {
                         locks.Add(str, ConfigurationValueFlags.Default);
                     }
                 }
                 return locks;
             }
             case ConfigurationSaveMode.Minimal:
             {
                 ConfigurationLockCollection locks2 = new ConfigurationLockCollection(this, sourceLockList.LockType);
                 foreach (string str2 in sourceLockList)
                 {
                     if (!parentLockList.Contains(str2))
                     {
                         locks2.Add(str2, ConfigurationValueFlags.Default);
                     }
                 }
                 return locks2;
             }
         }
         return sourceLockList;
     }
     if ((saveMode == ConfigurationSaveMode.Modified) || (saveMode == ConfigurationSaveMode.Minimal))
     {
         bool flag = false;
         if (sourceLockList.Count == parentLockList.Count)
         {
             flag = true;
             foreach (string str3 in sourceLockList)
             {
                 if (!parentLockList.Contains(str3) || (sourceLockList.IsValueModified(str3) && (saveMode == ConfigurationSaveMode.Modified)))
                 {
                     flag = false;
                 }
             }
         }
         if (flag)
         {
             return null;
         }
     }
     return sourceLockList;
 }
Example #3
0
 internal ConfigurationLockCollection UnMergeLockList(ConfigurationLockCollection sourceLockList, ConfigurationLockCollection parentLockList, ConfigurationSaveMode saveMode)
 {
     if (!sourceLockList.ExceptionList)
       {
     switch (saveMode)
     {
       case ConfigurationSaveMode.Modified:
     ConfigurationLockCollection configurationLockCollection1 = new ConfigurationLockCollection(this, sourceLockList.LockType);
     foreach (string name in sourceLockList)
     {
       if (!parentLockList.Contains(name) || sourceLockList.IsValueModified(name))
         configurationLockCollection1.Add(name, ConfigurationValueFlags.Default);
     }
     return configurationLockCollection1;
       case ConfigurationSaveMode.Minimal:
     ConfigurationLockCollection configurationLockCollection2 = new ConfigurationLockCollection(this, sourceLockList.LockType);
     foreach (string name in sourceLockList)
     {
       if (!parentLockList.Contains(name))
         configurationLockCollection2.Add(name, ConfigurationValueFlags.Default);
     }
     return configurationLockCollection2;
     }
       }
       else if (saveMode == ConfigurationSaveMode.Modified || saveMode == ConfigurationSaveMode.Minimal)
       {
     bool flag = false;
     if (sourceLockList.Count == parentLockList.Count)
     {
       flag = true;
       foreach (string name in sourceLockList)
       {
     if (!parentLockList.Contains(name) || sourceLockList.IsValueModified(name) && saveMode == ConfigurationSaveMode.Modified)
       flag = false;
       }
     }
     if (flag)
       return (ConfigurationLockCollection) null;
       }
       return sourceLockList;
 }