CultureInfo.IsReadOnly プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CultureInfo.IsReadOnly プロパティの意味・解説 

CultureInfo.IsReadOnly プロパティ

現在の CultureInfo が読み取り専用かどうかを示す値を取得します

名前空間: System.Globalization
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Dim instance As CultureInfo
Dim value As Boolean

value = instance.IsReadOnly
public bool IsReadOnly { get;
 }
public:
property bool IsReadOnly {
    bool get ();
}
/** @property */
public boolean get_IsReadOnly ()

プロパティ
現在の CultureInfo読み取り専用場合trueそれ以外場合false既定値false です。

解説解説

CultureInfo読み取り専用場合、DateTimeFormat のインスタンスと NumberFormat のインスタンス読み取り専用です。

使用例使用例

次のコード例は、IsReadOnly が、CultureInfo関連付けられている DateTimeFormatInfo インスタンスと NumberFormatInfo インスタンス保護することを示してます。

Imports System
Imports System.Globalization


Public Class SamplesCultureInfo

   Public Shared Sub Main()
      
      ' Creates a CultureInfo.
      Dim myCI As New CultureInfo("en-US")
      
      ' Creates a read-only CultureInfo based on myCI.
      Dim myReadOnlyCI As CultureInfo = CultureInfo.ReadOnly(myCI)
      
      ' Display the read-only status of each CultureInfo and their DateTimeFormat
 and NumberFormat properties.
      If myCI.IsReadOnly Then 
         Console.WriteLine("myCI is read only.")
      Else
         Console.WriteLine("myCI is writable.")
      End If

      If myCI.DateTimeFormat.IsReadOnly Then
 
         Console.WriteLine("myCI.DateTimeFormat is read only.")
      Else
         Console.WriteLine("myCI.DateTimeFormat is writable.")
      End If

      If myCI.NumberFormat.IsReadOnly Then
 
         Console.WriteLine("myCI.NumberFormat is read only.")
      Else
         Console.WriteLine("myCI.NumberFormat is writable.")
      End If

      If myReadOnlyCI.IsReadOnly Then 
         Console.WriteLine("myReadOnlyCI is read only.")
      Else
         Console.WriteLine("myReadOnlyCI is writable.")
      End If

      If myReadOnlyCI.DateTimeFormat.IsReadOnly Then
 
         Console.WriteLine("myReadOnlyCI.DateTimeFormat is read
 only.")
      Else
         Console.WriteLine("myReadOnlyCI.DateTimeFormat is writable.")
      End If

      If myReadOnlyCI.NumberFormat.IsReadOnly Then
 
         Console.WriteLine("myReadOnlyCI.NumberFormat is read
 only.")
      Else
         Console.WriteLine("myReadOnlyCI.NumberFormat is writable.")
      End If

   End Sub 'Main 

End Class 'SamplesCultureInfo


' This code produces the following output.
'
' myCI is writable.
' myCI.DateTimeFormat is writable.
' myCI.NumberFormat is writable.
' myReadOnlyCI is read only.
' myReadOnlyCI.DateTimeFormat is read only.
' myReadOnlyCI.NumberFormat is read only.
using System;
using System.Globalization;


public class SamplesCultureInfo  {

   public static void Main()
  {

      // Creates a CultureInfo.
      CultureInfo myCI = new CultureInfo( "en-US" );

      // Creates a read-only CultureInfo based on myCI.
      CultureInfo myReadOnlyCI = CultureInfo.ReadOnly( myCI );

      // Display the read-only status of each CultureInfo and their
 DateTimeFormat and NumberFormat properties.
      Console.WriteLine( "myCI is {0}.", myCI.IsReadOnly ? "read only"
 : "writable" );
      Console.WriteLine( "myCI.DateTimeFormat is {0}.", myCI.DateTimeFormat.IsReadOnly
 ? "read only" : "writable" );
      Console.WriteLine( "myCI.NumberFormat is {0}.", myCI.NumberFormat.IsReadOnly
 ? "read only" : "writable" );
      Console.WriteLine( "myReadOnlyCI is {0}.", myReadOnlyCI.IsReadOnly
 ? "read only" : "writable" );
      Console.WriteLine( "myReadOnlyCI.DateTimeFormat is {0}.", myReadOnlyCI.DateTimeFormat.IsReadOnly
 ? "read only" : "writable" );
      Console.WriteLine( "myReadOnlyCI.NumberFormat is {0}.", myReadOnlyCI.NumberFormat.IsReadOnly
 ? "read only" : "writable" );

   }

}

/*
This code produces the following output.

myCI is writable.
myCI.DateTimeFormat is writable.
myCI.NumberFormat is writable.
myReadOnlyCI is read only.
myReadOnlyCI.DateTimeFormat is read only.
myReadOnlyCI.NumberFormat is read only.

*/
using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Creates a CultureInfo.
   CultureInfo^ myCI = gcnew CultureInfo( "en-US" );
   
   // Creates a read-only CultureInfo based on myCI -> 
   CultureInfo^ myReadOnlyCI = CultureInfo::ReadOnly( myCI );
   
   // Display the read-only status of each CultureInfo and their DateTimeFormat
 and NumberFormat properties.
   Console::WriteLine( "myCI is {0}.", myCI->IsReadOnly ? (String^)"read
 only" : "writable" );
   Console::WriteLine( "myCI -> DateTimeFormat is {0}.", myCI->DateTimeFormat->IsReadOnly
 ? (String^)"read only" : "writable" );
   Console::WriteLine( "myCI -> NumberFormat is {0}.", myCI->NumberFormat->IsReadOnly
 ? (String^)"read only" : "writable" );
   Console::WriteLine( "myReadOnlyCI is {0}.", myReadOnlyCI->IsReadOnly
 ? (String^)"read only" : "writable" );
   Console::WriteLine( "myReadOnlyCI -> DateTimeFormat is {0}.", myReadOnlyCI->DateTimeFormat->IsReadOnly
 ? (String^)"read only" : "writable" );
   Console::WriteLine( "myReadOnlyCI -> NumberFormat is {0}.", myReadOnlyCI->NumberFormat->IsReadOnly
 ? (String^)"read only" : "writable" );
}

/*
This code produces the following output.

myCI is writable.
myCI -> DateTimeFormat is writable.
myCI -> NumberFormat is writable.
myReadOnlyCI is read only.
myReadOnlyCI -> DateTimeFormat is read only.
myReadOnlyCI -> NumberFormat is read only.
*/
import System.* ;
import System.Globalization.* ;

public class SamplesCultureInfo
{
    public static void main(String[]
 args)
    {
        // Creates a CultureInfo.
        CultureInfo myCI =  new CultureInfo("en-US");

        // Creates a read-only CultureInfo based on myCI.
        CultureInfo myReadOnlyCI = CultureInfo.ReadOnly(myCI);

        // Display the read-only status of each CultureInfo and their
 
        // DateTimeFormat and NumberFormat properties.
        Console.WriteLine("myCI is {0}.",
            (myCI.get_IsReadOnly() ) ? "read only" : "writable");
        Console.WriteLine("myCI.DateTimeFormat is {0}.",
            (myCI.get_DateTimeFormat().get_IsReadOnly()) ? 
            "read only" : "writable");
        Console.WriteLine("myCI.NumberFormat is {0}.",(
            myCI.get_NumberFormat().get_IsReadOnly()) ? 
            "read only" : "writable");
        Console.WriteLine("myReadOnlyCI is {0}.",
            (myReadOnlyCI.get_IsReadOnly()) ? "read only" : "writable");
        Console.WriteLine("myReadOnlyCI.DateTimeFormat is {0}.",
            (myReadOnlyCI.get_DateTimeFormat().get_IsReadOnly()) ? 
            "read only" : "writable");
        Console.WriteLine("myReadOnlyCI.NumberFormat is {0}.",
            (myReadOnlyCI.get_NumberFormat().get_IsReadOnly()) ? 
            "read only" : "writable");
    } //main 
} //SamplesCultureInfo

/*
This code produces the following output.

myCI is writable.
myCI.DateTimeFormat is writable.
myCI.NumberFormat is writable.
myReadOnlyCI is read only.
myReadOnlyCI.DateTimeFormat is read only.
myReadOnlyCI.NumberFormat is read only.
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

CultureInfo.IsReadOnly プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CultureInfo.IsReadOnly プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS