コード例 #1
0
 /// <summary>
 /// Populates the velocity properties from the given resource
 /// </summary>
 /// <param name="extendedProperties">ExtendedProperties instance to populate</param>
 /// <param name="resource">The resource from which to load the properties</param>
 /// <param name="append">A flag indicated weather the properties loaded from the resource should be appended or replaced in the extendedProperties</param>
 private static void FillProperties(ExtendedProperties extendedProperties, IInputStreamSource resource, bool append)
 {
     try {
         if (append)
         {
             extendedProperties.Load(resource.InputStream);
         }
         else
         {
             ExtendedProperties overrides = new ExtendedProperties();
             overrides.Load(resource.InputStream);
             foreach (DictionaryEntry entry in overrides)
             {
                 extendedProperties.SetProperty(Convert.ToString(entry.Key), entry.Value);
             }
         }
     } finally {
         resource.InputStream.Close();
     }
 }
コード例 #2
0
 /// <summary>
 /// Populates the velocity properties from the given resource
 /// </summary>
 /// <param name="extendedProperties">ExtendedProperties instance to populate</param>
 /// <param name="resource">The resource from which to load the properties</param>
 /// <param name="append">A flag indicated weather the properties loaded from the resource should be appended or replaced in the extendedProperties</param>
 private static void FillProperties(ExtendedProperties extendedProperties, IInputStreamSource resource, bool append) {
     try {
         if (append) {
             extendedProperties.Load(resource.InputStream);
         } else {
             ExtendedProperties overrides = new ExtendedProperties();
             overrides.Load(resource.InputStream);
             foreach (DictionaryEntry entry in overrides) {
                 extendedProperties.SetProperty(Convert.ToString(entry.Key), entry.Value);
             }
         }
     } finally {
         resource.InputStream.Close();
     }
 }