ArcObjects Library Reference  

FrmBisectorRule

About the Implementing the ISchematicRulesHelper to easily develop a custom schematic rule Sample

[C#]

FrmBisectorRule.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using ESRI.ArcGIS.Framework;

namespace CustomRulesPageCS
{
    public partial class FrmBisectorRule : Form
    {
        private bool m_isDirty = false;
        private IComPropertyPageSite m_pageSite;

        public FrmBisectorRule()
        {
            InitializeComponent();
        }

        ~FrmBisectorRule()
        {
            m_pageSite = null;
        }

        // For managing the IsDirty flag that specifies whether 
        // or not controls in the custom form have been modified
        public bool IsDirty
        {
            get
            {
                return m_isDirty;
            }
            set
            {
                m_isDirty = value;
            }
        }

        //- For managing the related IComPropertyPageSite
        public IComPropertyPageSite PageSite
        {
            set
            {
                m_pageSite = value;
            }
        }

        private void Changed(object sender, System.EventArgs e)
        {
            // If the user changes something, mark the custom form; dirty and 
            // enable the apply button on the page site via the PageChanged method
            m_isDirty = true;

            if (m_pageSite != null)
            {
                m_pageSite.PageChanged();
            }
        }

    }
}

[Visual Basic .NET]

FrmBisectorRule.vb

Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms


Friend Class FrmBisectorRule
    Private m_isDirty As Boolean = False
    Private m_pageSite As ESRI.ArcGIS.Framework.IComPropertyPageSite

    Public Sub New()
        InitializeComponent()
    End Sub

    Protected Overrides Sub Finalize()
        m_pageSite = Nothing
        MyBase.Finalize()
    End Sub

    ' For managing the IsDirty flag that specifies whether 
    ' or not controls in the custom form have been modified
    Public Property IsDirty() As Boolean
        Get
            Return m_isDirty
        End Get
        Set(ByVal value As Boolean)
            m_isDirty = value
        End Set
    End Property

    '- For managing the related IComPropertyPageSite
    Public WriteOnly Property PageSite() As ESRI.ArcGIS.Framework.IComPropertyPageSite
        Set(ByVal value As ESRI.ArcGIS.Framework.IComPropertyPageSite)
            m_pageSite = value
        End Set
    End Property

    Private Sub Changed(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtDescription.TextChanged, txtDistance.TextChanged, cmbTargetNodeClass.SelectedIndexChanged, cmbTargetNodeClass.Click, cmbTargetLinkClass.SelectedIndexChanged, cmbTargetLinkClass.Click, cmbParentNodeClass.SelectedIndexChanged, cmbParentNodeClass.Click
        ' If the user changes something, mark the custom form dirty and 
        ' enable the apply button on the page site via the PageChanged method
        m_isDirty = True
        If (m_pageSite IsNot Nothing) Then m_pageSite.PageChanged()
    End Sub

End Class