private void PropertyMapperDialog_Shown(object sender, EventArgs e)
        {
            CodeParameter2 fromParameter = m_currentMethod.Parameters.Item(1) as CodeParameter2;
            string         returnType    = m_currentMethod.Type.AsFullName;
            string         fromType      = fromParameter.Type.AsFullName;

            lblFromClass.Text = fromType;
            lblToClass.Text   = returnType;
            try
            {
                InitListView(lstFromProperties, CodeModelUtils.GetPropertiesFromType(fromParameter.Type.CodeType));
            }
            catch (NotImplementedException)
            {
                AddInUtils.ShowError("The method parameter '" + fromParameter.Type.AsString + "' could not be found in the code model.  Please be sure the type exists and the project has been successfully built.");
                this.DialogResult = DialogResult.Cancel;
            }
            try
            {
                InitListView(lstToProperties, CodeModelUtils.GetPropertiesFromType(m_currentMethod.Type.CodeType));
            }
            catch (NotImplementedException)
            {
                AddInUtils.ShowError("The method return type '" + m_currentMethod.Type.AsString + "' could not be found in the code model.  Please be sure the type exists and the project has been successfully built.");
                this.DialogResult = DialogResult.Cancel;
            }

            //InitTreeView(treeView1, CodeModelUtils.GetPropertiesFromType(fromParameter.Type.CodeType));
            RefreshView();
            if (m_addInSettings.PropertyMapperAutoMapOnOpen)
            {
                AutoMap();
            }
        }
Beispiel #2
0
 public TestStatus RunFix()
 {
     if (!HasFix)
     {
         return(TestStatus.Error);
     }
     try
     {
         this.PerformFix();
         return(RunTest());
     }
     catch (Exception e)
     {
         AddInUtils.ShowError("The fix was not able to complete: " + e.Message);
     }
     return(TestStatus.Error);
 }