SetAutoOff() public method

public SetAutoOff ( bool off ) : void
off bool
return void
Beispiel #1
0
        protected override void OnUpdate()
        {
            if (m_schematicTarget == null)
            {
                IExtension        extention = null;
                IExtensionManager extensionManager;

                extensionManager = (IExtensionManager)m_application;
                for (int i = 0; i < extensionManager.ExtensionCount; i++)
                {
                    extention = extensionManager.get_Extension(i);
                    if (extention.Name.ToLower() == "esri schematic extension")
                    {
                        break;
                    }
                }

                if (extention != null)
                {
                    SchematicExtension schematicExtension = extention as SchematicExtension;
                    m_schematicTarget = schematicExtension as ISchematicTarget;
                }
            }

            if (m_schematicTarget != null)
            {
                ISchematicLayer schematicLayer;
                schematicLayer = m_schematicTarget.SchematicTarget;

                if (schematicLayer == null)
                {
                    Enabled = false;
                    if (m_formAuto != null)
                    {
                        m_formAuto.SetAutoOff(true);
                    }
                }
                else if (schematicLayer.IsEditingSchematicDiagram())
                {
                    Enabled = true;
                }
                else
                {
                    Enabled = false;
                    if (m_formAuto != null)
                    {
                        m_formAuto.SetAutoOff(true);
                    }
                }
            }
            else
            {
                Enabled = false;
                if (m_formAuto != null)
                {
                    m_formAuto.SetAutoOff(true);
                }
            }
        }