This is a cache of metadata about a specific property.
コード例 #1
0
 public void PropertyMetadataCollection_CopyTo_Test3()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Tests.Metadata.Mock)).Properties;
         var array = new PropertyMetadata[result.Count];
         result.CopyTo(array, 0);
         foreach (var p in result)
             CollectionAssert.Contains(array, p);
     }
 }
コード例 #2
0
        public void PropertyMetadataCollection_CopyTo_Test2()
        {
            using (var verify = new Verify())
            {
                try
                {
                    var result = MetadataCache.GetMetadata(typeof(Tests.Metadata.Mock)).Properties;
                    var array = new PropertyMetadata[0];
                    result.CopyTo(array, 0);

                    verify.Fail("Expected an ArgumentNullException");
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    verify.AreEqual("arrayIndex", ex.ParamName, "Incorrect parameter name");
                }
            }
        }
コード例 #3
0
ファイル: PropertyMetadata.cs プロジェクト: docevaad/Anchor
 /// <summary>
 /// Adds a property to the list of calculated values watching this property.
 /// </summary>
 /// <param name="affectedProperty"></param>
 internal void AddCalculatedField(PropertyMetadata affectedProperty)
 {
     m_CalculatedFieldsBuilder.Add(affectedProperty);
 }