Beispiel #1
0
        private void deleteRawAttributeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String strSelectedAttribute = treeViewSolutionExplorer.SelectedNode.Text;

            if (MessageBox.Show(this, "Deleting an attribute cannot be undone, continue with DELETING Atttribute:" + strSelectedAttribute + "?", "Delete attribute Confirmation", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            // Create a transaction to delete the attribute and then remove it from the solution explorer list.
            try
            {
                DeleteAttribute deleteAttribute = new DeleteAttribute(strSelectedAttribute);
                deleteAttribute.DeleteFromImageView();
                if (treeViewSolutionExplorer.SelectedNode.Tag != null)
                {
                    object[] parameters = (object[])treeViewSolutionExplorer.SelectedNode.Tag;
                    if (parameters[0] != null)
                    {
                        BaseForm form = (BaseForm)parameters[0];
                        if (form != null)
                        {
                            form.Close();
                        }
                    }
                }

                treeViewSolutionExplorer.SelectedNode.Remove();
            }
            catch (Exception exc)
            {
                OutputWindow.WriteOutput("Error: Could not delete attribute table. " + exc.Message);
                return;
            }
        }
        public void DeleteAttribute()
        {
            var attribute = new DeleteAttribute("foo");
            var route     = attribute.BuildRoute(null);

            route.Pattern.ShouldBe("foo");
            route.AllowedHttpMethods.ShouldHaveTheSameElementsAs("DELETE");
        }
Beispiel #3
0
        public void RouteShouldReturnTheRoutePassedInToTheConstructor()
        {
            const string Route = "example/route";

            var attribute = new DeleteAttribute(Route);

            Assert.That(attribute.Route, Is.EqualTo(Route));
        }
        public IApiResult Delete(DeleteAttribute operation)
        {
            var result = operation.ExecuteAsync().Result;

            if (result is ValidationsOutput)
            {
                return(new ApiResult <List <ValidationItem> >()
                {
                    Data = ((ValidationsOutput)result).Errors
                });
            }
            else
            {
                return(new ApiResult <object>()
                {
                    Status = ApiResult <object> .ApiStatus.Success
                });
            }
        }
Beispiel #5
0
        public void VerbShouldReturnDELETE()
        {
            var attribute = new DeleteAttribute(string.Empty);

            Assert.That(attribute.Verb, Is.EqualTo("DELETE"));
        }