public void RemoveTask(Microsoft.Build.BuildEngine.BuildTask buildTask)
 {
 }
Esempio n. 2
0
 public void RemoveTask(Microsoft.Build.BuildEngine.BuildTask taskElement)
 {
 }
Esempio n. 3
0
        private void AddTask(object sender, RoutedEventArgs e)
        {
            GroupElement groupElement = Targets.SelectedItem as GroupElement;

            if (groupElement != null)
            {
                TargetElement selElm = groupElement.ElementBase as TargetElement;

                if (selElm != null)
                {
                    if (!selElm.IsImported)
                    {
                        AddTaskDialog dialog       = new AddTaskDialog();
                        bool?         dialogResult = dialog.ShowDialog();

                        if (!dialogResult.HasValue)
                        {
                            return;
                        }

                        if (dialogResult.Value)
                        {
                            try
                            {
                                Microsoft.Build.BuildEngine.BuildTask elm = selElm.TargetObject.AddNewTask(dialog.TaskName);

                                elm.Condition = dialog.Condition;

                                if (dialog.TaskParam.Length > 0)
                                {
                                    string[] pList = dialog.TaskParam.Split(',');

                                    foreach (string param in pList)
                                    {
                                        string[] pPart = param.Split('=');

                                        if (pPart.Length == 2)
                                        {
                                            elm.SetParameterValue(pPart[0], pPart[1]);
                                        }
                                    }
                                }
                            }
                            catch (System.Xml.XmlException ex)
                            {
                                ErrorDialog errorMessage = new ErrorDialog(ex.Message);
                                errorMessage.ShowDialog();
                            }
                            catch (ArgumentException ex)
                            {
                                ErrorDialog errorMessage = new ErrorDialog(ex.Message);
                                errorMessage.ShowDialog();
                            }

                            groupElement.Refresh();
                        }
                    }
                }
                else
                {
                    AddTaskBtn.IsEnabled = false;
                }
            }
        }