コード例 #1
0
ファイル: Core.cs プロジェクト: janproch/datadmin
        public override void AddFixedLicenses()
        {
            var pdoc = new XmlDocument();

            pdoc.LoadXml(CoreRes.personal);
            LicenseTool.AddLicense(new License(pdoc.DocumentElement, "DatAdmin.Core.dll"));
        }
コード例 #2
0
        public InstallConfigForm()
        {
            InitializeComponent();
            var inst = InstallationInfo.Instance;

            rbtPersonal.Enabled      = LicenseTool.ValidLicenses.Count == 1 && LicenseTool.InvalidLicenses.Count == 0;
            chbProEval.Enabled       = !LicenseTool.ContainsProduct("pro", true) && !LicenseTool.ContainsProduct("pro-eval", true);
            chbDataSynEval.Enabled   = !LicenseTool.ContainsProduct("datasyn", true) && !LicenseTool.ContainsProduct("datasyn-eval", true);
            chbVersionDbEval.Enabled = !LicenseTool.ContainsProduct("versiondb", true) && !LicenseTool.ContainsProduct("versiondb-eval", true);
            switch (inst.InstallMode)
            {
            case InstallationMode.Personal:
                rbtPersonal.Checked = true;
                break;

            case InstallationMode.Professional:
                rbtProfessional.Checked = true;
                break;

            case InstallationMode.Unknown:
                rbtProfessional.Checked = true;
                if (chbProEval.Enabled && LicenseTool.ValidLicenses.Count == 1)
                {
                    chbProEval.Checked = true;
                }
                break;
            }
            chbAllowUploadStats.Checked = GlobalSettings.Pages.General().AllowUploadUsageStats;

            rbtPersonal_CheckedChanged(this, EventArgs.Empty);
        }
コード例 #3
0
        public static void Run()
        {
            var win = new SendFeedbackForm();

            win.tbxEmail.Text = LicenseTool.RegEmail1() ?? "";
            win.ShowDialogEx();
        }
コード例 #4
0
ファイル: AboutForm.cs プロジェクト: janproch/datadmin
        private void ReloadLicenses()
        {
            lsvLicenses.Items.Clear();
            foreach (var lic in LicenseTool.ValidLicenses)
            {
                AddLincese(lic, 1);
            }
            foreach (var lic in LicenseTool.InvalidLicenses)
            {
                AddLincese(lic, 0);
            }

            lsvFeatures.Items.Clear();
            foreach (var holder in FeatureAddonType.Instance.CommonSpace.GetAllAddons())
            {
                var item = lsvFeatures.Items.Add(holder.Title);
                item.ImageIndex = LicenseTool.FeatureAllowed(holder.Name) ? 1 : 0;
                item.SubItems.Add(holder.GetDefiner());
                var lst = new List <string>();
                foreach (var lic in LicenseTool.ValidLicenses)
                {
                    if (lic.FeatureAllowed(holder.Name))
                    {
                        lst.Add(lic.LongText);
                    }
                }
                item.SubItems.Add(lst.CreateDelimitedText(","));
            }
        }
コード例 #5
0
ファイル: FeedbackTool.cs プロジェクト: janproch/datadmin
 public static void FillStdParams(Dictionary <string, string> pars, bool addUsage)
 {
     pars["VERSION"]    = VersionInfo.VERSION;
     pars["START"]      = UsageStats.ProgramStartedAt.ToString("s");
     pars["EDITION"]    = LicenseTool.EditionText();
     pars["REGEMAIL"]   = LicenseTool.RegEmails();
     pars["REGNAME"]    = LicenseTool.RegisteredToUser();
     pars["INSTMODE"]   = InstallationInfo.Instance.InstallMode.ToString();
     pars["OSVERSION"]  = OSVersion();
     pars["LANGUAGE"]   = Texts.Language;
     pars["INSTID"]     = InstallationInfo.Instance.InstallID;
     pars["EXEID"]      = Framework.ExecuteID;
     pars["ALLOWSTATS"] = Framework.Instance.AllowSendUsageStats() ? "1" : "0";
     if (VersionInfo.IsRelease)
     {
         pars["VERTYPE"] = "release";
     }
     if (VersionInfo.IsBeta)
     {
         pars["VERTYPE"] = "beta";
     }
     pars["BRAND"] = VersionInfo.Brand;
     if (addUsage)
     {
         pars["LICENSES"] = LicenseTool.GetFeedbackLicenseInfo();
         pars["USAGE"]    = UsageStats.GetAndClear();
     }
 }
コード例 #6
0
ファイル: RunJobCommand.cs プロジェクト: janproch/datadmin
            public override void RunCommand()
            {
                if (!LicenseTool.FeatureAllowedMsg(JobsFeature.Test))
                {
                    Logging.Error("Proffesional edition required");
                    return;
                }
                if (m_jobname.ToLower().EndsWith(".djb"))
                {
                    m_jobname = m_jobname.Substring(0, m_jobname.Length - 4);
                }
                Job job = Job.LoadFromFile(Path.Combine(Core.JobsDirectory, m_jobname + ".djb"));

                Logging.Info("Running job: " + job.ToString());
                if (!String.IsNullOrEmpty(Filtercommands))
                {
                    var job2 = new Job();
                    var ids  = new HashSetEx <string>(Filtercommands.Split('|'));
                    foreach (var cmd in job.Root.Commands)
                    {
                        if (ids.Contains(cmd.GroupId))
                        {
                            job2.AddCommand(cmd.Clone(false));
                        }
                    }
                    job2 = job;
                }
                job.Run(ExtParams);
                Logging.Info("Job finished");
            }
コード例 #7
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            GlobalSettings.Pages.BeginEdit();
            GlobalSettings.Pages.General().AskWhenUploadUsageStats = false;
            GlobalSettings.Pages.General().AllowUploadUsageStats   = chbAllowUploadStats.Checked;
            GlobalSettings.Pages.EndEdit();

            if (rbtPersonal.Checked)
            {
                InstallationInfo.Instance.InstallMode = InstallationMode.Personal;
            }
            if (rbtProfessional.Checked)
            {
                InstallationInfo.Instance.InstallMode = InstallationMode.Professional;
            }
            InstallationInfo.Instance.LastShown = DateTime.UtcNow;
            InstallationInfo.Instance.Save();

            if (grpEval.Enabled && (chbDataSynEval.Checked || chbProEval.Checked || chbVersionDbEval.Checked))
            {
                var evdata = GetEvalCodeForm.Run();
                if (evdata == null)
                {
                    DialogResult = DialogResult.None;
                    return;
                }
                int cnt = 0;
                using (var wc = new WaitContext())
                {
                    if (chbDataSynEval.Checked && GetEvalCode.GetLicense(evdata.Name, evdata.Email, "datasyn"))
                    {
                        cnt++;
                    }
                    if (chbProEval.Checked && GetEvalCode.GetLicense(evdata.Name, evdata.Email, "pro"))
                    {
                        cnt++;
                    }
                    if (chbVersionDbEval.Checked && GetEvalCode.GetLicense(evdata.Name, evdata.Email, "versiondb"))
                    {
                        cnt++;
                    }
                }
                if (cnt > 0)
                {
                    LicenseTool.ReloadLicenses();
                    HLicense.CallChangedLicenses();
                    StdDialog.ShowInfo("s_license_succesfuly_installed");
                }
                else
                {
                    StdDialog.ShowError("s_error_when_install_license");
                }
            }
            Close();
        }
コード例 #8
0
ファイル: DragDropBuilder.cs プロジェクト: janproch/datadmin
 private void ProcessOperation(object baseObject, AppObject[] draggedObjs, MethodInfo mtd, DragDropOperationAttribute attr)
 {
     if (!LicenseTool.FeatureAllowed(attr.RequiredFeature))
     {
         return;
     }
     if (attr.MultiMode == MultipleMode.NativeMulti)
     {
         var okobjs = new List <AppObject>(draggedObjs);
         foreach (MethodInfo vmtd in baseObject.GetType().GetMethods())
         {
             foreach (DragDropOperationFilterMultiAttribute fattr in vmtd.GetCustomAttributes(typeof(DragDropOperationFilterMultiAttribute), true))
             {
                 if (fattr.Name == attr.Name)
                 {
                     vmtd.Invoke(baseObject, new object[] { okobjs });
                 }
             }
         }
         var op = new MethodDragDropOperation(mtd, attr, baseObject, okobjs);
         if (op.Acceptable())
         {
             Operations.Add(op);
         }
         return;
     }
     else
     {
         var okobjs = new List <AppObject>(draggedObjs);
         foreach (MethodInfo vmtd in baseObject.GetType().GetMethods())
         {
             foreach (DragDropOperationVisibleAttribute vattr in vmtd.GetCustomAttributes(typeof(DragDropOperationVisibleAttribute), true))
             {
                 if (vattr.Name == attr.Name)
                 {
                     okobjs.Clear();
                     foreach (var appobj in draggedObjs)
                     {
                         if ((bool)vmtd.Invoke(baseObject, new object[] { appobj }))
                         {
                             okobjs.Add(appobj);
                         }
                     }
                 }
             }
         }
         var op = new MethodDragDropOperation(mtd, attr, baseObject, okobjs);
         if (op.Acceptable())
         {
             Operations.Add(op);
         }
         return;
     }
 }
コード例 #9
0
        public void AddObject(object obj)
        {
            Dictionary <string, bool> enabled = new Dictionary <string, bool>();
            Dictionary <string, bool> visible = new Dictionary <string, bool>();

            foreach (MethodInfo mtd in obj.GetType().GetMethods())
            {
                foreach (PopupMenuEnabledAttribute attr in mtd.GetCustomAttributes(typeof(PopupMenuEnabledAttribute), true))
                {
                    enabled[attr.Path] = (bool)mtd.Invoke(obj, null);
                }
                foreach (PopupMenuVisibleAttribute attr in mtd.GetCustomAttributes(typeof(PopupMenuVisibleAttribute), true))
                {
                    visible[attr.Path] = (bool)mtd.Invoke(obj, null);
                }
            }

            foreach (MethodAttribute <PopupMenuAttribute> rec in ReflTools.GetMethods <PopupMenuAttribute>(obj))
            {
                if (!LicenseTool.FeatureAllowed(rec.Attribute.RequiredFeature))
                {
                    continue;
                }
                bool v = FindBoolValue(rec.Attribute.Path, visible);
                if (!v)
                {
                    continue;
                }

                bool e = FindBoolValue(rec.Attribute.Path, enabled);

                Bitmap image = Framework.Instance.ImageFromName(rec.Attribute.ImageName, null);
                if (image != null && Framework.IsMono)
                {
                    if (!m_transparencyCache.ContainsKey(image))
                    {
                        m_transparencyCache[image] = image.FixTransparency(SystemColors.ButtonFace);
                    }
                    image = m_transparencyCache[image];
                }

                var data = new MenuItemData();
                data.Image    = image;
                data.Weight   = rec.Attribute.Weight;
                data.Shortcut = rec.Attribute.Shortcut;
                data.ShortcutDisplayString = rec.Attribute.ShortcutDisplayString;
                data.MultiMode             = rec.Attribute.MultiMode;
                data.HideIfNoChildren      = rec.Attribute.HideIfNoChildren;
                data.GroupName             = rec.Attribute.GroupName;
                data.Callable = new MethodCallable(rec.Method);
                data.Enabled  = e;
                AddItem(obj, rec.Attribute.Path, data);
            }
        }
コード例 #10
0
ファイル: AboutForm.cs プロジェクト: janproch/datadmin
        private void AddLincese(License lic, int imgindex)
        {
            var item = lsvLicenses.Items.Add(lic.LongText);

            item.ImageIndex = imgindex;
            item.Tag        = lic;
            item.SubItems.Add(LicenseTool.FormatLicenceDate(lic.ActiveTo));
            item.SubItems.Add(LicenseTool.FormatLicenceDate(lic.SupportTo));
            item.SubItems.Add(LicenseTool.FormatLicenceDate(lic.UpdatesTo));
            item.SubItems.Add(lic.UserName);
            item.SubItems.Add(lic.UserEmail);
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: janproch/datadmin
        static bool InitializeApp()
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

            //SplashForm splash = null;
            if (!IsMono)
            {
                SplashForm.Start();
            }

            SplashForm.SetProgress("Loading core...", 0);
            //if (splash != null) splash.SetCurWork("Loading core...");
            Core.IsGUI = true;
            Core.Instance.CreateWantedDirs();
            HSplash.AddModuleInfo += SplashForm.AddModuleInfo;
            DeletedFileRegistrer.Initialize();
            Core.ConfigureLogging();
            AsyncTool.MainThread = Thread.CurrentThread;
            //NodeFactory.RegisterRootCreator(RootTreeNode.CreateRoot);
            FileTextProvider.LoadStdTexts();
            LicenseTool.ReloadLicenses();
            UICache.Load();

            PluginTools.AddMasterAssembly(Assembly.GetAssembly(typeof(Program)));
            PluginTools.LoadPlugins(SplashForm.LoadPluginCallback);

            SplashForm.SetProgress(Texts.Get("s_loading_configuration"), 80);
            //AddonLibrary.ReloadLibs();
            GlobalSettings.Initialize();
            InternetSettings.Initialize();
            Texts.Language = GlobalSettings.Pages.General().Language;
            HSettings.CallLoaded();

            if (CheckAutoUpdate.Run(SplashForm.EnsureNoSplash))
            {
                Environment.Exit(0);
                return(true);
            }

            Core.RunAutoInstall();

            Core.CopyDefaultData();

            UsageStats.OnStart();
            Favorites.OnStart();
            //SendUsageForm.UploadIfNeeded(SplashForm.EnsureNoSplash);

            SplashForm.SetProgress(Texts.Get("s_creating_main_window"), 100);

            Logging.Info("Starting DatAdmin GUI");
            return(false);
        }
コード例 #12
0
 public static DXDriver GetDXDriver(this IPhysicalConnection conn, string dbname)
 {
     if (conn.SystemConnection == null)
     {
         return(null);
     }
     if (!LicenseTool.FeatureAllowed(DxDriverFeature.Test))
     {
         return(null);
     }
     return((DXDriver)conn.Cache.Database(dbname).Get("dxdriver", () => new DXDriver(conn)));
 }
コード例 #13
0
ファイル: SupportConnector.cs プロジェクト: janproch/datadmin
        private static void OpenSupportUrl(string path, string addpars)
        {
            string url = String.Format("http://www.datadmin.{0}?name={1}&email={2}&version={3}&osversion={4}&edition={5}",
                                       path, HttpUtility.UrlEncode(LicenseTool.RegisteredToUser1()), HttpUtility.UrlEncode(LicenseTool.RegEmail1()),
                                       HttpUtility.UrlEncode(VersionInfo.VERSION), HttpUtility.UrlEncode(FeedbackTool.OSVersion()), HttpUtility.UrlEncode(LicenseTool.EditionText()));

            if (addpars != null)
            {
                url += addpars;
            }
            System.Diagnostics.Process.Start(url);
        }
コード例 #14
0
ファイル: AddonSpace.cs プロジェクト: janproch/datadmin
        public override void GetThisAddons(List <AddonHolder> res)
        {
            foreach (var h in m_holders.Values)
            {
                // test whether addon is for this edition
                if (!LicenseTool.FeatureAllowed(h.Attrib.RequiredFeature))
                {
                    continue;
                }

                res.Add(h);
            }
        }
コード例 #15
0
ファイル: AboutForm.cs プロジェクト: janproch/datadmin
        public AboutForm()
        {
            InitializeComponent();
            ReloadLicenses();

            if (!String.IsNullOrEmpty(LicenseTool.RegisteredToUser()))
            {
                labRegistration.Text = Texts.Get("s_registered_to$user", "user", LicenseTool.RegisteredToUser());
            }
            else
            {
                labRegistration.Text = Texts.Get("s_unregistered");
            }
            labVersion.Text          = VersionInfo.VERSION;
            labRevision.Text         = VersionInfo.SVN_REVISION;
            labBuildAt.Text          = VersionInfo.BuildAt.ToShortDateString();
            labDataDirectory.Text    = Core.AppDataDirectory;
            labProgramDirectory.Text = Core.ProgramDirectory;
            labOperatingSystem.Text  = System.Environment.OSVersion.VersionString;
            labApplicationMode.Text  = String.Format("{0} bit", IntPtr.Size * 8);

            var sb = new StringBuilder();

            sb.AppendLine(String.Format("{0}: Jean Pierre Ravez", Texts.Get("s_french_localization")));
            sb.AppendLine(String.Format("{0}: Stefano Leardini", Texts.Get("s_italian_localization")));
            sb.AppendLine(String.Format("{0}: 王笑宇 [email protected]", Texts.Get("s_chinese_localization")));
            sb.AppendLine("");
            sb.AppendLine(String.Format("{0}:", Texts.Get("s_used_libraries")));
            sb.AppendLine("ICSharpCode - #ziplib, text editor");
            sb.AppendLine("Iron Python");
            sb.AppendLine("SQLite database, SQLite.NET");
            sb.AppendLine("Menees Diff.NET");
            sb.AppendLine("MySQL ADO.NET Connector");
            sb.AppendLine("NauckIT PostgreSQL Provider");
            sb.AppendLine("LINQBridge");
            sb.AppendLine("LumenWorks.Framework.IO");
            sb.AppendLine("EffiProz (if you are using this DB for non-commercial use, you need to purchase license)");
            sb.AppendLine("    http://www.effiproz.com/License.aspx");
            sb.AppendLine("Icons: http://dryicons.com");
            tbxCredits.Text = sb.ToString().Replace("\n", "\r\n");

            lsvLicenses_SelectedIndexChanged(this, EventArgs.Empty);

            label1.Text = VersionInfo.ProgramTitle;

            btnInstallLicense.Visible = !VersionInfo.DenyCustomLicenses;
            btnRemoveLicense.Visible  = !VersionInfo.DenyCustomLicenses;
        }
コード例 #16
0
ファイル: AboutForm.cs プロジェクト: janproch/datadmin
 private void btnRemoveLicense_Click(object sender, EventArgs e)
 {
     if (lsvLicenses.SelectedItems.Count > 0)
     {
         if (MessageBox.Show(Texts.Get("s_really_delete$licenses", "licenses", lsvLicenses.SelectedItems.Count), VersionInfo.ProgramTitle, MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             foreach (ListViewItem item in lsvLicenses.SelectedItems)
             {
                 var lic = (License)item.Tag;
                 File.Delete(lic.Filename);
             }
         }
         LicenseTool.ReloadLicenses();
         ReloadLicenses();
     }
 }
コード例 #17
0
ファイル: AboutForm.cs プロジェクト: janproch/datadmin
 private void btnInstallLicense_Click(object sender, EventArgs e)
 {
     if (openFileDialogLicense.ShowDialogEx() == DialogResult.OK)
     {
         var lic = LicenseTool.LoadLicense(openFileDialogLicense.FileName);
         if (lic != null)
         {
             LicenseTool.InstallLicense(openFileDialogLicense.FileName);
             StdDialog.ShowInfo("s_license_installed_please_restart");
             ReloadLicenses();
         }
         else
         {
             StdDialog.ShowError("s_license_file_is_not_valid");
         }
     }
 }
コード例 #18
0
ファイル: GetEvalCode.cs プロジェクト: janproch/datadmin
        public static bool GetLicense(string name, string email, string product)
        {
            var            desc = ApiDescriptor.GetInstance();
            HttpWebRequest req  = (HttpWebRequest)WebRequest.Create(desc.RequestLicense);

            req.ContentType = "application/x-www-form-urlencoded; charset=utf-8";
            req.Method      = "POST";

            Dictionary <string, string> pars = new Dictionary <string, string>();

            FeedbackTool.FillStdParams(pars, false);
            pars["NAME"]    = name;
            pars["EMAIL"]   = email;
            pars["PRODUCT"] = product;

            string pars_enc = StringTool.UrlEncode(pars, Encoding.UTF8);

            byte[] data = Encoding.UTF8.GetBytes(pars_enc);
            req.ContentLength = data.Length;

            using (Stream fw = req.GetRequestStream())
            {
                fw.Write(data, 0, data.Length);
            }
            using (var resp = req.GetResponse())
            {
                using (Stream fr = resp.GetResponseStream())
                {
                    using (StreamReader reader = new StreamReader(fr))
                    {
                        string licdata = reader.ReadToEnd();
                        if (LicenseTool.LoadLicenseFromString(licdata) == null)
                        {
                            return(false);
                        }
                        using (var fw = new StreamWriter(Path.Combine(Framework.LicensesDirectory, Guid.NewGuid().ToString())))
                        {
                            fw.Write(licdata);
                            return(true);
                        }
                    }
                }
            }
        }
コード例 #19
0
ファイル: DatabaseNodes.cs プロジェクト: janproch/datadmin
        public static ITreeNode[] GetChildren(IDatabaseSource dbconn, ITreeNode parent, string dbname)
        {
            List <ITreeNode> res = new List <ITreeNode>();

            if (!dbconn.DatabaseCaps.IsPhantom)
            {
                res.Add(new Tables_TreeNode(dbconn, parent, false));
                if (dbconn.DatabaseCaps.MultipleSchema)
                {
                    res.Add(new Schemas_TreeNode(dbconn, parent));
                }
                if (dbconn.DatabaseCaps.Domains)
                {
                    res.Add(new Domains_TreeNode(dbconn, parent));
                }
            }
            parent.GetDbObjectNodes(dbconn, res, DbObjectParent.Database, new ObjectPath(dbname), false);
            if (dbconn.DatabaseCaps.IsPhantom)
            {
                if (LicenseTool.FeatureAllowed(DatabaseBackupFeature.Test))
                {
                    res.Add(new Backups_TreeNode(dbconn, parent));
                }
            }
            else
            {
                if (dbconn.IsFullAvailable())
                {
                    res.Add(new SystemDbObjectsNode(dbconn, parent, dbname));
                    if (LicenseTool.FeatureAllowed(DatabaseBackupFeature.Test) && dbconn.GetAnyDialect().DialectCaps.SupportBackup)
                    {
                        res.Add(new Backups_TreeNode(dbconn, parent));
                    }
                }
            }
            if (dbconn.GetPrivateSubFolder("sqlscripts") != null)
            {
                TreeNodeExtension.AddFolderNodes(res, "sqlscripts", (folder, postfix, namePostfix) => new SqlScripts_TreeNode(dbconn, folder, parent, postfix, namePostfix), dbconn);
            }
            return(res.ToArray());
        }
コード例 #20
0
ファイル: AddonSpace.cs プロジェクト: janproch/datadmin
        public StaticAddonHolder FindHolder(string name)
        {
            //StringBuilder sb = new StringBuilder();
            //var stackTrace = new System.Diagnostics.StackTrace();
            //foreach (var frame in stackTrace.GetFrames())
            //{
            //    sb.AppendLine(frame.GetMethod().Name);   // write method name
            //}
            //MessageBox.Show(sb.ToString());
            StaticAddonHolder res;

            if (m_holders.TryGetValue(name, out res))
            {
                if (LicenseTool.FeatureAllowed(res.Attrib.RequiredFeature))
                {
                    return(res);
                }
                throw new InternalError(String.Format("DAE-00072 License for addon {0}({1}) not found", name, AddonType.Name));
            }
            throw new InternalError("DAE-00073 Addon " + AddonType.Name + " has not type " + name);
        }
コード例 #21
0
ファイル: Program.cs プロジェクト: janproch/datadmin
        static void Main(string[] args)
        {
            Core.IsCommandLine = true;
            Core.Instance.CreateWantedDirs();
            Core.ConfigureLogging();

            FileTextProvider.LoadStdTexts();
            LicenseTool.ReloadLicenses();

            PluginTools.AddMasterAssembly(Assembly.GetAssembly(typeof(DaciProgram)));
            PluginTools.LoadPlugins();
            GlobalSettings.Initialize();
            InternetSettings.Initialize();
            HSettings.CallLoaded();

            //Async.MainThread = Thread.CurrentThread;

            try
            {
                if (args.Length == 0)
                {
                    CmdLine.PrintHelp();
                    Environment.Exit(0);
                }
                Logging.Info("Starting DACI - DatAdmin CommandLine interface");
                ICommandLineCommandInstance cmd = CmdLine.LoadCommand(args);
                cmd.RunCommand();
            }
            catch (ExpectedError e)
            {
                Logging.Error(e.Message);
            }
            catch (Exception e)
            {
                Logging.Error("Fatal error:" + e.ToString());
            }
            Logging.QuitAndWait();
            Core.FinalizeApp();
            Environment.Exit(0);
        }
コード例 #22
0
        public DatAdminInfoDashboardFrame()
        {
            InitializeComponent();

            HtmlGenerator gen = new HtmlGenerator();

            gen.BeginHtml(VersionInfo.ProgramTitle, HtmlGenerator.HtmlObjectViewStyle);
            gen.Heading(VersionInfo.ProgramTitle, 2);
            gen.PropsTableBegin();
            gen.PropTableRow("s_version", VersionInfo.VERSION);
            gen.PropTableRow("s_revision", VersionInfo.SVN_REVISION);
            gen.PropTableRow("s_build_at", VersionInfo.BuildAt.ToString("d"));
            gen.PropTableRow("s_edition", LicenseTool.EditionText());
            //gen.PropTableRow("s_license_valid_to", LicenseTool. Registration.EditionValidTo != null ? Registration.EditionValidTo.Value.ToString() : "");
            gen.PropsTableEnd();
            gen.BeginUl();
            gen.Li(String.Format("<a href='callback://open_newconn_dialog'>{0}</a>", Texts.Get("s_create_connection")));
            gen.Li(String.Format("<a href='callback://licenses'>{0}</a>", Texts.Get("s_licenses")));
            gen.Li(String.Format("<a href='http://datadmin.com'>{0}</a>", Texts.Get("s_datadmin_on_web")));
            gen.Li(String.Format("<a href='callback://support'>{0}</a>", Texts.Get("s_support")));
            gen.EndUl();

            bool showlic = true;

            if (LicenseTool.HidePurchaseLinks() && VersionInfo.HideLicenseInfo)
            {
                showlic = false;
            }
            if (showlic)
            {
                gen.Write(VersionInfo.LicenseInfo);
            }

            gen.EndHtml();
            htmlPanelEx1.Procedures["open_newconn_dialog"] = (Action) delegate() { MainWindow.Instance.CreateNewConnectionDialog(); };
            htmlPanelEx1.Procedures["licenses"]            = (Action) delegate() { AboutForm.RunLicenses(); };
            htmlPanelEx1.Procedures["support"]             = (Action) delegate() { SupportConnector.SupportRequest(); };
            htmlPanelEx1.Text = gen.HtmlText;
        }
コード例 #23
0
ファイル: Program.cs プロジェクト: janproch/datadmin
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            SystemLogTool.Info("Initializing DatAdmin Service process...");

            try
            {
                var si = new DatAdminServiceInfo();
                si.Load();
                si.Apply();

                Core.IsCommandLine = true;
                Core.Instance.CreateWantedDirs();
                Core.ConfigureLogging();

                FileTextProvider.LoadStdTexts();
                LicenseTool.ReloadLicenses();

                PluginTools.AddMasterAssembly(Assembly.GetAssembly(typeof(Program)));
                PluginTools.LoadPlugins();
                GlobalSettings.Initialize();
                InternetSettings.Initialize();

                FileTextProvider.LoadStdTexts();
                LicenseTool.ReloadLicenses();
                HSettings.CallLoaded();

                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new DatAdminService()
                };
                ServiceBase.Run(ServicesToRun);
            }
            catch (Exception err)
            {
                SystemLogTool.Error("Failed to initialize DatAdmin Service process\n" + err.ToString());
            }
        }
コード例 #24
0
 public bool BackupVisible()
 {
     return(LicenseTool.FeatureAllowed(DatabaseBackupFeature.Test) && this.FindPhysicalConnection().GetAnyDialect().DialectCaps.SupportBackup);
 }
コード例 #25
0
ファイル: GetEvalCodeForm.cs プロジェクト: janproch/datadmin
 public GetEvalCodeForm()
 {
     InitializeComponent();
     tbxName.Text  = LicenseTool.RegisteredToUser1() ?? "";
     tbxEmail.Text = LicenseTool.RegEmail1() ?? "";
 }
コード例 #26
0
ファイル: SaveJobForm.cs プロジェクト: janproch/datadmin
        public static SaveJobResult Run(Func <Job> createJob)
        {
            if (!LicenseTool.FeatureAllowedMsg(JobsFeature.Test))
            {
                return(null);
            }
            //if (!Licenseto. Registration.TryCheckEdition(SoftwareEdition.Professional, "export to job")) return null;
            SaveJobForm win = new SaveJobForm();

            if (win.ShowDialogEx() == DialogResult.OK)
            {
                if (win.rbtCreateNewJob.Checked)
                {
                    string fn = Path.Combine(Core.JobsDirectory, win.tbxJob.Text + ".djb");
                    if (File.Exists(fn))
                    {
                        if (!StdDialog.ReallyOverwriteFile(fn))
                        {
                            return(null);
                        }
                    }
                    try
                    {
                        Job job = createJob();
                        job.SaveToFile(fn);
                        if (win.chbAddToFavorites.Checked)
                        {
                            if (String.IsNullOrEmpty(win.addToFavoritesFrame1.FavoriteName))
                            {
                                win.addToFavoritesFrame1.FavoriteName = Path.GetFileNameWithoutExtension(fn);
                            }
                            win.addToFavoritesFrame1.Favorite = new JobFavorite {
                                JobFile = fn
                            };
                            Favorites.AddLast(win.addToFavoritesFrame1.GetHolder());
                            Favorites.NotifyChanged();
                        }
                        //UsageStats.Usage("export_as_job", "jobname", job.ToString(), "addtofavorite", win.chbAddToFavorites.Checked ? "1" : "0");
                        return(new SaveJobResult
                        {
                            Commands = new List <JobCommand>(job.Root.m_commands),
                            JobConn = new JobConnection(fn),
                        });
                    }
                    catch (Exception err)
                    {
                        Errors.Report(err);
                    }
                }
                if (win.rbtAppendToExistingJob.Checked)
                {
                    string fn   = Path.Combine(Core.JobsDirectory, win.lbxJobs.Items[win.lbxJobs.SelectedIndex].ToString());
                    Job    job  = Job.LoadFromFile(fn);
                    Job    job2 = createJob();
                    job.Root.m_commands.AddRange(job2.Root.m_commands);
                    job.SaveToFile(fn);
                    return(new SaveJobResult
                    {
                        Commands = new List <JobCommand>(job2.Root.m_commands),
                        JobConn = new JobConnection(fn),
                    });
                }
            }
            return(null);
        }
コード例 #27
0
ファイル: LicenseTool.cs プロジェクト: janproch/datadmin
 public bool FeatureAllowed(string features)
 {
     return(LicenseTool._FeatureAllowed(features, Features));
 }