Beispiel #1
0
 private void AddReference_Load(object sender, EventArgs e)
 {
     if (Directory.Exists(Application.StartupPath))
     {
         Sqo.Siaqodb siaqodb = new Sqo.Siaqodb(Application.StartupPath);
         try
         {
             Sqo.IObjectList <ReferenceItem> references = siaqodb.LoadAll <ReferenceItem>();
             foreach (ReferenceItem refItem in references)
             {
                 listBox1.Items.Add(refItem);
             }
             Sqo.IObjectList <NamespaceItem> namespacesItems = siaqodb.LoadAll <NamespaceItem>();
             foreach (NamespaceItem nItem in namespacesItems)
             {
                 textBox1.Text += nItem + Environment.NewLine;
             }
         }
         finally
         {
             siaqodb.Close();
         }
     }
 }
Beispiel #2
0
        private void Main_Shown(object sender, EventArgs e)
        {
#if TRIAL
            string folder    = Application.StartupPath;
            string trialFile = folder + System.IO.Path.DirectorySeparatorChar + "trial.lic";
            if (System.IO.File.Exists(trialFile))
            {
                string text = System.IO.File.ReadAllText(trialFile);
                try
                {
                    SiaqodbConfigurator.SetTrialLicense(text);
                    Sqo.Siaqodb siaqodbConfigTemp = new Sqo.Siaqodb(Application.StartupPath);
                    siaqodbConfigTemp.Close();
                    TrialLicense.LicenseKey = text;
                }
                catch (Sqo.Exceptions.InvalidLicenseException ex)
                {
                    MessageBox.Show(ex.Message);
                    this.Close();
                    return;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    TrialLicenseFrm trialWnd = new TrialLicenseFrm();
                    if (trialWnd.ShowDialog() == DialogResult.OK)
                    {
                        string trialKey = trialWnd.GetLicenseKey();
                        System.IO.File.WriteAllText(trialFile, trialKey);
                    }
                    else
                    {
                        this.Close();
                        return;
                    }
                }
            }
            else
            {
                TrialLicenseFrm trialWnd = new TrialLicenseFrm();
                if (trialWnd.ShowDialog() == DialogResult.OK)
                {
                    string trialKey = trialWnd.GetLicenseKey();
                    System.IO.File.WriteAllText(trialFile, trialKey);
                }
                else
                {
                    this.Close();
                    return;
                }
            }
#endif

            Sqo.Siaqodb siaqodbConfig = new Sqo.Siaqodb(Application.StartupPath);
            //siaqodbConfig.DropType<ConnectionItem>();
            IObjectList <ConnectionItem> list = siaqodbConfig.LoadAll <ConnectionItem>();

            foreach (ConnectionItem item in list)
            {
                cmbDBPath.ComboBox.Items.Add(item.Item);
            }
            siaqodbConfig.Close();

            Sqo.Siaqodb siaqodbRef = new Sqo.Siaqodb(Application.StartupPath);

            Sqo.IObjectList <ReferenceItem> references = siaqodbRef.LoadAll <ReferenceItem>();
            foreach (ReferenceItem refi in references)
            {
                if (File.Exists(refi.Item))
                {
                    try
                    {
                        File.Copy(refi.Item, Application.StartupPath + Path.DirectorySeparatorChar + Path.GetFileName(refi.Item), true);
                    }
                    catch
                    {
                    }
                }
            }
            siaqodbRef.Close();
        }
Beispiel #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (!System.IO.Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + System.IO.Path.DirectorySeparatorChar + "config"))
            {
                try
                {
                    System.IO.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + System.IO.Path.DirectorySeparatorChar + "config");
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex.ToString());
                }
            }
            Sqo.SiaqodbConfigurator.SetLicense(@" qU3TtvA4T4L30VSlCCGUTfs6WUuPueit/9FCCI1GiibPxQvd8bEoB9DX1r6UtUUm");
#if TRIAL
            string folder    = AppDomain.CurrentDomain.BaseDirectory + System.IO.Path.DirectorySeparatorChar + "config";
            string trialFile = folder + System.IO.Path.DirectorySeparatorChar + "trial.lic";
            if (System.IO.File.Exists(trialFile))
            {
                string text = System.IO.File.ReadAllText(trialFile);
                try
                {
                    SiaqodbConfigurator.SetLicense(text);
                    Sqo.Siaqodb siaqodbConfigTemp = new Sqo.Siaqodb(AppDomain.CurrentDomain.BaseDirectory);
                    siaqodbConfigTemp.Close();
                    TrialLicense.LicenseKey = text;
                }
                catch (Sqo.Exceptions.InvalidLicenseException ex)
                {
                    MessageBox.Show(ex.Message);
                    this.Close();
                    return;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    SetTrialLicense trialWnd = new SetTrialLicense();
                    if (trialWnd.ShowDialog() == true)
                    {
                        string trialKey = trialWnd.GetLicenseKey();
                        System.IO.File.WriteAllText(trialFile, trialKey);
                    }
                    else
                    {
                        this.Close();
                        return;
                    }
                }
            }
            else
            {
                SetTrialLicense trialWnd = new SetTrialLicense();
                if (trialWnd.ShowDialog() == true)
                {
                    string trialKey = trialWnd.GetLicenseKey();
                    System.IO.File.WriteAllText(trialFile, trialKey);
                }
                else
                {
                    this.Close();
                    return;
                }
            }
#endif

            Sqo.Siaqodb siaqodbConfig = new Sqo.Siaqodb(AppDomain.CurrentDomain.BaseDirectory);


            IObjectList <ConnectionItem> list = siaqodbConfig.LoadAll <ConnectionItem>();

            foreach (ConnectionItem item in list)
            {
                cmbDBPath.Items.Add(item.Item);
            }
            siaqodbConfig.Close();
            if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + System.IO.Path.DirectorySeparatorChar + "config"))
            {
                Sqo.Siaqodb siaqodbRef = new Sqo.Siaqodb(AppDomain.CurrentDomain.BaseDirectory + "\\config");

                Sqo.IObjectList <ReferenceItem> references = siaqodbRef.LoadAll <ReferenceItem>();
                foreach (ReferenceItem refi in references)
                {
                    if (File.Exists(refi.Item))
                    {
                        try
                        {
                            File.Copy(refi.Item, AppDomain.CurrentDomain.BaseDirectory + "\\" + System.IO.Path.GetFileName(refi.Item), true);
                        }
                        catch
                        {
                        }
                    }
                }

                siaqodbRef.Close();
            }
            DefaultDocument uq = new DefaultDocument();
            uq.Title = "Start";
            SetDefaultSettings(uq);
            uq.Show(this.dockingManager1);
            uq.Activate();

            dockingManager1.ActiveDocumentChanged += new EventHandler(dockingManager1_ActiveDocumentChanged);
            dockingManager1.DocumentClosed        += new EventHandler(dockingManager1_DocumentClosed);
            dockingManager1.DocumentClosing       += new EventHandler <System.ComponentModel.CancelEventArgs>(dockingManager1_DocumentClosing);
            btnExecute.IsEnabled  = false;
            menuExecute.IsEnabled = false;
            btnSave.IsEnabled     = false;
            menuSave.IsEnabled    = false;
            menuSaveAs.IsEnabled  = false;
            btnDBInfo.IsEnabled   = false;
        }