DesignerTransactionとは? わかりやすく解説

DesignerTransaction クラス

パフォーマンス向上し、ほとんどの変更内容元に戻せるようにするために、デザイン時の一連の操作グループ化する手段提供します

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

Public MustInherit Class
 DesignerTransaction
    Implements IDisposable
Dim instance As DesignerTransaction
public abstract class DesignerTransaction :
 IDisposable
public ref class DesignerTransaction abstract
 : IDisposable
public abstract class DesignerTransaction implements
 IDisposable
public abstract class DesignerTransaction implements
 IDisposable
解説解説

トランザクション使用すると、後で元に戻せるように操作追跡できますトランザクション実行中に行った変更は、トランザクションキャンセルすることによって元に戻すことができます。この操作では、変更された各プロパティ変更前の値を設定することにより、それぞれの変更自動的に元に戻す処理が試行されます。また、トランザクション使用すると、画面への更新トランザクション完了まで遅らせることによって、一連の操作実行している間のパフォーマンス向上することもできます

トランザクション進行中に、TransactionOpening イベントと TransactionClosed イベント待機することで、そのトランザクション完了するまで処理を延期するコンポーネントあります。たとえば、[プロパティ] ウィンドウの表示は、トランザクション開始されてから終了するまでは更新されません。

トランザクション使用して操作元に戻せるようにしたり、複数操作実行したりするには、元に戻せるようにする各操作または一連の操作ごとに、デザイナDesignerTransaction作成します一連の "元に戻す" イベント正常に機能しなくなる可能性があるアクショントランザクション外部実行しないように注意してください

IDesignerHost の CreateTransaction メソッド呼び出すと、新しDesignerTransaction取得できますデザイナトランザクション処理機構正しく統合するためには、新しDesignerTransaction直接作成するではなくアクティブIDesignerHost から各 DesignerTransaction取得してください

トランザクション内で操作実行するには、最初にトランザクション作成する必要があります次にそれぞれの変更または変更セットが起こる前に OnComponentChanging メソッド呼び出しそれぞれの変更または変更セット起こった後に OnComponentChanged メソッド呼び出す必要があります最後にCommit メソッド呼び出してトランザクション完了し閉じてください

メモメモ

プロパティの値を変更する場合は、PropertyDescriptor の SetValue メソッド使用します。このメソッドは、IComponentChangeService のコンポーネント変更メソッド呼び出し変更を表す DesignerTransaction自動的に作成します

トランザクション実行するには、次の手順実行します

  1. CreateTransaction呼び出しトランザクション制御するために使用できる DesignerTransaction取得します

  2. try ブロック内で、DesignerTransaction追跡するアクションごとに OnComponentChanging メソッド呼び出し変更行った後でOnComponentChanged メソッド呼び出して変更が行われたことを通知します

  3. トランザクション完了するには、finally ブロック内から Commit呼び出します。

C# では、次の例で示すように、try/finally ブロックではなく using ステートメント使用できます

 using (host.CreateTransaction() {
 // Insert your code here.
 }

トランザクションコミットされる前にキャンセルしてロールバック試行するには、Cancel メソッド呼び出します。Cancel メソッド呼び出されると、DesignerTransaction追跡していたアクション元に戻され変更内容をすべて元に戻す操作試行されます。以前トランザクション一部として実行され操作元に戻すには、開発環境用意されている元に戻すコマンド使用する必要があります

メモメモ

このクラス適用される HostProtectionAttribute 属性Resources プロパティの値は、SharedState です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的にはアイコンダブルクリックコマンド入力、またはブラウザURL入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラストピックまたは「SQL Server プログラミングホスト保護属性」を参照してください

使用例使用例

デザイナから DesignerTransaction作成するコード例次に示しますデザイナは、必要に応じてデザイナトランザクション イベントに関する通知表示できます。このサンプル実行するには、ソース コードクラス ライブラリコンパイルし、コンパイル済みDLL への参照プロジェクト追加してライブラリ内のコンポーネントを [ツールボックス] に追加します

Visual Studio には、この機能拡張サポートあります

詳細については、「 チュートリアル : ツールボックスへのカスタム コンポーネント自動設定」を参照してください

デザイン モードDTComponentインスタンスフォーム追加すると、デザイナトランザクション イベント通知を受け受け取かどうか確認するメッセージ ボックス表示されます。DTComponentインスタンス右クリックすると表示されるショートカット メニュー使用して、これらの通知切り替えることができます。[プロパティ] ウィンドウ使用して値を変更すると、トランザクション作成されます。コンポーネントショートカット メニューの [トランザクション例を実行する] をクリックすることで、デザイナトランザクション実行することもできます

Imports System
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Windows.Forms
Imports System.Windows.Forms.Design

'   This sample demonstrates how to perform a series of actions in a
 designer 
'   transaction, how to change values of properties of a component from
 a 
'   designer, and how to complete transactions without being interrupted
 
'   by other activities.

'   To run this sample, add this code to a class library project and
 compile. 
'   Create a new Windows Forms project or load a form in the designer.
 Add a 
'   reference to the class library that was compiled in the first step.
'   Right-click the Toolbox in design mode and click Customize Toolbox.
  
'   Browse to the class library that was compiled in the first step
 and 
'   select OK until the DTComponent item appears in the Toolbox.  Add
 an 
'   instance of this component to the form.  

'   When the component is created and added to the component tray for
 your
'   design project, the Initialize method of the designer is called.
 
'   This method displays a message box informing you that designer transaction
'   event handlers are being registered unless you click Cancel. When
 you set 
'   properties in the properties window, each change will be encapsulated
 in 
'   a designer transaction, allowing the change to be undone later.
  

'   When you right-click the component, the shortcut menu for the component
 
'   is displayed. The designer constructs this menu according to whether
 
'   designer transaction notifications are enabled, and offers the option
'   of enabling or disabling the notifications, depending on the current
 
'   mode. The shortcut menu also presents a Perform Example Transaction
 
'   item which will set the values of the component's StringProperty
 and 
'   CountProperty properties. You can undo the last designer transaction
 using 
'   the Undo command provided by the Visual Studio development environment.
    

Namespace DesignerTransactionSample

    ' Associate the DTDesigner with this component
    <DesignerAttribute(GetType(DTDesigner))> _
    Public Class DTComponent
        Inherits System.ComponentModel.Component
        Private m_String As String
        Private m_Count As Integer

        Public Property StringProperty() As
 String
            Get
                Return m_String
            End Get
            Set(ByVal Value As
 String)
                m_String = Value
            End Set
        End Property

        Public Property CountProperty() As
 Integer
            Get
                Return m_Count
            End Get
            Set(ByVal Value As
 Integer)
                m_Count = Value
            End Set
        End Property

        Private Sub InitializeComponent()
            m_String = "Initial Value"
            m_Count = 0
        End Sub 'InitializeComponent

    End Class 'DTComponent

    Friend Class DTDesigner
        Inherits ComponentDesigner

        Private notification_mode As Boolean
 = False
        Private count As Integer
 = 10

        ' The Verbs property is overridden from ComponentDesigner
        Public Overrides ReadOnly
 Property Verbs() As DesignerVerbCollection
            Get
                Dim dvc As New
 DesignerVerbCollection()
                dvc.Add(New DesignerVerb("Perform
 Example Transaction", AddressOf Me.DoTransaction))
                If notification_mode Then
                    dvc.Add(New DesignerVerb("End
 Designer Transaction Notifications", AddressOf Me.UnlinkDTNotifications))
                Else
                    dvc.Add(New DesignerVerb("Show
 Designer Transaction Notifications", AddressOf Me.LinkDTNotifications))
                End If
                Return dvc
            End Get
        End Property

        Public Overrides Sub
 Initialize(ByVal component As System.ComponentModel.IComponent)
            MyBase.Initialize(component)

            Dim host As IDesignerHost = CType(GetService(GetType(IDesignerHost)),
 IDesignerHost)
            If host Is Nothing
 Then
                MessageBox.Show("The IDesignerHost service interface
 could not be obtained.")
                Return
            End If

            If MessageBox.Show("Press the Yes
 button to display notification message boxes for the designer transaction opened
 and closed notifications.", "Link DesignerTransaction Notifications?", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
 MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign) = DialogResult.Yes Then
                AddHandler host.TransactionOpened, AddressOf
 OnDesignerTransactionOpened
                AddHandler host.TransactionClosed, AddressOf
 OnDesignerTransactionClosed
                notification_mode = True
            End If
        End Sub 'Initialize

        Private Sub LinkDTNotifications(ByVal
 sender As Object, ByVal
 e As EventArgs)
            If notification_mode = False Then
                Dim host As IDesignerHost = CType(GetService(GetType(IDesignerHost)),
 IDesignerHost)
                If Not (host Is
 Nothing) Then
                    notification_mode = True
                    AddHandler host.TransactionOpened, AddressOf
 OnDesignerTransactionOpened
                    AddHandler host.TransactionClosed, AddressOf
 OnDesignerTransactionClosed
                End If
            End If
        End Sub 'LinkDTNotifications

        Private Sub UnlinkDTNotifications(ByVal
 sender As Object, ByVal
 e As EventArgs)
            If notification_mode Then
                Dim host As IDesignerHost = CType(GetService(GetType(IDesignerHost)),
 IDesignerHost)
                If Not (host Is
 Nothing) Then
                    notification_mode = False
                    RemoveHandler host.TransactionOpened, AddressOf
 Me.OnDesignerTransactionOpened
                    RemoveHandler host.TransactionClosed, AddressOf
 Me.OnDesignerTransactionClosed
                End If
            End If
        End Sub 'UnlinkDTNotifications

        Private Sub OnDesignerTransactionOpened(ByVal
 sender As Object, ByVal
 e As EventArgs)
            System.Windows.Forms.MessageBox.Show("A Designer Transaction
 was started. (TransactionOpened)")
        End Sub 'OnDesignerTransactionOpened

        Private Sub OnDesignerTransactionClosed(ByVal
 sender As Object, ByVal
 e As DesignerTransactionCloseEventArgs)
            System.Windows.Forms.MessageBox.Show("A Designer Transaction
 was completed. (TransactionClosed)")
        End Sub 'OnDesignerTransactionClosed

        Private Sub DoTransaction(ByVal
 sender As Object, ByVal
 e As EventArgs)
            Dim host As IDesignerHost = CType(GetService(GetType(IDesignerHost)),
 IDesignerHost)
            Dim t As DesignerTransaction =
 host.CreateTransaction("Change Text and Size")

            ' The code within the using statement is considered to be
 a single transaction.
            ' When the user selects Undo, the system will undo everything
 executed in this code block. 
            Try
                If (notification_mode) Then
                    System.Windows.Forms.MessageBox.Show("Entering
 a Designer-Initiated Designer Transaction")
                End If

                Dim someText As PropertyDescriptor
 = TypeDescriptor.GetProperties(Component)("StringProperty")
                someText.SetValue(Component, "This text was set
 by the designer for this component.")
                Dim anInteger As PropertyDescriptor
 = TypeDescriptor.GetProperties(Component)("CountProperty")
                anInteger.SetValue(Component, count)
                count = count + 1

                Exit Try
            Finally
                t.Commit()                
            End Try
            If (notification_mode) Then
                System.Windows.Forms.MessageBox.Show("Designer-Initiated
 Designer Transaction Completed")
            End If
        End Sub 'DoTransaction

        Protected Overloads Overrides
 Sub Dispose(ByVal disposing As
 Boolean)
            UnlinkDTNotifications(Me, New EventArgs())
            MyBase.Dispose(disposing)
        End Sub 'Dispose

    End Class 'DTDesigner
End Namespace 'DesignerTransactionSample
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;

/*
    This sample demonstrates how to perform a series of actions in
 a designer 
    transaction, how to change values of properties of a component from a 
    designer, and how to complete transactions without being interrupted 
    by other activities.

    To run this sample, add this code to a
 class library project and compile. 
    Create a new Windows Forms project or load a form in
 the designer. Add a 
    reference to the class library that was compiled in
 the first step.
    Right-click the Toolbox in design mode and click Customize
 Toolbox.  
    Browse to the class library that was compiled in
 the first step and 
    select OK until the DTComponent item appears in the Toolbox.
  Add an 
    instance of this component to the form.  
    
    When the component is created and added to the component tray for
 your
    design project, the Initialize method of the designer is called. 
    This method displays a message box informing you that designer transaction
    event handlers will be registered unless you click Cancel. When you set
 
    properties in the properties window, each change will be encapsulated
 in 
    a designer transaction, allowing the change to be undone later.  
    
    When you right-click the component,    the shortcut menu for
 the component 
    is displayed. The designer constructs this menu according
 to whether 
    designer transaction notifications are enabled, and offers the option
    of enabling or disabling the notifications, depending on the current 
    mode. The shortcut menu also presents a Perform Example Transaction 
    item, which will set the values of the component's StringProperty
 and 
    CountProperty properties. You can undo the last designer transaction using
 
    the Undo command provided by the Visual Studio development environment.
*/

namespace DesignerTransactionSample
{
    // Associate the DTDesigner with this component
    [DesignerAttribute(typeof(DTDesigner))]
    public class DTComponent : System.ComponentModel.Component
    {
        private string m_String;
    private int m_Count;
            
    public string StringProperty
    {
        get
            { return m_String; }
        set
        { m_String = value; }
    }
            
    public int CountProperty
    {
        get
        { return m_Count; }
        set
        { m_Count = value; }
    }

    private void InitializeComponent()
    {
        m_String = "Initial Value";
        m_Count = 0;
    }
    }
    
    internal class DTDesigner : ComponentDesigner
    {
    private bool notification_mode = false;
    private int count = 10;
        
    // The Verbs property is overridden from ComponentDesigner
    public override DesignerVerbCollection Verbs
    {
        get
        {                
            DesignerVerbCollection dvc = new DesignerVerbCollection();
                
        dvc.Add( new DesignerVerb("Perform Example Transaction",
 new EventHandler(this.DoTransaction)) );
        if(notification_mode)
            dvc.Add(new DesignerVerb("End Designer Transaction
 Notifications", new EventHandler(this.UnlinkDTNotifications)));
        else
            dvc.Add(new DesignerVerb("Show Designer Transaction
 Notifications", new EventHandler(this.LinkDTNotifications)));
                return dvc;
        }
    }
        
        public override void Initialize(System.ComponentModel.IComponent
 component)
        {
            base.Initialize(component);

            IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
            
            if(host == null)
            {
                MessageBox.Show("The IDesignerHost service interface could not
 be obtained.");
                return;
            }

            if( MessageBox.Show("Press the Yes button to
 display notification message boxes for the designer transaction
 opened and closed notifications.","Link DesignerTransaction Notifications?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
 MessageBoxOptions.RightAlign) == DialogResult.Yes )
            {                            
            host.TransactionOpened += new EventHandler(OnDesignerTransactionOpened);
                host.TransactionClosed += new DesignerTransactionCloseEventHandler(OnDesignerTransactionClosed);
                notification_mode = true;
            }
        }
        
        private void LinkDTNotifications(object
 sender, EventArgs e)
        {
            if(notification_mode == false)
            {
            IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
                            
                if(host != null)
            {
            notification_mode = true;
                   host.TransactionOpened += new EventHandler(OnDesignerTransactionOpened);
                   host.TransactionClosed += new DesignerTransactionCloseEventHandler(OnDesignerTransactionClosed);
            }
        }
        }

        private void UnlinkDTNotifications(object
 sender, EventArgs e)
        {
        if(notification_mode)
            {
                IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
                            
            if(host != null)
                {                
            notification_mode = false;
                    host.TransactionOpened -= new EventHandler(OnDesignerTransactionOpened);
                    host.TransactionClosed -= new DesignerTransactionCloseEventHandler(OnDesignerTransactionClosed);
                }
            }
        }

        private void OnDesignerTransactionOpened(object
 sender, EventArgs e)
        {            
        System.Windows.Forms.MessageBox.Show("A Designer Transaction was started.
 (TransactionOpened)");
        }

        private void OnDesignerTransactionClosed(object
 sender, DesignerTransactionCloseEventArgs e)
        {            
        System.Windows.Forms.MessageBox.Show("A Designer Transaction was completed.
 (TransactionClosed)");
        }   

        private void DoTransaction(object sender,
 EventArgs e) 
        {            
            IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));
            
            DesignerTransaction t = host.CreateTransaction("Change Text and
 Size");

            /* The code within the using statement is considered
 to be a single transaction.
           When the user selects Undo, the system will undo everything executed in
 this code block. */
            using (t)
            {
            if(notification_mode)
                System.Windows.Forms.MessageBox.Show("Entering a Designer-Initiated
 Designer Transaction");
                
                // The .NET Framework automatically associates the TypeDescriptor
 with the correct component
            PropertyDescriptor someText = TypeDescriptor.GetProperties(Component)["StringProperty"];
                someText.SetValue(Component, "This text was set
 by the designer for this component.");

                PropertyDescriptor anInteger = TypeDescriptor.GetProperties(Component)["CountProperty"];
            anInteger.SetValue(Component, count);
            count++;

                // Complete the designer transaction.
            t.Commit();
                
            if(notification_mode)
                System.Windows.Forms.MessageBox.Show("Designer-Initiated Designer
 Transaction Completed");
            }
        }
        
    protected override void Dispose(bool
 disposing)
    {
        UnlinkDTNotifications(this, new EventArgs());
        base.Dispose(disposing);
    }
    }
}
#using <system.dll>
#using <system.design.dll>
#using <system.windows.forms.dll>

using namespace System;
using namespace System::ComponentModel;
using namespace System::ComponentModel::Design;
using namespace System::Windows::Forms;
using namespace System::Windows::Forms::Design;

/*
This sample demonstrates how to perform a series of actions in
 a designer
transaction, how to change values of properties of a component from a
designer, and how to complete transactions without being interrupted
by other activities.

To run this sample, add this code to a class
 library project and compile.
Create a new Windows Forms project or load a form in
 the designer. Add a
reference to the class library that was compiled in
 the first step.
Right-click the Toolbox in design mode and click Customize Toolbox.
Browse to the class library that was compiled in
 the first step and
select OK until the DTComponent item appears in the Toolbox. 
 Add an
instance of this component to the form.

When the component is created and added to the component tray for
 your
design project, the Initialize method of the designer is called.
This method displays a message box informing you that designer transaction
event handlers will be registered unless you click Cancel. When you set
properties in the properties window, each change will be encapsulated
 in
a designer transaction, allowing the change to be undone later.

When you right-click the component, the shortcut menu for the
 component
is displayed. The designer constructs this menu according to whether
designer transaction notifications are enabled, and offers the option
of enabling or disabling the notifications, depending on the current
mode. The shortcut menu also presents a Perform Example Transaction
item, which will set the values of the component's StringProperty
 and
CountProperty properties. You can undo the last designer transaction using
the Undo command provided by the Visual Studio development environment.
*/

private ref class DTDesigner: public
 ComponentDesigner
{
private:
   bool notification_mode;
   int count;
   void LinkDTNotifications( Object^ /*sender*/, EventArgs^ /*e*/
 )
   {
      if (  !notification_mode )
      {
         IDesignerHost^ host = dynamic_cast<IDesignerHost^>(GetService( IDesignerHost::typeid
 ));
         if ( host != nullptr )
         {
            notification_mode = true;
            host->TransactionOpened += gcnew EventHandler( this,
 &DTDesigner::OnDesignerTransactionOpened );
            host->TransactionClosed += gcnew DesignerTransactionCloseEventHandler(
 this, &DTDesigner::OnDesignerTransactionClosed );
         }
      }
   }

   void UnlinkDTNotifications( Object^ /*sender*/, EventArgs^
 /*e*/ )
   {
      if ( notification_mode )
      {
         IDesignerHost^ host = dynamic_cast<IDesignerHost^>(GetService( IDesignerHost::typeid
 ));
         if ( host != nullptr )
         {
            notification_mode = false;
            host->TransactionOpened -= gcnew EventHandler( this,
 &DTDesigner::OnDesignerTransactionOpened );
            host->TransactionClosed -= gcnew DesignerTransactionCloseEventHandler(
 this, &DTDesigner::OnDesignerTransactionClosed );
         }
      }
   }

   void OnDesignerTransactionOpened( Object^ /*sender*/, EventArgs^
 /*e*/ )
   {
      MessageBox::Show( "A Designer Transaction was started. (TransactionOpened)"
 );
   }

   void OnDesignerTransactionClosed( Object^ /*sender*/, DesignerTransactionCloseEventArgs^
 /*e*/ )
   {
      MessageBox::Show( "A Designer Transaction was completed. (TransactionClosed)"
 );
   }

   void DoTransaction( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      IDesignerHost^ host = static_cast<IDesignerHost^>(GetService( IDesignerHost::typeid
 ));
      DesignerTransaction^ t = host->CreateTransaction( "Change Text and
 Size" );
      
      /* The code within the using statement is considered to
 be a single transaction.
              When the user selects Undo, the system will undo everything executed
 in this code block.
              */
      if ( notification_mode )
            MessageBox::Show( "Entering a Designer-Initiated Designer Transaction"
 );

      // The .NET Framework automatically associates the TypeDescriptor
 with the correct component
      PropertyDescriptor^ someText = TypeDescriptor::GetProperties( Component )[
 "StringProperty" ];
      someText->SetValue( Component, "This text was set
 by the designer for this component."
 );
      PropertyDescriptor^ anInteger = TypeDescriptor::GetProperties( Component )[
 "CountProperty" ];
      anInteger->SetValue( Component, count );
      count++;

      // Complete the designer transaction.
      t->Commit();
      if ( notification_mode )
            MessageBox::Show( "Designer-Initiated Designer Transaction Completed"
 );
   }

public:
   property DesignerVerbCollection^ Verbs 
   {
      // The Verbs property is overridden from ComponentDesigner
      virtual DesignerVerbCollection^ get() override
      {
         DesignerVerbCollection^ dvc = gcnew DesignerVerbCollection;
         dvc->Add( gcnew DesignerVerb( "Perform Example Transaction",gcnew
 EventHandler( this, &DTDesigner::DoTransaction ) ) );
         if ( notification_mode )
                  dvc->Add( gcnew DesignerVerb( "End Designer Transaction
 Notifications",
                     gcnew EventHandler( this, &DTDesigner::UnlinkDTNotifications
 ) ) );
         else
                  dvc->Add( gcnew DesignerVerb( "Show Designer Transaction
 Notifications",
                     gcnew EventHandler( this, &DTDesigner::LinkDTNotifications
 ) ) );

         return dvc;
      }
   }
   virtual void Initialize( IComponent^ component ) override
   {
      ComponentDesigner::Initialize( component );
      notification_mode = false;
      count = 10;
      IDesignerHost^ host = dynamic_cast<IDesignerHost^>(GetService( IDesignerHost::typeid
 ));
      if ( host == nullptr )
      {
         MessageBox::Show( "The IDesignerHost service interface could not be
 obtained." );
         return;
      }

      if ( MessageBox::Show( "Press the Yes button to display
 notification message boxes for the designer transaction opened
 and closed notifications.", "Link DesignerTransaction Notifications?", MessageBoxButtons::YesNo, MessageBoxIcon::Question, MessageBoxDefaultButton::Button1,
 MessageBoxOptions::RightAlign ) == DialogResult::Yes )
      {
         host->TransactionOpened += gcnew EventHandler( this,
 &DTDesigner::OnDesignerTransactionOpened );
         host->TransactionClosed += gcnew DesignerTransactionCloseEventHandler(
 this, &DTDesigner::OnDesignerTransactionClosed );
         notification_mode = true;
      }
   }

public:
   ~DTDesigner()
   {
      UnlinkDTNotifications( this, gcnew EventArgs );
   }
};

// Associate the DTDesigner with this component

[DesignerAttribute(DTDesigner::typeid)]
public ref class DTComponent: public
 System::ComponentModel::Component
{
private:
   String^ m_String;
   int m_Count;
   void InitializeComponent()
   {
      m_String = "Initial Value";
      m_Count = 0;
   }

public:
   property String^ StringProperty 
   {
      String^ get()
      {
         return m_String;
      }

      void set( String^ value )
      {
         m_String = value;
      }
   }

   property int CountProperty 
   {
      int get()
      {
         return m_Count;
      }

      void set( int value
 )
      {
         m_Count = value;
      }
   }
};
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
  System.ComponentModel.Design.DesignerTransaction
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DesignerTransaction メンバ
System.ComponentModel.Design 名前空間
IDesignerHost
IComponentChangeService
PropertyDescriptor クラス

DesignerTransaction コンストラクタ ()


DesignerTransaction コンストラクタ (String)

トランザクション説明指定して、DesignerTransaction クラス新しインスタンス初期化します。

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

解説解説
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DesignerTransaction クラス
DesignerTransaction メンバ
System.ComponentModel.Design 名前空間

DesignerTransaction コンストラクタ

DesignerTransaction クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
DesignerTransaction () 説明指定せずに DesignerTransaction クラス新しインスタンス初期化します。
DesignerTransaction (String) トランザクション説明指定してDesignerTransaction クラス新しインスタンス初期化します。
参照参照

関連項目

DesignerTransaction クラス
DesignerTransaction メンバ
System.ComponentModel.Design 名前空間

DesignerTransaction プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

DesignerTransaction クラス
System.ComponentModel.Design 名前空間
IDesignerHost
IComponentChangeService
PropertyDescriptor クラス

DesignerTransaction メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
明示的インターフェイスの実装明示的インターフェイス実装
  名前 説明
インターフェイスの明示的な実装 System.IDisposable.Dispose DesignerTransaction によって使用されているすべてのリソース解放します。
参照参照

関連項目

DesignerTransaction クラス
System.ComponentModel.Design 名前空間
IDesignerHost
IComponentChangeService
PropertyDescriptor クラス

DesignerTransaction メンバ

パフォーマンス向上し、ほとんどの変更内容元に戻せるようにするために、デザイン時の一連の操作グループ化する手段提供します

DesignerTransaction データ型公開されるメンバを以下の表に示します


プロテクト コンストラクタプロテクト コンストラクタ
  名前 説明
プロテクト メソッド DesignerTransaction オーバーロードされます。 DesignerTransaction クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
明示的インターフェイスの実装明示的インターフェイス実装
  名前 説明
インターフェイスの明示的な実装 System.IDisposable.Dispose DesignerTransaction によって使用されているすべてのリソース解放します。
参照参照

関連項目

DesignerTransaction クラス
System.ComponentModel.Design 名前空間
IDesignerHost
IComponentChangeService
PropertyDescriptor クラス



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

辞書ショートカット

すべての辞書の索引

「DesignerTransaction」の関連用語

DesignerTransactionのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS