SharedPropertyGroupManager クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SharedPropertyGroupManager クラスの意味・解説 

SharedPropertyGroupManager クラス

共有プロパティ グループへのアクセス制御します。このクラス継承できません。

名前空間: System.EnterpriseServices
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)
構文構文

<ComVisibleAttribute(False)> _
Public NotInheritable Class
 SharedPropertyGroupManager
    Implements IEnumerable
Dim instance As SharedPropertyGroupManager
[ComVisibleAttribute(false)] 
public sealed class SharedPropertyGroupManager
 : IEnumerable
[ComVisibleAttribute(false)] 
public ref class SharedPropertyGroupManager
 sealed : IEnumerable
/** @attribute ComVisibleAttribute(false) */ 
public final class SharedPropertyGroupManager
 implements IEnumerable
ComVisibleAttribute(false) 
public final class SharedPropertyGroupManager
 implements IEnumerable
使用例使用例

SharedPropertyGroupManager 使用して共有プロパティ作成管理を行う方法次の例に示します

Imports System
Imports System.EnterpriseServices
Imports System.Reflection

<Assembly: ApplicationName("ReceiptNumberGenerator")>
 
<Assembly: ApplicationActivation(ActivationOption.Library)> 
 

Public Class ReceiptNumberGeneratorClass
    
    ' Generates a new receipt number based on the receipt number
    ' stored by the Shared Property Manager (SPM)
    Public Function GetNextReceiptNumber()
 As Integer 
        Dim groupExists, propertyExists As
 Boolean
        Dim nextReceiptNumber As Integer
 = 0
        Dim lockMode As PropertyLockMode =
 PropertyLockMode.SetGet
        Dim releaseMode As PropertyReleaseMode
 = PropertyReleaseMode.Standard
        
        ' Create a shared property group manager.
        Dim groupManager As New
 SharedPropertyGroupManager()

        ' Create a shared property group.
        Dim group As SharedPropertyGroup =
 groupManager.CreatePropertyGroup("Receipts", lockMode,
 releaseMode, groupExists)
        ' Create a shared property.
        Dim ReceiptNumber As SharedProperty
        ReceiptNumber = group.CreateProperty("ReceiptNumber",
 propertyExists)

        ' Retrieve the value from shared property, and increment the
 shared 
        ' property value.
        nextReceiptNumber = Fix(ReceiptNumber.Value)
        ReceiptNumber.Value = nextReceiptNumber + 1

        ' Return nextReceiptNumber
        Return nextReceiptNumber
    
    End Function 'GetNextReceiptNumber

End Class 'ReceiptNumberGeneratorClass
using System;
using System.EnterpriseServices;
using System.Reflection;


[assembly: ApplicationName("ReceiptNumberGenerator")] 
[assembly: ApplicationActivation(ActivationOption.Library)] 

public class ReceiptNumberGeneratorClass
{
    // Generates a new receipt number based on the receipt number
    // stored by the Shared Property Manager (SPM)
    public int GetNextReceiptNumber() 
    {
        bool groupExists,propertyExists;
        int nextReceiptNumber = 0;
        PropertyLockMode lockMode = PropertyLockMode.SetGet;
        PropertyReleaseMode releaseMode = PropertyReleaseMode.Standard;

        // Create a shared property group manager.
        SharedPropertyGroupManager groupManager = new SharedPropertyGroupManager();
        // Create a shared property group.
        SharedPropertyGroup group = groupManager.CreatePropertyGroup("Receipts"
,
                                   ref lockMode, ref releaseMode, out groupExists);
        // Create a shared property.
        SharedProperty ReceiptNumber;
        ReceiptNumber = group.CreateProperty("ReceiptNumber",out propertyExists);
        // Retrieve the value from shared property, and increment the
 shared 
        // property value.
        nextReceiptNumber = (int) ReceiptNumber.Value;
        ReceiptNumber.Value = nextReceiptNumber + 1;
        // Return nextReceiptNumber
        return nextReceiptNumber;
            
    }
}
#using <System.EnterpriseServices.dll>

using namespace System;
using namespace System::EnterpriseServices;
using namespace System::Reflection;

[assembly:AssemblyKeyFile("..\\common\\key.snk")];
[assembly:ApplicationName("ReceiptNumberGenerator")];
[assembly:ApplicationActivation(ActivationOption::Library)];

public ref class ReceiptNumberGeneratorClass
{
public:

   // Generates a new receipt number based on the receipt number
   // stored by the Shared Property Manager (SPM)
   int GetNextReceiptNumber()
   {
      bool groupExists;
      bool propertyExists;
      int nextReceiptNumber = 0;
      PropertyLockMode lockMode = PropertyLockMode::SetGet;
      PropertyReleaseMode releaseMode = PropertyReleaseMode::Standard;
      
      // Create a shared property group manager.
      SharedPropertyGroupManager^ groupManager = gcnew SharedPropertyGroupManager;

      // Create a shared property group.
      SharedPropertyGroup^ group =
         groupManager->CreatePropertyGroup( "Receipts",  lockMode, 
 releaseMode,  groupExists );

      // Create a shared property.
      SharedProperty^ ReceiptNumber;
      ReceiptNumber = group->CreateProperty( "ReceiptNumber",  propertyExists
 );

      // Retrieve the value from shared property, and increment the
 shared 
      // property value.
      nextReceiptNumber =  safe_cast<int>(ReceiptNumber->Value);
      ReceiptNumber->Value = nextReceiptNumber + 1;

      // Return nextReceiptNumber
      return nextReceiptNumber;
   }
};
import System.*;
import System.EnterpriseServices.*;
import System.Reflection.*;

/** @assembly AssemblyKeyFile("key.snk")
 */
/** @assembly ApplicationName("ReceiptNumberGenerator")
 */
/** @assembly ApplicationActivation(ActivationOption.Library)
 */

public class ReceiptNumberGeneratorClass
{
    // Generates a new receipt number based on the receipt number
    // stored by the Shared Property Manager (SPM)
    public int GetNextReceiptNumber()
    {
        boolean groupExists = false;
        boolean propertyExists = false;
        int nextReceiptNumber = 0;
        PropertyLockMode lockMode = PropertyLockMode.SetGet;
        PropertyReleaseMode releaseMode = PropertyReleaseMode.Standard;

        // Create a shared property group manager.
        SharedPropertyGroupManager groupManager =
            new SharedPropertyGroupManager();

        // Create a shared property group.
        SharedPropertyGroup group = groupManager.CreatePropertyGroup("Receipts"
,
            lockMode, releaseMode, groupExists);

        // Create a shared property.
        SharedProperty receiptNumber;
        receiptNumber = group.CreateProperty("receiptNumber", propertyExists);

        // Retrieve the value from shared property, and increment the
 shared 
        // property value.
        nextReceiptNumber = System.Convert.ToInt32(receiptNumber.get_Value());
        receiptNumber.set_Value((Int32)(nextReceiptNumber + 1));

        // Return nextReceiptNumber
        return nextReceiptNumber;
    } //GetNextReceiptNumber 
} //ReceiptNumberGeneratorClass
継承階層継承階層
System.Object
  System.EnterpriseServices.SharedPropertyGroupManager
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「SharedPropertyGroupManager クラス」の関連用語

SharedPropertyGroupManager クラスのお隣キーワード
検索ランキング

   

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



SharedPropertyGroupManager クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS