public override void Execute(object parameter)
        {
            ExtensionBehavior extensionBehavior = parameter as ExtensionBehavior;

            if (extensionBehavior == null)
            {
                return;
            }

            ISupportsConfiguration supportConfiguration = extensionBehavior.MapBehavior as ISupportsConfiguration;

            if (supportConfiguration != null)
            {
                try
                {
                    supportConfiguration.Configure();
                }
                catch (Exception ex)
                {
                    if (ViewerApplicationControl.Instance == null)
                    {
                        MessageBoxDialog.Show(LocalizableStrings.GetString("BehaviorConfigurationFailedDescription"), LocalizableStrings.GetString("BehaviorConfigurationFailed"), MessageBoxButton.OK);
                    }
                    else
                    {
                        NotificationPanel.Instance.AddNotification(LocalizableStrings.GetString("BehaviorConfigurationFailed"), LocalizableStrings.GetString("BehaviorConfigurationFailedDescription"), ex.ToString(), MessageType.Warning);
                    }
                }
            }
        }
        private void btnConfigure_Click(object sender, RoutedEventArgs e)
        {
            // Instantiate control
            ToolInstance = ToolInstance ?? Activator.CreateInstance(ToolType);

            // Get the "supports configuration" interface in order to invoke the configure method.
            ISupportsConfiguration supportsConfiguration = ToolInstance as ISupportsConfiguration;

            if (supportsConfiguration != null)
            {
                supportsConfiguration.Configure();
            }
        }
Exemple #3
0
        public override void Execute(object parameter)
        {
            ConfigureControlDataItem ccdi = parameter as ConfigureControlDataItem;

            if (ccdi != null)
            {
                ISupportsConfiguration supportsConfig = ccdi.Element as ISupportsConfiguration;
                if (supportsConfig != null)
                {
                    supportsConfig.Configure();
                }
            }
        }