Exemple #1
0
        protected virtual void Drop()
        {
            // Confirm the deletion
            Frontend.Client.Windows.IWindowsFormInterface form =
                Dataphoria.FrontendSession.LoadForm
                (
                    null,
                    ".Frontend.Form('Frontend', 'DropDependents')"
                );
            try
            {
                Frontend.Client.ISource source = (Frontend.Client.ISource)form.FindNode("Dependents");
                source.Expression =
                    String.Format
                    (
                        @"	
							DependentObjects('{0}')
								over {{ Level, Sequence, Object_Description }}
								rename {{ Object_Description Description }}
								order by {{ Level desc, Sequence }}
						"                        ,
                        ObjectName
                    );
                source.Enabled = true;
                if (form.ShowModal(Frontend.Client.FormMode.Query) != DialogResult.OK)
                {
                    throw new AbortException();
                }
            }
            finally
            {
                form.HostNode.Dispose();
            }

            // Emit and execute the drop script
            using (DAE.Runtime.Data.Scalar script = (DAE.Runtime.Data.Scalar)Dataphoria.EvaluateQuery(GetScriptDropExpression()))
                Dataphoria.ExecuteScript(script.AsString);

            ParentList.Refresh();
        }