Example #1
0
 public static Primitive Generate2DArray(string Database, string SQL)
 {
     Engines.QuerySettings QS = new Engines.QuerySettings
     {
         Database     = Database,
         SQL          = SQL,
         FetchRecords = true,
         User         = GlobalStatic.UserName
     };
     return(Engines.Query(QS));
 }
Example #2
0
        public static void Buttons(string LastButton)
        {
            int StackPointer = Stack.Add($"Handlers.Buttons({LastButton})");

            try
            {
                if (LastButton == UI.Buttons["Search"] || LastButton == UI.Buttons["Sort"] || LastButton == UI.Buttons["RunFunction"])
                {
                    Primitive ASCDESC_Sorts = "1=ASC;2=DESC;3=RANDOM();";
                    bool      Search = false, Sort = true, Function = false;

                    bool.TryParse(LDControls.CheckBoxGetState(GlobalStatic.CheckBox["StrictSearch"]), out bool StrictSearch);
                    bool.TryParse(LDControls.CheckBoxGetState(GlobalStatic.CheckBox["InvertSearch"]), out bool InvertSearch);

                    string SearchIn       = "\"" + Engines.Schema[LDControls.ComboBoxGetSelected(GlobalStatic.ComboBox["Search"])] + "\"";
                    string SearchText     = Controls.GetTextBoxText(UI.TextBox["Search"]).ToString().Replace("'", "''");
                    string FunctionIn     = "\"" + Engines.Schema[LDControls.ComboBoxGetSelected(GlobalStatic.ComboBox["ColumnList"])] + "\"";
                    string FunctionCalled = Engines.Functions(Engines.CurrentEngine)[LDControls.ComboBoxGetSelected(GlobalStatic.ComboBox["FunctionList"]) - 1];

                    string SortBy  = "\"" + Engines.Schema[LDControls.ComboBoxGetSelected(GlobalStatic.ComboBox["Sort"])] + "\"";
                    string ASCDESC = ASCDESC_Sorts[LDControls.ComboBoxGetSelected(GlobalStatic.ComboBox["ASCDESC"])];

                    if (LastButton == UI.Buttons["Search"])
                    {
                        Search = true;
                    }
                    else if (LastButton == UI.Buttons["RunFunction"])
                    {
                        Function = true;
                    }

                    /*
                     * Console.WriteLine();
                     * Console.WriteLine("Search: {0} Sort : {1} Function :{2}", Search, Sort, Function);
                     * Console.WriteLine("Strict Search : {0} Invert Search : {1}", StrictSearch, InvertSearch);
                     * Console.WriteLine("SearchIn : {0} Search Text : {1} FunctionIn : {2} FunctionCalled : {3} SortBy : {4} ASCDESC : {5} LastButton : {6}", SearchIn, SearchText, FunctionIn, FunctionCalled, SortBy, ASCDESC, Controls.GetButtonCaption(LastButton));
                     */
                    var GQS = new Engines.GenerateQuerySettings
                    {
                        //bool
                        Search      = Search,
                        Sort        = Sort,
                        RunFunction = Function,

                        SearchBy = SearchIn,
                        OrderBy  = SortBy,

                        StrictSearch     = StrictSearch,
                        InvertSearch     = InvertSearch,
                        FunctionSelected = FunctionCalled,
                        FunctionColumn   = FunctionIn,
                        SearchText       = SearchText
                    };
                    switch (ASCDESC)
                    {
                    case "ASC":
                        GQS.Order = Engines.GenerateQuerySettings.SortOrder.Ascending;
                        break;

                    case "DESC":
                        GQS.Order = Engines.GenerateQuerySettings.SortOrder.Descding;
                        break;

                    case "RANDOM()":
                        GQS.Order = Engines.GenerateQuerySettings.SortOrder.Random;
                        break;
                    }
                    string Query             = Engines.GenerateQuery(GQS, Engines.CurrentTable.SanitizeFieldName());
                    Engines.QuerySettings QS = new Engines.QuerySettings
                    {
                        Database    = Engines.CurrentDatabase,
                        SQL         = Query,
                        ListView    = GlobalStatic.ListView,
                        User        = GlobalStatic.UserName,
                        Explanation = "Auto Generated Query on behalf of " + GlobalStatic.UserName
                    };

                    Engines.Query(QS);
                }
                else if (LastButton == UI.Buttons["Query"])
                {
                    Engines.Cache.Clear();
                    Engines.QuerySettings QS = new Engines.QuerySettings
                    {
                        Database    = Engines.CurrentDatabase,
                        SQL         = Controls.GetTextBoxText(UI.TextBox["CustomQuery"]),
                        ListView    = GlobalStatic.ListView,
                        User        = GlobalStatic.UserName,
                        Explanation = Language.Localization["User Requested"]
                    };
                    Engines.Query(QS);
                }
                else if (LastButton == UI.Buttons["Command"]) //Custom Command
                {
                    Engines.Cache.Clear();
                    var CS = new Engines.CommandSettings()
                    {
                        Database    = Engines.CurrentDatabase,
                        SQL         = Controls.GetTextBoxText(UI.TextBox["CustomQuery"]),
                        User        = GlobalStatic.UserName,
                        Explanation = Language.Localization["User Requested"]
                    };
                    Engines.Command(CS);
                }
            }
            catch (KeyNotFoundException)
            {
                string Message = Controls.GetButtonCaption(LastButton) + "(" + LastButton + ") |" + UI.Buttons.ContainsKey(LastButton) + "|" + Controls.GetButtonCaption(LastButton) == Language.Localization["Query"].ToUpper() + "| does not exist in context or has not yet implemented.";
                Events.LogMessage(Message, "System");
            }
            Stack.Exit(StackPointer);
        }
Example #3
0
            static void Handler()
            {
                string        LastListBox = LDControls.LastListBox;
                string        LCB         = Controls.LastClickedButton;
                int           Node        = LDControls.ListBoxGetSelected(LastListBox) - 1;
                List <string> CurrentList = null;
                string        Item        = null;

                if (LastListBox == SchemaListBox)
                {
                    CurrentList = Schema;
                }
                else if (LastListBox == XListBox)
                {
                    CurrentList = XColumns;
                }
                else if (LastListBox == YListBox)
                {
                    CurrentList = YColumns;
                }

                if (Node >= 0)
                {
                    Item = CurrentList[Node];
                }

                if (LCB == GenerateChartButton)
                {
                    List <string> Columns = new List <string>();
                    Columns.AddRange(XColumns);
                    Columns.AddRange(YColumns);
                    Dictionary <string, string> Types = new Dictionary <string, string>();
                    for (int i = 1; i <= LDControls.DataViewRowCount(DataView); i++)
                    {
                        Types.Add(LDControls.DataViewGetValue(DataView, i, 1), LDControls.DataViewGetValue(DataView, i, 2));
                    }
                    Engines.QuerySettings QS = new Engines.QuerySettings
                    {
                        Database     = Engines.CurrentDatabase,
                        SQL          = Engines.NonSchemaQuery.Last(),
                        FetchRecords = true,
                        User         = GlobalStatic.UserName,
                        Explanation  = "Generating Chart" //TODO Localize
                    };

                    GenerateChart(Columns, Types, Engines.Query(QS));
                    Clear();
                    GraphicsWindow.ShowMessage("Exported Chart!", "Success");
                }
                else if (LCB == Escape)
                {
                    Clear();
                }
                else if (CurrentList?.Count >= Node)
                {
                    try
                    {
                        if (LCB == Left1)
                        {
                            Schema.RemoveAt(Node);
                            XColumns.Add(Item);
                        }
                        else if (LCB == Right1)
                        {
                            XColumns.RemoveAt(Node);
                            Schema.Add(Item);
                        }
                        else if (LCB == Left2)
                        {
                            YColumns.RemoveAt(Node);
                            Schema.Add(Item);
                        }
                        else if (LCB == Right2)
                        {
                            Schema.RemoveAt(Node);
                            YColumns.Add(Item);
                        }
                    }
                    catch (ArgumentOutOfRangeException ex)
                    {
                        Events.LogMessage(ex.Message, Language.Localization["System"]);
                    }
                }

                if (LCB != Escape)
                {
                    Binder();
                    AutoHide();
                }
            }
Example #4
0
        /// <summary>
        /// Handles Main Menu
        /// </summary>
        /// <param name="Item">Localized Menu Item</param>
        public static void Menu(string Item)
        {
            int StackPointer = Stack.Add($"Handlers.Menu({Item})");

            //Switch and Enum cannot be used because values can change
            //File Menu Items
            if (Item == Language.Localization["New"])
            {
                string Path = LDDialogs.SaveFile(GlobalStatic.Extensions, GlobalStatic.LastFolder);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    GlobalStatic.ListView   = null;
                    GlobalStatic.Dataview   = null;
                    GlobalStatic.LastFolder = System.IO.Path.GetDirectoryName(Path);
                    Settings.Load(GlobalStatic.RestoreSettings, GlobalStatic.SettingsPath);
                    Settings.Save();
                    LDDataBase.ConnectSQLite(Path);
                    Engines.Load.Sqlite(Path);

                    Events.LogMessage("Created DB :" + Path, Language.Localization["Application"]);
                    UI.PreMainMenu();
                    UI.MainMenu();
                    LDDataBase.Connection = null;
                }
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["Open"])
            {
                GlobalStatic.ListView = null;
                GlobalStatic.Dataview = null;
                Settings.Load(GlobalStatic.RestoreSettings, GlobalStatic.SettingsPath); //Reloads Settings
                string Path = UI.GetPath(Engines.EnginesMode.SQLITE);

                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Engines.Load.Sqlite(Path);
                    GlobalStatic.Settings["LastFolder"] = System.IO.Path.GetDirectoryName(Path);
                    Settings.Save();
                    UI.PreMainMenu();
                    UI.MainMenu();

                    int Index = Engines.DB_Name.IndexOf(Engines.CurrentDatabase) + 1;
                    Handlers.ComboBox.CB(GlobalStatic.ComboBox["Database"], Index);
                    LDControls.ComboBoxSelect(GlobalStatic.ComboBox["Database"], Index);
                }
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["Define New Table"])
            {
                Engines.Cache.Clear();
                UI.CreateTableUI();
            }
            else if (Item == Language.Localization["New in Memory Db"])
            {
                Engines.Load.MemoryDB(Engines.EnginesMode.SQLITE);
                UI.PreMainMenu();
                UI.MainMenu();
            }
            else if (Item == Language.Localization["Create Statistics Page"])
            {
                string Name = string.Format("\"Statistics of {0}\"", Engines.CurrentTable.SanitizeFieldName());
                Engines.Transform.CreateStatisticsTable(Engines.CurrentDatabase, Engines.CurrentTable, Name, Export.GenerateSchemaFromLastQuery());

                Engines.QuerySettings QS = new Engines.QuerySettings
                {
                    Database    = Engines.CurrentDatabase,
                    SQL         = $"SELECT * FROM {Name};",
                    ListView    = GlobalStatic.ListView,
                    User        = GlobalStatic.UserName,
                    Explanation = Language.Localization["Statistics Page"]
                };

                Engines.Query(QS);

                Engines.GetSchema(Engines.CurrentDatabase);
                Engines.SetDefaultTable(Name.SanitizeFieldName());
                Engines.GetColumnsofTable(Engines.CurrentDatabase, Name);
                ComboBox.Bind();
            }
            //Main
            else if (Item == Language.Localization["View"] || Item == Language.Localization["View"] + " ")
            {
                Controls.HideControl(GlobalStatic.Dataview);
                GlobalStatic.Dataview = null;
                if (GlobalStatic.ListView == null)
                {
                    bool Bold = GraphicsWindow.FontBold;
                    GraphicsWindow.FontBold = false;
                    GlobalStatic.ListView   = LDControls.AddListView(GlobalStatic.Listview_Width, GlobalStatic.Listview_Height, null);

                    LDControls.AddContextMenu(GlobalStatic.ListView, "1=Ascend;2=Descend;3=Random();", null);
                    Controls.Move(GlobalStatic.ListView, 10, 35);
                    UI.DisplayResults();
                    GraphicsWindow.FontBold = Bold;
                }
                else
                {
                    UI.ShowDisplayResults();
                    Controls.ShowControl(GlobalStatic.ListView);
                }
                if (!string.IsNullOrEmpty(Engines.CurrentTable))
                {
                    Engines.QuerySettings QS = new Engines.QuerySettings
                    {
                        Database    = Engines.CurrentDatabase,
                        SQL         = $"SELECT * FROM {Engines.CurrentTable};",
                        ListView    = GlobalStatic.ListView,
                        User        = Language.Localization["App"],
                        Explanation = Language.Localization["View Function"]
                    };

                    Engines.Query(QS);
                }
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["Save"])
            {
                if (!string.IsNullOrEmpty(Engines.CurrentDatabase) && !string.IsNullOrEmpty(GlobalStatic.Dataview))
                {
                    string SaveStatus = LDDataBase.SaveTable(Engines.CurrentDatabase, GlobalStatic.Dataview);
                    Events.LogMessagePopUp("The save was : " + SaveStatus, Language.Localization["UI"], "Save Status");
                }
                else
                {
                    Events.LogMessagePopUp(Language.Localization["Dataview Error"], Language.Localization["UI"], "Save Error");
                }
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["Edit"])
            {
                if (!string.IsNullOrEmpty(Engines.CurrentDatabase))
                {
                    switch (GlobalStatic.SortBy)
                    {
                    case 2:
                        Events.LogMessagePopUp(Language.Localization["Views Read Only"], Language.Localization["UI"], Language.Localization["Access Denied"]);
                        break;

                    case 4:
                        Events.LogMessagePopUp(Language.Localization["Master Table Protected"], Language.Localization["UI"], Language.Localization["Access Denied"]);
                        break;

                    default:
                        Controls.HideControl(GlobalStatic.ListView);
                        if (String.IsNullOrEmpty(GlobalStatic.Dataview))
                        {
                            GlobalStatic.Dataview = LDControls.AddDataView(GlobalStatic.Listview_Width, GlobalStatic.Listview_Height, null);
                            Controls.Move(GlobalStatic.Dataview, 10, 35);
                        }
                        else
                        {
                            Controls.ShowControl(GlobalStatic.Dataview);
                        }
                        UI.HideDisplayResults();
                        Engines.EditTable(Engines.CurrentTable, GlobalStatic.Dataview);
                        break;
                    }
                }
                else
                {
                    Events.LogMessagePopUp(Language.Localization["Error No DB"], Language.Localization["UI"], Language.Localization["Edit"]);
                }
                Stack.Exit(StackPointer);
                return;
            }
            //Import
            else if (Item == Language.Localization["CSV"])
            {
                string Path = LDDialogs.OpenFile("csv", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    //Outputted to a temporary path in the event the import doesn't work...
                    string    TempPath = System.IO.Path.GetTempFileName().Replace(".tmp", ".sql");
                    Stopwatch CSV      = new Stopwatch();
                    CSV.Start();
                    Import.CSV(Path, TempPath);
                    CSV.Stop();

                    Stopwatch SQL = new Stopwatch();
                    SQL.Start();
                    Import.SQL(Engines.CurrentDatabase, TempPath);
                    SQL.Stop();

                    string ToolTip = string.Format("CSV Import Completed!\n CSV:{0}(ms)\nSQL:{1}(ms)",
                                                   CSV.ElapsedMilliseconds,
                                                   SQL.ElapsedMilliseconds);
                    Events.LogMessagePopUp(ToolTip, Language.Localization["UI"], Language.Localization["Importer"]); //TODO Localize

                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Import.CSV");//TODO Localize
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["SQL"])
            {
                string Path = LDDialogs.OpenFile("sql", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Stopwatch SQL = new Stopwatch();
                    SQL.Start();
                    Import.SQL(Engines.CurrentDatabase, Path);
                    SQL.Stop();
                    Events.LogMessagePopUp("SQL Import Completed in " + SQL.ElapsedMilliseconds + "(ms)", Language.Localization["UI"], Language.Localization["Importer"]); //TODO Localize
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Import.SQL");//TODO Localize
                Stack.Exit(StackPointer);
                return;
            }
            //Export
            else if (Item == Language.Localization["PXML"] + " ")
            {
                string Path = LDDialogs.SaveFile("xml", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Primitive Data = Export.Generate2DArrayFromLastQuery();
                    Export.XML(Data, Export.GenerateSchemaFromQueryData(Data), Engines.CurrentTable, Path);
                    Events.LogMessagePopUp("XML export of " + Engines.CurrentTable + " completed!", "Export", "Success");
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Export.XML");//TODO Localize
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["HTML"] + " ")
            {
                string Path = LDDialogs.SaveFile("html", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Primitive Data = Export.Generate2DArrayFromLastQuery();
                    Export.HTML(Data, Export.GenerateSchemaFromQueryData(Data), Engines.CurrentTable.SanitizeFieldName(), Path, GlobalStatic.ProductID + " V" + GlobalStatic.VersionID);
                    Events.LogMessagePopUp("HTML export of " + Engines.CurrentTable + " completed!", Language.Localization["Export"], Language.Localization["Success"]);
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Export.HTML");//TODO Localize
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["SQL"] + " ")
            {
                string Path = LDDialogs.SaveFile("sql", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Primitive Data   = Export.Generate2DArrayFromLastQuery();
                    Primitive Schema = Export.GenerateSchemaFromQueryData(Data);
                    Primitive SchemaQuery;
                    switch (Engines.CurrentEngine)
                    {
                    case Engines.EnginesMode.SQLITE:
                        Engines.SQLite SQLite = new Engines.SQLite();

                        Engines.QuerySettings QS = new Engines.QuerySettings
                        {
                            Database     = Engines.CurrentDatabase,
                            SQL          = SQLite.GetColumnsOfTable(Engines.CurrentTable),
                            FetchRecords = true,
                            User         = GlobalStatic.UserName,
                            Explanation  = "SCHEMA"
                        };

                        SchemaQuery = Engines.Query(QS);
                        break;

                    default:
                        throw new PlatformNotSupportedException("Currently database is not supported");
                    }
                    Dictionary <string, bool>   PK    = Export.SQL_Fetch_PK(SchemaQuery, Schema, Engines.CurrentEngine);
                    Dictionary <string, string> Types = Export.SQL_Fetch_Type(SchemaQuery, Schema, Engines.CurrentEngine);
                    Export.SQL(Data, Schema, PK, Types, Engines.CurrentTable, Path);
                    LDProcess.Start(Path, null);
                    Events.LogMessagePopUp("SQL export of " + Engines.CurrentTable + " completed!", Language.Localization["Export"], Language.Localization["Success"]); //TODO Localize
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Export.SQL");//TODO Localize
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["CSV"] + " ")
            {
                string Path = LDDialogs.SaveFile("csv", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Primitive Data = Export.Generate2DArrayFromLastQuery();
                    Export.CSV(Data, Export.GenerateSchemaFromQueryData(Data), Path, GlobalStatic.Deliminator);
                    Events.LogMessagePopUp("CSV export of " + Engines.CurrentTable + " completed!", Language.Localization["Export"], Language.Localization["Success"]); //TODO Localize
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Export.CSV");//TODO Localize
                Stack.Exit(StackPointer);
            }
            else if (Item == "JSON") //TODO Localize
            {
                string Path = LDDialogs.SaveFile("json", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Primitive Data = Export.Generate2DArrayFromLastQuery();
                    Export.JSON(Data, Export.GenerateSchemaFromQueryData(Data), Engines.CurrentTable.SanitizeFieldName(), Path);
                    Events.LogMessagePopUp("JSON export of " + Engines.CurrentTable + " completed!", Language.Localization["Export"], Language.Localization["Success"]); //TODO Localize
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Export.JSON");//TODO Localize
                Stack.Exit(StackPointer);
            }
            else if (Item == "MarkDown") //TODO Localize
            {
                string Path = LDDialogs.SaveFile("md", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Primitive Data = Export.Generate2DArrayFromLastQuery();
                    Export.MarkDown(Data, Export.GenerateSchemaFromQueryData(Data), Path);
                    Events.LogMessagePopUp("MarkDown export is now complete", Language.Localization["Export"], Language.Localization["Success"]); //TODO Localize
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Export.MarkDown");//TODO Localize
                Stack.Exit(StackPointer);
            }
            else if (Item == "Wiki MarkUp") //TODO Localize
            {
                string Path = LDDialogs.SaveFile("markup", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Primitive Data = Export.Generate2DArrayFromLastQuery();
                    Export.MarkUp(Data, Export.GenerateSchemaFromQueryData(Data), Path);
                    Events.LogMessagePopUp("Wiki Markup export is now complete", Language.Localization["Export"], Language.Localization["Success"]); //TODO Localize
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Export.Wiki Markup");//TODO Localize
                Stack.Exit(StackPointer);
            }
            else if (Item == "Excel") //TODO Localize
            {
                string Path = LDDialogs.SaveFile("xlsx", null);
                if (!string.IsNullOrWhiteSpace(Path))
                {
                    Primitive Data = Export.Generate2DArrayFromLastQuery();
                    //Export.Excel(Data, Export.GenerateSchemaFromQueryData(Data), Engines.CurrentTable, Path);
                    Events.LogMessagePopUp("Excel export is now complete", Language.Localization["Export"], Language.Localization["Success"]); //TODO Localize
                    Stack.Exit(StackPointer);
                    return;
                }
                Events.LogMessagePopUp(Language.Localization["Error Generic"], Language.Localization["UI"], "Export.Excel Markup");//TODO Localize
                Stack.Exit(StackPointer);
            }
            //Settings
            else if (Item == Language.Localization["About"])
            {
                Engines.QuerySettings QS = new Engines.QuerySettings
                {
                    Database     = Engines.CurrentDatabase,
                    SQL          = "SELECT SQLITE_VERSION(),sqlite_source_id();",
                    FetchRecords = true,
                    User         = GlobalStatic.UserName,
                    Explanation  = Language.Localization["User Requested"] + ":" + Language.Localization["App"]
                };

                Primitive About_Data = Engines.Query(QS);
                string    About_Msg  = string.Format("DBM C# is a Database Mangement Program developed by Abhishek Sathiabalan. (C){0}. All rights reserved.\n\nYou are running : {1} v{2}\n\n", GlobalStatic.Copyright, GlobalStatic.ProductID, GlobalStatic.VersionID);
                About_Msg += string.Format("SQLite Version : {0}\nSQLITE Source ID : {1}", About_Data[1]["SQLITE_VERSION()"], About_Data[1]["sqlite_source_id()"]);
                Events.LogMessagePopUp(About_Msg, "Debug", "About");//DO NOT LOCALIZE
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["Show Help"])
            {
                string Path = System.IO.Path.Combine(GlobalStatic.AssetPath, "HELP Table.html");
                LDProcess.Start(Path, null);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["Settings Editor"])
            {
                UI.Settings.Display();
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["Refresh Schema"])
            {
                Engines.GetSchema(Engines.CurrentDatabase);
                Engines.GetColumnsofTable(Engines.CurrentDatabase, Engines.CurrentTable);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == Language.Localization["Check for Updates"])
            {
                Updater.CheckForUpdates(GlobalStatic.UpdaterDBpath);
                Stack.Exit(StackPointer);
                return;
            }
            //Charts
            else if (Item == "Bar") //TODO Localize
            {
                Google_Charts.Chart.Bar Bar = new Google_Charts.Chart.Bar();
                UI.Charts.Display(Bar);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Column") //TODO Localize
            {
                Google_Charts.Chart.Column Column = new Google_Charts.Chart.Column();
                UI.Charts.Display(Column);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Geo") //TODO Localize
            {
                Google_Charts.Chart.GeoCharts Geo = new Google_Charts.Chart.GeoCharts();
                UI.Charts.Display(Geo);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Histogram") //TODO Localize
            {
                Google_Charts.Chart.Histograms Histo = new Google_Charts.Chart.Histograms();
                UI.Charts.Display(Histo);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Line") //TODO Localize
            {
                Google_Charts.Chart.Line Line = new Google_Charts.Chart.Line();
                UI.Charts.Display(Line);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Org") //TODO Localize
            {
                Google_Charts.Chart.OrgChart Org = new Google_Charts.Chart.OrgChart();
                UI.Charts.Display(Org);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Pie") //TODO: Localize
            {
                Google_Charts.Chart.Pie Pie = new Google_Charts.Chart.Pie();
                UI.Charts.Display(Pie);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Sankey") //TODO Localize
            {
                Google_Charts.Chart.SanKey SanKey = new Google_Charts.Chart.SanKey();
                UI.Charts.Display(SanKey);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Scatter Plot") //TODO Localize
            {
                Google_Charts.Chart.Scatter Scatter = new Google_Charts.Chart.Scatter();
                UI.Charts.Display(Scatter);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "Sortable Table") //TODO Localize
            {
                Google_Charts.Chart.Table Table = new Google_Charts.Chart.Table();
                UI.Charts.Display(Table);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item == "TimeLine") //TODO Localize
            {
                Google_Charts.Chart.TimeLine TL = new Google_Charts.Chart.TimeLine();
                UI.Charts.Display(TL);
                Stack.Exit(StackPointer);
                return;
            }
            else if (Item != null)
            {
                Events.LogMessage(Item + " does not exist in context or is not yet implemented", Language.Localization["UI"]);
            }
            Stack.Exit(StackPointer);
        }