Ejemplo n.º 1
0
        private string GenerateDescription()
        {
            //Retrieve metadata about the filter
            string messageName;
            string primaryEntity   = txtPrimaryEntity.Text;
            string secondaryEntity = txtSecondaryEntity.Text;

            if (Message == null)
            {
                messageName = txtMessageName.Text;
            }
            else
            {
                messageName = Message.Name;

                if (MessageEntity != null)
                {
                    primaryEntity   = MessageEntity.PrimaryEntity;
                    secondaryEntity = MessageEntity.SecondaryEntity;
                }
            }

            //Retrieve the name of the type
            string typeName;

            if (cmbServiceEndpoint.Visible)
            {
                if (null == cmbServiceEndpoint.SelectedItem)
                {
                    typeName = null;
                }
                else
                {
                    typeName = ((CrmServiceEndpoint)cmbServiceEndpoint.SelectedItem).Name;
                }
            }
            else
            {
                if (null == cmbPlugins.SelectedItem)
                {
                    typeName = null;
                }
                else
                {
                    CrmPlugin plugin = ((CrmPlugin)cmbPlugins.SelectedItem);
                    if (plugin.IsProfilerPlugin)
                    {
                        typeName = "Plug-in Profiler";
                    }
                    else
                    {
                        typeName = ((CrmPlugin)cmbPlugins.SelectedItem).TypeName;
                    }
                }
            }

            return(RegistrationHelper.GenerateStepDescription(typeName, messageName, primaryEntity, secondaryEntity));
        }