Aracılığıyla paylaş


ExpressionBuilderCollection Sınıf

Tanım

Nesne koleksiyonunu ExpressionBuilder temsil eder. Bu sınıf devralınamaz.

public ref class ExpressionBuilderCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ExpressionBuilder))]
public sealed class ExpressionBuilderCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ExpressionBuilder))>]
type ExpressionBuilderCollection = class
    inherit ConfigurationElementCollection
Public NotInheritable Class ExpressionBuilderCollection
Inherits ConfigurationElementCollection
Devralma
Öznitelikler

Örnekler

Bu bölümde iki kod örneği verilmiştir. birincisi, sınıfın çeşitli özellikleri için değerleri bildirimli olarak belirtmeyi ExpressionBuilderCollection gösterir. İkincisi, sınıfın ExpressionBuilderCollection üyelerinin nasıl kullanılacağını gösterir.

Aşağıdaki yapılandırma dosyası örneği, sınıfın çeşitli özellikleri ExpressionBuilderCollection için değerlerin bildirimli olarak nasıl belirtileceğini gösterir.

<system.web>  
  <compilation>   
    <expressionBuilders>  
      <add   
        expressionPrefix="Resources"   
        type="System.Web.Compilation.ResourceExpressionBuilder"/>  
      <add   
        expressionPrefix="ConnectionStrings"   
        type="System.Web.Compilation.  
        ConnectionStringsExpressionBuilder"/>  
      <add expressionPrefix="AppSettings"   
        type="System.Web.Compilation.AppSettingsExpressionBuilder" />  
    </expressionBuilders>  
  </compilation>  
</system.web>  

Aşağıdaki kod örneği, sınıfın ExpressionBuilderCollection üyelerinin nasıl kullanılacağını gösterir.

#region Using directives

using System;
using System.Configuration;
using System.Web.Configuration;

#endregion

namespace Samples.Aspnet.SystemWebConfiguration
{
  class UsingExpressionBuildCollection
  {
    static void Main(string[] args)
    {
      try
      {
        // Set the path of the config file.
        string configPath = "";

        // Get the Web application configuration object.
        Configuration config =
          WebConfigurationManager.OpenWebConfiguration(configPath);

        // Get the section related object.
        CompilationSection configSection =
          (CompilationSection)config.GetSection("system.web/compilation");

        // Display title and info.
        Console.WriteLine("ASP.NET Configuration Info");
        Console.WriteLine();

        // Display Config details.
        Console.WriteLine("File Path: {0}",
          config.FilePath);
        Console.WriteLine("Section Path: {0}",
          configSection.SectionInformation.Name);

        // Create a new ExpressionBuilder reference.
        ExpressionBuilder myExpressionBuilder =
          new ExpressionBuilder("myCustomExpression", "MyCustomExpressionBuilder");
        // Add an ExpressionBuilder to the configuration.
        configSection.ExpressionBuilders.Add(myExpressionBuilder);

        // Add an ExpressionBuilder to the configuration.
        ExpressionBuilder myExpressionBuilder2 =
          new ExpressionBuilder("myCustomExpression2", "MyCustomExpressionBuilder2");
        configSection.ExpressionBuilders.Add(myExpressionBuilder2);

        // Display the ExpressionBuilder count.
        Console.WriteLine("ExpressionBuilder Count: {0}",
          configSection.ExpressionBuilders.Count);

        // Display the ExpressionBuildersCollection details.
        int i = 1;
        int j = 1;
        foreach (ExpressionBuilder expressionBuilder in configSection.ExpressionBuilders)
        {
          Console.WriteLine();
          Console.WriteLine("ExpressionBuilder {0} Details:", i);
          Console.WriteLine("Type: {0}", expressionBuilder.ElementInformation.Type);
          Console.WriteLine("Source: {0}", expressionBuilder.ElementInformation.Source);
          Console.WriteLine("LineNumber: {0}", expressionBuilder.ElementInformation.LineNumber);
          Console.WriteLine("Properties Count: {0}", expressionBuilder.ElementInformation.Properties.Count);
          j = 1;
          foreach (PropertyInformation propertyItem in expressionBuilder.ElementInformation.Properties)
          {
            Console.WriteLine("Property {0} Name: {1}", j, propertyItem.Name);
            Console.WriteLine("Property {0} Value: {1}", j, propertyItem.Value);
            ++j;
          }
          ++i;
        }

        // Remove an ExpressionBuilder.
        configSection.ExpressionBuilders.RemoveAt
          (configSection.ExpressionBuilders.Count-1);

        // Remove an ExpressionBuilder.
        configSection.ExpressionBuilders.Remove("myCustomExpression");

        // Update if not locked.
        if (!configSection.SectionInformation.IsLocked)
        {
          config.Save();
          Console.WriteLine("** Configuration updated.");
        }
        else
        {
          Console.WriteLine("** Could not update, section is locked.");
        }
      }

      catch (Exception e)
      {
        // Unknown error.
        Console.WriteLine(e.ToString());
      }

      // Display and wait.
      Console.ReadLine();
    }
  }
}
Imports System.Configuration
Imports System.Web.Configuration

Namespace Samples.Aspnet.SystemWebConfiguration
  Class UsingExpressionBuildCollection
    Public Shared Sub Main()
      Try
        ' Set the path of the config file.
        Dim configPath As String = ""

        ' Get the Web application configuration object.
        Dim config As System.Configuration.Configuration = _
         WebConfigurationManager.OpenWebConfiguration(configPath)

        ' Get the section related object.
        Dim configSection As System.Web.Configuration.CompilationSection = _
         CType(config.GetSection("system.web/compilation"), _
         System.Web.Configuration.CompilationSection)

        ' Display title and info.
        Console.WriteLine("ASP.NET Configuration Info")
        Console.WriteLine()

        ' Display Config details.
        Console.WriteLine("File Path: {0}", _
         config.FilePath)
        Console.WriteLine("Section Path: {0}", _
         configSection.SectionInformation.Name)

        ' Create a new ExpressionBuilder reference.
        Dim myExpressionBuilder As ExpressionBuilder = _
          New ExpressionBuilder("myCustomExpression", "MyCustomExpressionBuilder")
        ' Add an ExpressionBuilder to the configuration.
        configSection.ExpressionBuilders.Add(myExpressionBuilder)

        ' Add an ExpressionBuilder to the configuration.
        Dim myExpressionBuilder2 As ExpressionBuilder = _
         New ExpressionBuilder("myCustomExpression2", "MyCustomExpressionBuilder2")
        configSection.ExpressionBuilders.Add(myExpressionBuilder2)

        ' Display the ExpressionBuilder count.
        Console.WriteLine("ExpressionBuilder Count: {0}", _
          configSection.ExpressionBuilders.Count)

        ' Display the ExpressionBuildersCollection details.
        Dim i = 1
        Dim j = 1
        For Each expressionBuilder As ExpressionBuilder In configSection.ExpressionBuilders()
          Console.WriteLine()
          Console.WriteLine("ExpressionBuilder {0} Details:", i)
          Console.WriteLine("Type: {0}", expressionBuilder.ElementInformation.Type)
          Console.WriteLine("Source: {0}", expressionBuilder.ElementInformation.Source)
          Console.WriteLine("LineNumber: {0}", expressionBuilder.ElementInformation.LineNumber)
          Console.WriteLine("Properties Count: {0}", expressionBuilder.ElementInformation.Properties.Count)
          j = 1
          For Each propertyItem As PropertyInformation In expressionBuilder.ElementInformation.Properties
            Console.WriteLine("Property {0} Name: {1}", j, propertyItem.Name)
            Console.WriteLine("Property {0} Value: {1}", j, propertyItem.Value)
            j = j + 1
          Next
          i = i + 1
        Next

        ' Remove an ExpressionBuilder.
        configSection.ExpressionBuilders.RemoveAt _
         (configSection.ExpressionBuilders.Count - 1)

        ' Remove an ExpressionBuilder.
        configSection.ExpressionBuilders.Remove("myCustomExpression")

        ' Update if not locked.
        If Not configSection.SectionInformation.IsLocked Then
          config.Save()
          Console.WriteLine("** Configuration updated.")
        Else
          Console.WriteLine("** Could not update, section is locked.")
        End If

      Catch e As Exception
        ' Unknown error.
        Console.WriteLine(e.ToString())
      End Try

      ' Display and wait
      Console.ReadLine()
    End Sub
  End Class
End Namespace

Açıklamalar

sınıfı, ExpressionBuilderCollection temel yapılandırma dosyasındaki hiçbir gerçek öğeye başvurmaz. Bu, içerdiği derleme bilgilerine kolay erişim sağlayan bir yapıdır.

Oluşturucular

ExpressionBuilderCollection()

ExpressionBuilderCollection sınıfının yeni bir örneğini başlatır.

Özellikler

AddElementName

türetilmiş bir sınıfta geçersiz kılındığında içindeki ConfigurationElementCollection ekleme işlemiyle ilişkilendirilecek öğesinin adını ConfigurationElement alır veya ayarlar.

(Devralındığı yer: ConfigurationElementCollection)
ClearElementName

türetilmiş bir sınıfta geçersiz kılındığında içindeki clear işlemiyle ilişkilendirilecek öğesinin ConfigurationElementCollection adını ConfigurationElement alır veya ayarlar.

(Devralındığı yer: ConfigurationElementCollection)
CollectionType

türünü ConfigurationElementCollectionalır.

(Devralındığı yer: ConfigurationElementCollection)
Count

Koleksiyondaki öğe sayısını alır.

(Devralındığı yer: ConfigurationElementCollection)
CurrentConfiguration

Geçerli ConfigurationElement örneğin ait olduğu yapılandırma hiyerarşisini temsil eden en üst düzey Configuration örneğe başvuru alır.

(Devralındığı yer: ConfigurationElement)
ElementInformation

Nesnenin özelleştirilebilir olmayan bilgilerini ve işlevselliğini ConfigurationElement içeren bir ElementInformation nesnesi alır.

(Devralındığı yer: ConfigurationElement)
ElementName

Türetilmiş bir sınıfta geçersiz kılındığında yapılandırma dosyasındaki bu öğe koleksiyonunu tanımlamak için kullanılan adı alır.

(Devralındığı yer: ConfigurationElementCollection)
ElementProperty

Nesnenin ConfigurationElementProperty kendisini temsil ConfigurationElement eden nesneyi alır.

(Devralındığı yer: ConfigurationElement)
EmitClear

Koleksiyonun temizlenip temizlenmediğini belirten bir değer alır veya ayarlar.

(Devralındığı yer: ConfigurationElementCollection)
EvaluationContext

Nesnenin ContextInformation nesnesini ConfigurationElement alır.

(Devralındığı yer: ConfigurationElement)
HasContext

özelliğinin nullolup olmadığını CurrentConfiguration gösteren bir değer alır.

(Devralındığı yer: ConfigurationElement)
IsSynchronized

Koleksiyona erişimin eşitlenip eşitlenmediğini belirten bir değer alır.

(Devralındığı yer: ConfigurationElementCollection)
Item[ConfigurationProperty]

Bu yapılandırma öğesinin özelliğini veya özniteliğini alır veya ayarlar.

(Devralındığı yer: ConfigurationElement)
Item[Int32]

koleksiyonda belirtilen dizinde ExpressionBuilderCollection öğesini ExpressionBuilder alır veya ayarlar.

Item[String]

ExpressionBuilder Belirtilen ada sahip nesneyi alır.

LockAllAttributesExcept

Kilitli özniteliklerin koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
LockAllElementsExcept

Kilitli öğeler koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
LockAttributes

Kilitli özniteliklerin koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
LockElements

Kilitli öğeler koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
LockItem

Öğesinin kilitli olup olmadığını belirten bir değer alır veya ayarlar.

(Devralındığı yer: ConfigurationElement)
Properties

Özellik koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
RemoveElementName

Türetilmiş bir sınıfta geçersiz kılındığında içindeki ConfigurationElementCollection kaldırma işlemiyle ilişkilendirilecek öğesinin adını ConfigurationElement alır veya ayarlar.

(Devralındığı yer: ConfigurationElementCollection)
SyncRoot

öğesine erişimi ConfigurationElementCollectioneşitlemek için kullanılan bir nesneyi alır.

(Devralındığı yer: ConfigurationElementCollection)
ThrowOnDuplicate

öğesine yineleme ConfigurationElement ekleme girişiminin ConfigurationElementCollection bir özel durum oluşturulup oluşturulmayacağını belirten bir değer alır.

(Devralındığı yer: ConfigurationElementCollection)

Yöntemler

Add(ExpressionBuilder)

öğesine ExpressionBuilderCollectionbir ExpressionBuilder nesnesi ekler.

BaseAdd(ConfigurationElement)

öğesine ConfigurationElementCollectionbir yapılandırma öğesi ekler.

(Devralındığı yer: ConfigurationElementCollection)
BaseAdd(ConfigurationElement, Boolean)

Yapılandırma öğesi koleksiyonuna bir yapılandırma öğesi ekler.

(Devralındığı yer: ConfigurationElementCollection)
BaseAdd(Int32, ConfigurationElement)

Yapılandırma öğesi koleksiyonuna bir yapılandırma öğesi ekler.

(Devralındığı yer: ConfigurationElementCollection)
BaseClear()

Koleksiyondan tüm yapılandırma öğesi nesnelerini kaldırır.

(Devralındığı yer: ConfigurationElementCollection)
BaseGet(Int32)

Belirtilen dizin konumunda yapılandırma öğesini alır.

(Devralındığı yer: ConfigurationElementCollection)
BaseGet(Object)

Belirtilen anahtarla yapılandırma öğesini döndürür.

(Devralındığı yer: ConfigurationElementCollection)
BaseGetAllKeys()

içinde yer alan tüm yapılandırma öğeleri için anahtarların bir dizisini ConfigurationElementCollectiondöndürür.

(Devralındığı yer: ConfigurationElementCollection)
BaseGetKey(Int32)

Belirtilen dizin konumunda anahtarını ConfigurationElement alır.

(Devralındığı yer: ConfigurationElementCollection)
BaseIndexOf(ConfigurationElement)

Belirtilen ConfigurationElementöğesinin dizinini gösterir.

(Devralındığı yer: ConfigurationElementCollection)
BaseIsRemoved(Object)

Belirtilen anahtara sahip öğesinin öğesinden ConfigurationElementCollectionkaldırılıp kaldırılmadığını ConfigurationElement gösterir.

(Devralındığı yer: ConfigurationElementCollection)
BaseRemove(Object)

ConfigurationElement Bir öğesini koleksiyondan kaldırır.

(Devralındığı yer: ConfigurationElementCollection)
BaseRemoveAt(Int32)

Belirtilen dizin konumunda öğesini ConfigurationElement kaldırır.

(Devralındığı yer: ConfigurationElementCollection)
Clear()

Koleksiyondaki ExpressionBuilder tüm nesneleri ExpressionBuilderCollection temizler.

CopyTo(ConfigurationElement[], Int32)

öğesinin ConfigurationElementCollection içeriğini bir diziye kopyalar.

(Devralındığı yer: ConfigurationElementCollection)
CreateNewElement()

Türetilmiş bir sınıfta geçersiz kılındığında yeni ConfigurationElementbir oluşturur.

(Devralındığı yer: ConfigurationElementCollection)
CreateNewElement(String)

Türetilmiş bir sınıfta geçersiz kılındığında yeni ConfigurationElement bir oluşturur.

(Devralındığı yer: ConfigurationElementCollection)
DeserializeElement(XmlReader, Boolean)

Yapılandırma dosyasından XML okur.

(Devralındığı yer: ConfigurationElement)
Equals(Object)

öğesini ConfigurationElementCollection belirtilen nesneyle karşılaştırır.

(Devralındığı yer: ConfigurationElementCollection)
GetElementKey(ConfigurationElement)

Türetilmiş bir sınıfta geçersiz kılındığında belirtilen yapılandırma öğesinin öğe anahtarını alır.

(Devralındığı yer: ConfigurationElementCollection)
GetEnumerator()

aracılığıyla ConfigurationElementCollectionyinelemek için kullanılan bir IEnumerator alır.

(Devralındığı yer: ConfigurationElementCollection)
GetHashCode()

Örneği temsil eden ConfigurationElementCollection benzersiz bir değer alır.

(Devralındığı yer: ConfigurationElementCollection)
GetTransformedAssemblyString(String)

Belirtilen derleme adının dönüştürülmüş sürümünü döndürür.

(Devralındığı yer: ConfigurationElement)
GetTransformedTypeString(String)

Belirtilen tür adının dönüştürülmüş sürümünü döndürür.

(Devralındığı yer: ConfigurationElement)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
Init()

ConfigurationElement Nesneyi ilk durumuna ayarlar.

(Devralındığı yer: ConfigurationElement)
InitializeDefault()

Nesne için varsayılan değer kümesini başlatmak için ConfigurationElement kullanılır.

(Devralındığı yer: ConfigurationElement)
IsElementName(String)

Belirtilen ConfigurationElement öğesinin içinde ConfigurationElementCollectionmevcut olup olmadığını gösterir.

(Devralındığı yer: ConfigurationElementCollection)
IsElementRemovable(ConfigurationElement)

Belirtilen ConfigurationElement öğesinin öğesinden ConfigurationElementCollectionkaldırılıp kaldırılamayacağını gösterir.

(Devralındığı yer: ConfigurationElementCollection)
IsModified()

Bunun ConfigurationElementCollection , türetilmiş bir sınıfta son kaydedildiğinden veya geçersiz kılındığında yüklendiğinden beri değiştirilip değiştirilmediğini gösterir.

(Devralındığı yer: ConfigurationElementCollection)
IsReadOnly()

Nesnenin ConfigurationElementCollection salt okunur olup olmadığını gösterir.

(Devralındığı yer: ConfigurationElementCollection)
ListErrors(IList)

Bu ConfigurationElement nesnedeki ve tüm alt öğelerdeki invalid-property hatalarını geçirilen listeye ekler.

(Devralındığı yer: ConfigurationElement)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
OnDeserializeUnrecognizedAttribute(String, String)

Seri durumdan çıkarma sırasında bilinmeyen bir öznitelikle karşılaşılıp karşılaşılmadığını belirten bir değer alır.

(Devralındığı yer: ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Yapılandırma sisteminin özel durum oluşturmasına neden olur.

(Devralındığı yer: ConfigurationElementCollection)
OnRequiredPropertyNotFound(String)

Gerekli bir özellik bulunamadığında bir özel durum oluşturur.

(Devralındığı yer: ConfigurationElement)
PostDeserialize()

Seri durumdan çıkarıldıktan sonra çağrılır.

(Devralındığı yer: ConfigurationElement)
PreSerialize(XmlWriter)

Serileştirmeden önce çağrılır.

(Devralındığı yer: ConfigurationElement)
Remove(String)

Bir ExpressionBuilder nesneyi koleksiyondan ExpressionBuilderCollection kaldırır.

RemoveAt(Int32)

Bir ExpressionBuilder nesneyi koleksiyondan ExpressionBuilderCollection kaldırır.

Reset(ConfigurationElement)

türetilmiş bir sınıfta geçersiz kılındığında öğesini değiştirilmemiş durumuna sıfırlar ConfigurationElementCollection .

(Devralındığı yer: ConfigurationElementCollection)
ResetModified()

Türetilmiş bir sınıfta geçersiz kılındığında özelliğinin IsModified() false değerini olarak sıfırlar.

(Devralındığı yer: ConfigurationElementCollection)
SerializeElement(XmlWriter, Boolean)

Türetilmiş bir sınıfta geçersiz kılındığında yapılandırma verilerini yapılandırma dosyasındaki bir XML öğesine yazar.

(Devralındığı yer: ConfigurationElementCollection)
SerializeToXmlElement(XmlWriter, String)

Türetilmiş bir sınıfta uygulandığında bu yapılandırma öğesinin dış etiketlerini yapılandırma dosyasına yazar.

(Devralındığı yer: ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Belirtilen değere bir özellik ayarlar.

(Devralındığı yer: ConfigurationElement)
SetReadOnly()

nesne ve IsReadOnly() ConfigurationElementCollection tüm alt öğeler için özelliğini ayarlar.

(Devralındığı yer: ConfigurationElementCollection)
ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Yapılandırma bilgilerini yapılandırma hiyerarşisinin farklı düzeylerinden birleştirmenin etkisini tersine çevirir.

(Devralındığı yer: ConfigurationElementCollection)

Belirtik Arabirim Kullanımları

ICollection.CopyTo(Array, Int32)

öğesini ConfigurationElementCollection bir diziye kopyalar.

(Devralındığı yer: ConfigurationElementCollection)

Uzantı Metotları

Cast<TResult>(IEnumerable)

öğesinin IEnumerable öğelerini belirtilen türe atar.

OfType<TResult>(IEnumerable)

Bir öğesinin IEnumerable öğelerini belirtilen türe göre filtreler.

AsParallel(IEnumerable)

Sorgunun paralelleştirilmesini sağlar.

AsQueryable(IEnumerable)

bir IEnumerable öğesini öğesine IQueryabledönüştürür.

Şunlara uygulanır

Ayrıca bkz.