Exemple #1
0
        public void LoadSettings(string sAccountName)
        {
            Settings ste = new Settings(_rgsteeAccount, String.Format("Software\\Thetasoft\\AzLog\\{0}", sAccountName),
                                        sAccountName);

            ste.Load();
            m_ebAccountName.Text = sAccountName;
        }
Exemple #2
0
        public AzLog()
        {
            m_azlm = new AzLogModel();

            InitializeComponent();
            PopulateAccounts();
            m_ste = new Settings(_rgsteeApp, "Software\\Thetasoft\\AzLog", "App");
            m_ste.Load();
            m_sDefaultView = m_ste.SValue("DefaultView");
        }
        /* L O A D */
        /*----------------------------------------------------------------------------
            %%Function: Load
            %%Qualified: AzLog.AzLogViewSettings.Load
            %%Contact: rlittle

        ----------------------------------------------------------------------------*/
        public void Load()
        {
            RegistryKey rk = Registry.CurrentUser.OpenSubKey(KeySettings());

            if (rk == null)
                {
                SetDefault();
                return;
                }
            string[] rgs = rk.GetSubKeyNames();
            Settings ste;
            SortedList<int, Settings> mpnste = new SortedList<int, Settings>();

            foreach (string sColumn in rgs)
                {
                string sKey = String.Format("{0}\\{1}", KeySettings(), sColumn);
                ste = new Settings(_rgsteeColumn, sKey, sColumn);
                ste.Load();
                int nTabOrder = ste.NValue("TabOrder");
                mpnste.Add(nTabOrder, ste);
                }

            foreach (int nKey in mpnste.Keys)
                {
                ste = mpnste[nKey];

                int nWidth = ste.NValue("Width");
                AzLogEntry.LogColumn azlc = (AzLogEntry.LogColumn) ste.NValue("DataLogColumn");
                bool fVisible = ste.FValue("Visible");
                string sTitle = ste.SValue("Title");

                if (sTitle == "")
                    sTitle = (string) ste.Tag;

                AddLogViewColumn((string) ste.Tag, sTitle, nWidth, azlc, fVisible);
                }

            rk.Close();
            m_fDirty = false;
        }
Exemple #4
0
        /* C H A N G E  P R O F I L E */
        /*----------------------------------------------------------------------------
            %%Function: ChangeProfile
            %%Qualified: ArbWeb.AwMainForm.ChangeProfile
            %%Contact: rlittle

        ----------------------------------------------------------------------------*/
        private void ChangeProfile(object sender, EventArgs e)
        {
            if (!m_fDontUpdateProfile)
                {
                DoSaveStateCore();
                m_rehProfile = new Settings(m_rgreheProfile, String.Format("Software\\Thetasoft\\ArbWeb\\{0}", m_cbxProfile.Text), m_cbxProfile.Text);
                m_rehProfile.Load();
                }
        }
Exemple #5
0
        /* A W  M A I N  F O R M */
        /*----------------------------------------------------------------------------
            %%Function: AwMainForm
            %%Qualified: ArbWeb.AwMainForm.AwMainForm
            %%Contact: rlittle

        ----------------------------------------------------------------------------*/
        public AwMainForm(string[] rgsCmdLine)
        {
            //
            // Required for Windows Form Designer support
            //
            m_plCursor = new List<Cursor>();

            InitializeComponent();

            m_srpt = new StatusBox.StatusRpt(m_recStatus);
            m_awc = new ArbWebControl(m_srpt);
            m_fDontUpdateProfile = true;
            RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software\\Thetasoft\\ArbWeb");

            if (rk == null)
                rk = Registry.CurrentUser.CreateSubKey("Software\\Thetasoft\\ArbWeb");

            string []rgs = rk.GetSubKeyNames();

            foreach(string s in rgs)
                {
                m_cbxProfile.Items.Add(s);
                }
            m_rgreheProfile = new[]
                {
                    new Settings.SettingsElt("Login", Settings.Type.Str, m_ebUserID, ""),
                    new Settings.SettingsElt("Password", Settings.Type.Str, m_ebPassword, ""),
                    new Settings.SettingsElt("GameFile", Settings.Type.Str, m_ebGameFile, ""),
                    new Settings.SettingsElt("Roster", Settings.Type.Str, m_ebRoster, ""),
                    new Settings.SettingsElt("GameFileCopy", Settings.Type.Str, m_ebGameCopy, ""),
                    new Settings.SettingsElt("RosterCopy", Settings.Type.Str, m_ebRosterWorking, ""),
                    new Settings.SettingsElt("GameOutput", Settings.Type.Str, m_ebGameOutput, ""),
                    new Settings.SettingsElt("OutputFile", Settings.Type.Str, m_ebOutputFile, ""),
                    new Settings.SettingsElt("IncludeCanceled", Settings.Type.Bool, m_cbIncludeCanceled, 0),
                    new Settings.SettingsElt("ShowBrowser", Settings.Type.Bool, m_cbShowBrowser, 0),
                    new Settings.SettingsElt("LastSlotStartDate", Settings.Type.Dttm, m_dtpStart, ""),
                    new Settings.SettingsElt("LastSlotEndDate", Settings.Type.Dttm, m_dtpEnd, ""),
                    new Settings.SettingsElt("LastOpenSlotDetail", Settings.Type.Bool, m_cbOpenSlotDetail, 0),
                    new Settings.SettingsElt("LastGroupTimeSlots", Settings.Type.Bool, m_cbFuzzyTimes, 0),
                    new Settings.SettingsElt("LastTestEmail", Settings.Type.Bool, m_cbTestEmail, 0),
                    new Settings.SettingsElt("AddOfficialsOnly", Settings.Type.Bool, m_cbAddOfficialsOnly, 0),
                    new Settings.SettingsElt("AfiliationIndex", Settings.Type.Int, m_ebAffiliationIndex, 0),
                    new Settings.SettingsElt("LastSplitSports", Settings.Type.Bool, m_cbSplitSports, 0),
                    new Settings.SettingsElt("LastPivotDate", Settings.Type.Bool, m_cbDatePivot, 0),
                    new Settings.SettingsElt("LastLogToFile", Settings.Type.Bool, m_cbLogToFile, 0),
                    new Settings.SettingsElt("FilterMailMergeByRank", Settings.Type.Bool, m_cbFilterRank, 0),
                    new Settings.SettingsElt("DownloadOnlyFutureGames", Settings.Type.Bool, m_cbFutureOnly, 0),
                    new Settings.SettingsElt("LaunchMailMergeDoc", Settings.Type.Bool, m_cbLaunch, 0),
                    new Settings.SettingsElt("SetArbiterAnnouncement", Settings.Type.Bool, m_cbSetArbiterAnnounce, 0),
                };

            m_rgrehe = new []
                {
                    new Settings.SettingsElt("LastProfile", Settings.Type.Str, m_cbxProfile, "")
                };

            SetupLogToFile();

            m_reh = new Settings(m_rgrehe, "Software\\Thetasoft\\ArbWeb", "root");
            m_reh.Load();

            m_rehProfile = new Settings(m_rgreheProfile, String.Format("Software\\Thetasoft\\ArbWeb\\{0}", m_cbxProfile.Text), m_cbxProfile.Text);

            // load MRU from registry
            m_rehProfile.Load();
            m_fDontUpdateProfile = false;
            EnableControls();

            if (m_cbShowBrowser.Checked)
                m_awc.Show();

            CmdLineConfig clcfg = new CmdLineConfig(new CmdLineSwitch[]
                {
                new CmdLineSwitch("H", true /*fToggle*/, false /*fReq*/, "Update arbiter HELP NEEDED (includes downloading games, calculating slots). Requires -DS and -DE.", "help announce", null),
                new CmdLineSwitch("DS", false /*fToggle*/, false /*fReq*/, "Start date for slot calculation (required if -H specified)", "date start", null),
                new CmdLineSwitch("DE", false /*fToggle*/, false /*fReq*/, "End date for slot calculation (required if -H specified)", "date end", null),
                new CmdLineSwitch("F", false /*fToggle*/, false /*fReq*/, "Check this item in the Game/Slot filter", "Sport filter", null),
                new CmdLineSwitch("f", true /*fToggle*/, false /*fReq*/, "Force the games download to only download future games", "Future Games Only", null),
                });

            CmdLine cl = new CmdLine(clcfg);
            string sError = null;

            if (rgsCmdLine != null && rgsCmdLine.Length > 0)
                m_srpt.AddMessage(String.Format("Commandline args: {0} {1}", rgsCmdLine.Length, rgsCmdLine[0]));

            if (!cl.FParse(rgsCmdLine, this, null, out sError) || (m_fAutomateUpdateHelp && (m_sAutomateDateEnd == null || m_sAutomateDateStart == null)))
                {
                m_sbUsage = new StringBuilder();

                cl.Usage(AppendUsageString);
                MessageBox.Show(String.Format("Command Line error: {0}\n{1}", sError, m_sbUsage.ToString()), "ArbWeb");
                m_fAutomating = true;
                Close();
                }

            if (rgsCmdLine != null && rgsCmdLine.Length > 0)
                {
                m_fAutomating = true;

                if (m_fAutomateUpdateHelp)
                    {
                    DateTime dttmStart = DateTime.Parse(m_sAutomateDateStart);
                    DateTime dttmEnd = DateTime.Parse(m_sAutomateDateEnd);

                    m_cbLaunch.Checked = false;
                    m_cbSetArbiterAnnounce.Checked = true;
                    m_dtpStart.Value = dttmStart;
                    m_dtpEnd.Value = dttmEnd;
                    if (m_fForceFutureGames)
                        m_cbFutureOnly.Checked = true;

                    QueueUIOp(new DelayedUIOpDel(DoDownloadGames), new object[]{null, null});
                    QueueUIOp(new DelayedUIOpDel(CalcOpenSlots), new object[]{null, null});
                    QueueUIOp(new DelayedUIOpDel(DoCheckSportListboxes), new object[]{null, null});
                    QueueUIOp(new DelayedUIOpDel(GenMailMergeMail), new object[]{null, null});
                    QueueUIOp(new DelayedUIOpDel(DoExitApp), new object[]{null, null});

                    DoPendingQueueUIOp();
                    }
            }
        }
Exemple #6
0
        private void m_pbOpen_Click(object sender, EventArgs e)
        {
            Settings ste = new Settings(_rgsteeAccount, KeyName, "main");
            ste.Load();

            m_azlm.OpenAccount((string) m_cbAccounts.SelectedItem, ste.SValue("AccountKey"));
            foreach (string s in m_azlm.Tables)
                m_lbTables.Items.Add(s);
        }