This document is archived and information here might be outdated.  Recommended version.


Using the flicker commands (ArcObjects .NET 10.4 SDK)

Using the flicker commands


Summary
This topic describes using the out-of-the box 2D and 3D flicker commands with the ArcGIS Engine controls.

In this topic


Using the 2D flicker commands

To successfully utilize the ControlsMapFlickerCommand on a ToolbarControl buddied to a MapControl, the commands must be used in conjunction with the CommandsEnvironment singleton object and the ControlsLayerListToolControl.
When an end user selects a layer from the ControlsLayerListToolControl, this layer is set to the ILayerEffectProperties.FlickerLayer property on the CommandsEnvironment singleton object. The ControlsMapFlickerCommand uses the ILayerEffectProperties.FlickerLayer property to determine which layer to flicker.
The end user can adjust the rate at which the flicker occurs using the ControlsFlickerRateToolControl. This sets the ILayerEffectProperties.FlickerRate property. See the following screen shot:
Failure to instantiate the CommandsEnvironment singleton object results in the ControlsMapFlickerCommand internally using its own instance of the CommandsEnvironment object and appearing unavailable to the end user.
Do not use the flicker command with the transparency tool.
The following code example assumes a MapControl, ToolbarControl, and LicenseControl have been embedded into a form:
[VB.NET]
Public Class Form1
    
    Private m_CommandsEnvironment As New CommandsEnvironmentClass()
    
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
        'Set buddy control.
        AxToolbarControl1.SetBuddyControl(AxMapControl1)
        
        'Add items to ToolbarControl.
        AxToolbarControl1.AddItem("esriControls.ControlsOpenDocCommand", -1, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsMapFlickerCommand", -1, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsLayerListToolControl", -1, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsFlickerRateToolControl", -1, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
    End Sub
    
End Class
[C#]
public partial class Form1: Form
{
    private CommandsEnvironmentClass m_CommandsEnvironment=new
        CommandsEnvironmentClass();

    private void Form1_Load(object sender, EventArgs e)
    {
        //Set buddy control.
        axToolbarControl1.SetBuddyControl(axMapControl1);
        //Add items to ToolbarControl.
        axToolbarControl1.AddItem("esriControls.ControlsOpenDocCommand",  - 1,  - 1,
            false, 0, esriCommandStyles.esriCommandStyleIconOnly);
        axToolbarControl1.AddItem("esriControls.ControlsMapFlickerCommand",  - 1,  -
            1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
        axToolbarControl1.AddItem("esriControls.ControlsLayerListToolControl",  - 1,
            - 1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
        axToolbarControl1.AddItem("esriControls.ControlsFlickerRateToolControl",  -
            1,  - 1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
    }
}

Using the 3D flicker commands

To successfully utilize the ControlsGlobeFlickerCommand on a ToolbarControl buddied to GlobeControl, the commands must be used in conjunction with the CommandsEnvironment singleton object and the ControlsGlobeLayerListToolControl.
When an end user selects a layer from the ControlsGlobeLayerListToolControl, this layer is set to the ILayerEffectProperties.FlickerLayer property on the CommandsEnvironment singleton object. The ControlsGlobeFlickerCommand uses the ILayerEffectProperties.FlickerLayer property to determine which layer to flicker.
The end user can adjust the rate at which the flicker occurs using the ControlsFlickerRateToolControl. This sets the ILayerEffectProperties.FlickerRate property. See the following screen shot:
Failure to instantiate the CommandsEnvironment singleton object results in the ControlsGlobeFlickerCommand internally using its own instance of the CommandsEnvironment object and appearing unavailable to the end user.
The following code example assumes a GlobeControl, ToolbarControl, and LicenseControl have been embedded into a form:
[VB.NET]
Public Class Form1
    
    Private m_CommandsEnvironment As New CommandsEnvironmentClass
    
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
        'Set buddy control.
        AxToolbarControl1.SetBuddyControl(AxGlobeControl1)
        'Add items to ToolbarControl.
        AxToolbarControl1.AddItem("esriControls.ControlsGlobeOpenDocCommand", -1, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsGlobeFlickerCommand", -1, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsGlobeLayerListToolControl", -1, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        AxToolbarControl1.AddItem("esriControls.ControlsFlickerRateToolControl", -1, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
        
    End Sub
    
End Class
[C#]
public partial class Form1: Form
{
    private CommandsEnvironmentClass m_CommandsEnvironment=new
        CommandsEnvironmentClass();

    private void Form1_Load(object sender, EventArgs e)
    {
        //Set buddy control.
        axToolbarControl1.SetBuddyControl(axGlobeControl1);
        //Add items to ToolbarControl.
        axToolbarControl1.AddItem("esriControls.ControlsGlobeOpenDocCommand",  - 1, 
            - 1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
        axToolbarControl1.AddItem("esriControls.ControlsGlobeFlickerCommand",  - 1, 
            - 1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
        axToolbarControl1.AddItem("esriControls.ControlsGlobeLayerListToolControl", 
            - 1,  - 1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
        axToolbarControl1.AddItem("esriControls.ControlsFlickerRateToolControl",  -
            1,  - 1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
    }
}


See Also:

CommandsEnvironment class
ILayerEffectProperties interface
ControlsMapFlickerCommand class
ControlsGlobeFlickerCommand class
ControlsLayerListToolControl class
ControlsGlobeLayerListToolControl class
ControlsFlickerRateToolControl class
Interacting with singleton objects




To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced