Esempio n. 1
0
        public override bool SaveAs()
        {
            string name = InputBox.Run(Texts.Get("s_enter_object_name"), "new_table");

            if (name != null)
            {
                try
                {
                    ISpecificObjectStructure newStructure = CreateStructure(new NameWithSchema(name));

                    if (m_conn.DatabaseCaps.ExecuteSql)
                    {
                        string sql = Dialect.GenerateScript(dmp => { dmp.CreateSpecificObject(newStructure); });
                        if (!SqlConfirmForm.Run(sql, Dialect))
                        {
                            return(false);
                        }
                    }

                    m_conn.CreateObject(newStructure);
                    if (m_pars != null && m_pars.SavedCallback != null)
                    {
                        m_pars.SavedCallback();
                    }
                    m_obj = m_conn.InvokeLoadSpecificObjectDetail(newStructure.ObjectType, newStructure.ObjectName);
                    FillFromStructure();
                    UpdateTitle();
                    return(true);
                }
                catch (Exception err)
                {
                    Errors.Report(err);
                }
            }
            return(false);
        }
Esempio n. 2
0
 private static string TranslateText(string text)
 {
     return(Texts.Get(text));
 }
Esempio n. 3
0
 public void UpdateTitle()
 {
     Text = Texts.Get(m_factory.MenuTitle);
 }
Esempio n. 4
0
 protected override string GetConfirmDeleteMessage()
 {
     return(Texts.Get("s_really_delete$folder", "folder", Folder.ToString("F")));
 }
Esempio n. 5
0
 protected virtual string GetConfirmDeleteMessage()
 {
     return(Texts.Get("s_really_delete$object", "object", ToString()));
 }
Esempio n. 6
0
        private void CreateDialog_Load(object sender, EventArgs e)
        {
            if (m_parent == null)
            {
                m_parent = new RootTreeNode();
            }
            foreach (var item in CreateFactoryAddonType.GetItems(m_parent))
            {
                if (!m_parent.AllowCreate(item.GroupName, item.Name))
                {
                    continue;
                }
                m_allItems.Add(item);
            }
            foreach (ICreateFactoryItem item in m_allItems)
            {
                Bitmap bmp = item.Bitmap;
                if (bmp != null)
                {
                    m_imageIndexes[item] = imageList2.Images.Count;
                    imageList2.Images.Add(item.Bitmap);
                }
                else
                {
                    m_imageIndexes[item] = -1;
                }
            }
            if (!ShowGroups)
            {
                if (m_selectGroup != null && m_selectItem == null)
                {
                    foreach (var item in m_allItems)
                    {
                        if (item.GroupName == m_selectGroup)
                        {
                            m_selectItem = item.Name;
                            break;
                        }
                    }
                }
                listView1_SelectedIndexChanged(sender, e);
                return;
            }
            foreach (ICreateFactoryItem item in m_allItems)
            {
                if (item.Name == null || item.GroupName == null)
                {
                    continue;
                }
                if (!m_parent.AllowCreate(item.GroupName, item.Name))
                {
                    continue;
                }
                if (!m_items.ContainsKey(item.GroupName))
                {
                    m_items[item.GroupName] = new List <ICreateFactoryItem>();
                    ListViewItem grp = lbxGroups.Items.Add(Texts.Get(item.Group));
                    grp.Name       = item.GroupName;
                    grp.ImageIndex = 0;
                }
                m_items[item.GroupName].Add(item);
            }
            int selgrp = 0;

            if (m_selectGroup != null)
            {
                int index = 0;
                foreach (ListViewItem item in lbxGroups.Items)
                {
                    if (item.Name == m_selectGroup)
                    {
                        selgrp = index;
                    }
                    index++;
                }
            }
            foreach (var it in m_items)
            {
                it.Value.SortByKey(i => new Tuple <int, string>(-i.Weight, Texts.Get(i.Title)));
            }
            if (selgrp < lbxGroups.Items.Count)
            {
                lbxGroups.Items[selgrp].Focused  = true;
                lbxGroups.Items[selgrp].Selected = true;
                listView1_SelectedIndexChanged(sender, e);
            }
            m_selectItem  = null;
            m_selectGroup = null;
        }
 public override string ToString()
 {
     return(Texts.Get("s_data_archive"));
 }
Esempio n. 8
0
 public override string ToString()
 {
     return(Texts.Get("s_log"));
 }
Esempio n. 9
0
 public ValueNotSpecifiedError(string errcode, string value)
     : base(errcode + " " + Texts.Get("s_value_not_specified$value", "value", Texts.Get(value)), null)
 {
 }
Esempio n. 10
0
 public IncorrectEmailError(string errcode, string email)
     : base(errcode + " " + Texts.Get("s_incorrect$email", "email", email), null)
 {
 }
Esempio n. 11
0
 public DataParseError(string data, TypeStorage type)
     : base(Texts.Get("s_cannot_convert$text$type", "text", data, "type", type), null)
 {
 }
Esempio n. 12
0
 public IncorrectObjectReferenceError(string errcode, string objtype, string objname)
     : base(errcode + " " + Texts.Get("s_incorrect_object_reference$objtype$objname", "objtype", objtype, "objname", objname), null)
 {
 }
Esempio n. 13
0
 public DatabaseNotAccessibleError(string dbname, Exception inner)
     : base(Texts.Get("s_database_not_accessible$database", "database", dbname) + "\n" + inner.Message, inner)
 {
 }
Esempio n. 14
0
 public ConnectionFailedError(string errcode, Exception inner)
     : base(errcode + " " + Texts.Get("s_connect_failed_with$error", "error", inner.Message), inner)
 {
 }
Esempio n. 15
0
        protected override void OnLinkClick(LinkClickEventArgs e)
        {
            base.OnLinkClick(e);

            string url = e.Href;

            if (url.StartsWith("'") && url.EndsWith("'"))
            {
                url = url.Substring(1, url.Length - 2);
            }
            if (url.StartsWith("\"") && url.EndsWith("\""))
            {
                url = url.Substring(1, url.Length - 2);
            }
            if (url.StartsWith("http://") || url.StartsWith("mailto:"))
            {
                try { System.Diagnostics.Process.Start(url); }
                catch
                {
                    StdDialog.ShowError(Texts.Get("s_cannot_open$url", "url", url));
                }
                e.Handled = true;
            }
            if (url.StartsWith("callback://"))
            {
                e.Handled = true;
                try
                {
                    string mtdname = url.Substring("callback://".Length);
                    Dictionary <string, string> pars = null;
                    if (mtdname.Contains("?"))
                    {
                        pars = new Dictionary <string, string>();
                        string[] pair = mtdname.Split('?');
                        mtdname = pair[0];
                        foreach (string parstr in pair[1].Split('&'))
                        {
                            string[] p2 = parstr.Split(':');
                            if (p2.Length != 2)
                            {
                                continue;
                            }
                            pars[p2[0]] = HttpUtility.UrlDecode(p2[1]);
                        }
                    }
                    if (mtdname.EndsWith("/"))
                    {
                        mtdname = mtdname.Substring(0, mtdname.Length - 1);
                    }
                    object mtd = Procedures[mtdname];
                    if (mtd is Action)
                    {
                        ((Action)mtd)();
                    }
                    else if (mtd is Action <Dictionary <string, string> > )
                    {
                        ((Action <Dictionary <string, string> >)mtd)(pars);
                    }
                    else
                    {
                        // using reflection we call method, which name is after callback://
                        Type       tp   = mtd.GetType();
                        MethodInfo call = tp.GetMethod("Call", new Type[] { (new object[] { }).GetType() });
                        if (call != null)
                        {
                            call.Invoke(mtd, new object[] { new object[] { } });
                        }
                        call = tp.GetMethod("Call", new Type[] { (new object[] { typeof(Dictionary <string, string>) }).GetType() });
                        if (call != null)
                        {
                            call.Invoke(mtd, new object[] { new object[] { pars } });
                        }
                    }
                }
                catch (Exception err)
                {
                    Errors.Report(err);
                }
            }
        }
Esempio n. 16
0
 public override string ToString()
 {
     return(Texts.Get("s_row_number"));
 }
Esempio n. 17
0
 protected void ReportFinish()
 {
     if (ProgressInfo != null)
     {
         if (m_failCount > 0)
         {
             ProgressInfo.LogMessage("s_import", LogLevel.Warning, "{0} OK:{1}, FAIL:{2}", Texts.Get("s_imported"), m_okCount, m_failCount);
         }
         else
         {
             ProgressInfo.LogMessage("s_import", LogLevel.Info, "{0} OK:{1}", Texts.Get("s_imported"), m_okCount);
         }
     }
 }
Esempio n. 18
0
 public DashboardAllreadyDesignedError(DockPanelDashboard dashboard)
     : base(Texts.Get("s_dashboard_is_allready_designed$file", "file", Path.GetFileName(dashboard.AddonFileName)), null)
 {
 }
Esempio n. 19
0
 public override string ToString()
 {
     return(Texts.Get("s_log") + ":" + FilePlace.ToString());
 }
Esempio n. 20
0
 public CannotChangeTablePropertyError(string errcode)
     : base(errcode + " " + Texts.Get("s_cannot_change_table_property"), null)
 {
 }
Esempio n. 21
0
 public override string ToString()
 {
     return(Texts.Get(Title));
 }
Esempio n. 22
0
 public AlterNotPossibleError()
     : base(Texts.Get("s_alter_not_possible"), null)
 {
 }
Esempio n. 23
0
 public override string ToString()
 {
     return(Texts.Get("s_loaded_rows"));
 }
Esempio n. 24
0
 public DataError(string errcode, Exception err)
     : base(errcode + " " + Texts.Get("s_data_error") + ":" + err.Message, err)
 {
 }
Esempio n. 25
0
 public DriverManagerFrame()
 {
     InitializeComponent();
     openFileDialog1.Filter = String.Format("{0} (*.DLL)|*.dll|{0} (*.EXE)|*.exe", Texts.Get("s_assemblies"));
     Reload();
 }
Esempio n. 26
0
        public ConnWizardForm(IStoredConnection conn)
        {
            InitializeComponent();
            m_conn = conn;

            int top  = ClientSize.Height - (btnOk.Top + btnOk.Height);
            int left = ClientSize.Width - (btnOk.Left + btnOk.Width);
            int wi   = ClientSize.Width - 2 * left;

            var tun = m_conn as ITunellableStoredConnection;

            var        parent = Controls;
            TabControl pg     = null;

            if (tun != null)
            {
                pg = new TabControl();
                var pg1 = new TabPage {
                    Text = Texts.Get("s_connection")
                };
                var pg2 = new TabPage {
                    Text = Texts.Get("s_tunnelling")
                };
                pg.TabPages.Add(pg1);
                pg.TabPages.Add(pg2);
                pg.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
                Controls.Add(pg);

                pg.Top   = top;
                pg.Width = wi;
                pg.Left  = left;

                m_tunCfg = new TunnelConfigFrame();
                m_tunCfg.AllowDirectConnection  = tun.AllowDirectConnection;
                m_tunCfg.SelectedDriver         = tun.TunnelDriver;
                m_tunCfg.SelectedDriverChanged += new EventHandler(m_tunCfg_SelectedDriverChanged);
                pg2.Controls.Add(m_tunCfg);
                m_tunCfg.Dock = DockStyle.Fill;

                parent = pg1.Controls;
                top    = 10;
                left   = 10;
                wi     = pg.Width - 20;

                pg.SelectedIndexChanged += pg_TabIndexChanged;
            }

            m_frame = m_conn.CreateEditor();
            parent.Add(m_frame);
            m_frame.Left  = left;
            m_frame.Top   = top;
            m_frame.Width = wi;

            m_common = new CommonConnectionEditFrame(conn);
            parent.Add(m_common);
            m_common.Left  = left;
            m_common.Top   = m_frame.Height + top;
            m_common.Width = wi;

            m_common.LinkToSpecific(m_frame);

            Height = top + Height + m_frame.Height + m_common.Height + (tun != null ? 50 : 0);
            if (pg != null)
            {
                pg.Height = m_frame.Height + m_common.Height + 50;
            }

            Text = Texts.Get(m_conn.ConnectionTypeTitle);
            Translating.TranslateControl(this);
            btnAdvanced.Enabled = conn.ConnectionSettings != null;
            btnCtxhelp.Enabled  = m_conn.HelpTopic != null;
            Usage["contype"]    = conn.GetType().FullName;

            m_origHeight = Height;
            m_origWidth  = Width;
        }
Esempio n. 27
0
 public override string ToString()
 {
     return(String.Format("{0}:{1}", Texts.Get("s_backup"), m_src));
 }
Esempio n. 28
0
 public override string ToString()
 {
     return(Texts.Get("s_column_value"));
 }
Esempio n. 29
0
        //bool IsTheSame(IVirtualFolder folder)
        //{
        //    if (folder is OnServerFolder)
        //    {
        //        OnServerFolder other = (OnServerFolder)folder;
        //        if (other.m_driver.Connection.SystemConnection.ConnectionString != m_driver.Connection.SystemConnection.ConnectionString) return false;
        //        if (m_dbname != other.m_dbname) return false;
        //        return true;
        //    }
        //    return false;
        //}

        #endregion

        public override string ToString()
        {
            return(Texts.Get("s_on_server") + ":" + m_folderName);
        }
Esempio n. 30
0
 public override string ToString()
 {
     return(Texts.Get("s_fixed_text"));
 }