public AddAttributeActionWizard(AddAttributeAction fixedAddAttributeAction) { InitializeComponent(); if (fixedAddAttributeAction != null) { m_fixedAddAttributeAction = fixedAddAttributeAction; m_assembly = m_fixedAddAttributeAction.AssemblyName; m_selectedAttribute = m_fixedAddAttributeAction.TypeName; m_ctor = m_fixedAddAttributeAction.Constructor; m_value = m_fixedAddAttributeAction.Data; } }
public IAction Create(Dictionary <string, string> parameters) { AddAttributeAction addAttributeAction = new AddAttributeAction(); if (parameters.ContainsKey(ParameterAssemblyName)) { addAttributeAction.AssemblyName = parameters[ParameterAssemblyName]; } else { throw new NoActionParameterException(ActionName, ParameterAssemblyName); } if (parameters.ContainsKey(ParameterTypeName)) { addAttributeAction.TypeName = parameters[ParameterTypeName]; } else { throw new NoActionParameterException(ActionName, ParameterTypeName); } if (parameters.ContainsKey(ParameterConstructor)) { addAttributeAction.Constructor = parameters[ParameterConstructor]; } else { throw new NoActionParameterException(ActionName, ParameterConstructor); } if (parameters.ContainsKey(ParameterData)) { addAttributeAction.Data = parameters[ParameterData]; } else { throw new NoActionParameterException(ActionName, ParameterData); } return(addAttributeAction); }
public IAction Create() { AddAttributeAction addAttributeAction = new AddAttributeAction(); return(addAttributeAction); }
private bool DoAddAttributeActionWizard(AddAttributeAction action) { AddAttributeActionWizard addAttributeActionWizard; if (action != null && action.IsInitialized) addAttributeActionWizard = new AddAttributeActionWizard(action); else addAttributeActionWizard = new AddAttributeActionWizard(); DialogResult dialogResult = addAttributeActionWizard.ShowDialog(); if (dialogResult == DialogResult.OK) { action.AssemblyName = addAttributeActionWizard.SelectedAssembly; action.TypeName = addAttributeActionWizard.SelectedAttribute; action.Constructor = addAttributeActionWizard.Constructor; action.Data = addAttributeActionWizard.AttributeValue; action.IsInitialized = true; return true; } return false; }
public IAction Create(Dictionary<string, string> parameters) { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); var addAttributeAction = new AddAttributeAction(); if (parameters.ContainsKey(ParameterAssemblyName)) { addAttributeAction.AssemblyName = parameters[ParameterAssemblyName]; } else { throw new NoActionParameterException(ActionName, ParameterAssemblyName); } if (parameters.ContainsKey(ParameterTypeName)) { addAttributeAction.TypeName = parameters[ParameterTypeName]; } else { throw new NoActionParameterException(ActionName, ParameterTypeName); } if (parameters.ContainsKey(ParameterConstructor)) { addAttributeAction.Constructor = parameters[ParameterConstructor]; } else { throw new NoActionParameterException(ActionName, ParameterConstructor); } if (parameters.ContainsKey(ParameterData)) { addAttributeAction.Data = parameters[ParameterData]; } else { throw new NoActionParameterException(ActionName, ParameterData); } return addAttributeAction; }
public IAction Create() { var addAttributeAction = new AddAttributeAction(); return addAttributeAction; }