コード例 #1
0
ファイル: Node.cs プロジェクト: laszlo-kiss/Dataphor
        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();
        }
コード例 #2
0
        public void Analyze()
        {
            PrepareForExecute();

            string plan;
            var    errors = new ErrorList();

            try
            {
                using (var statusForm = new StatusForm(Strings.ProcessingQuery))
                {
                    DateTime startTime = DateTime.Now;
                    try
                    {
                        var paramsValue = new DataParams();
                        paramsValue.Add(DataParam.Create(Dataphoria.UtilityProcess, "AQuery", GetTextToExecute()));
                        plan = ((DAE.Runtime.Data.Scalar)Dataphoria.EvaluateQuery("ShowPlan(AQuery)", paramsValue)).AsString;
                    }
                    finally
                    {
                        TimeSpan elapsed = DateTime.Now - startTime;
                        _executionTimeStatus.Text = elapsed.ToString();
                    }
                }
            }
            catch (Exception exception)
            {
                errors.Add(exception);
                ProcessErrors(errors);
                SetStatus(Strings.ScriptAnalyzeFailed);
                return;
            }

            SetStatus(Strings.ScriptAnalyzeSuccessful);

            var analyzer = (Analyzer.Analyzer)Dataphoria.OpenDesigner(Dataphoria.GetDefaultDesigner("pla"), null);

            analyzer.LoadPlan(plan);
        }
コード例 #3
0
 public override string LoadData()
 {
     return(((IScalar)Dataphoria.EvaluateQuery(String.Format(".System.Debug.GetSource('{0}')", Locator.Locator.Replace("'", "''")))).AsString);
 }