Example #1
0
    public int GetAmountOfTalentPoints(CurrentTab tab, int index)
    {
        if (index > 4 || index < 0)
        {
            return(0);
        }
        switch (tab)
        {
        case CurrentTab.Core:
            return(Stats.coreTalentsArray[index]);

        case CurrentTab.Offense:
            return(Stats.offenseTalentsArray[index]);

        case CurrentTab.Defense:
            return(Stats.defenseTalentsArray[index]);

        case CurrentTab.Utility:
            return(Stats.utilityTalentsArray[index]);

        case CurrentTab.Bot:
            return(Stats.botTalentsArray[index]);

        default:
            return(0);
        }
    }
Example #2
0
        private void Send_btn_Click(object sender, EventArgs e)
        {
            if (Tabs_cbx.Text == "")
            {
                MessageBox.Show("Please Select a Tab", "Select a Tab", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Tabs_cbx.Focus();
                return;
            }
            PlanSwift.Tab CurrentTab;
            CurrentTab = TGlobal.pc.Tabs.ByName(Tabs_cbx.Text);
            CurrentTab.MakeActive();
            AuCad         = new Autodesk.AutoCAD.Interop.AcadApplication();
            AuCad.Visible = true;
            AuDocument    = AuCad.ActiveDocument;

            for (int ItemIndex = 0; ItemIndex <= CurrentTab.Count - 1; ItemIndex++)
            {
                GetItems(CurrentTab[ItemIndex]);
            }

            AuCad.ZoomAll();
            AuCad      = null;
            AuDocument = null;
            this.Close();
        }
        /// <summary>
        /// Creates a new meter tab, enables backward button to allow user to get back to Serial Page
        /// Enables forward button because first page is Configuration page and can have no modifications
        /// </summary>
        /// <param name="objects">Tuple containing the serial port index and meter serial number</param>
        public void CreateTab(Tuple <string, string> objects)
        {
            // If the tab does not exist, create one otherwise re-open the tab
            var tab = _tabs.Where(x => x.SerialIdx == objects.Item1 && x.MeterSerialNo == objects.Item2).FirstOrDefault();

            if (tab == null)
            {
                Application.Current.Dispatcher.Invoke(async() =>
                {
                    _tabs.Add(new ContentTabViewModel(objects.Item1, objects.Item2));
                    await CurrentTab.StopAsync();
                    CurrentTab = _tabs.Last();
                    CurrentTab.StartAsync();
                    ModifyNavigation();
                    ModifyTabs();
                });
            }
            else
            {
                Application.Current.Dispatcher.Invoke(async() =>
                {
                    tab.Visible = true;
                    await CurrentTab.StopAsync();
                    CurrentTab = tab;
                    CurrentTab.StartAsync();
                    ModifyNavigation();
                    ModifyTabs();
                });
            }
        }
        /// <summary>
        /// Allows user to progress to a previous page or if at the first page, a previous tab
        /// </summary>
        private async Task Backward()
        {
            var pages   = CurrentTab.Pages;
            var current = CurrentTab.CurrentPage;
            var idx     = pages.IndexOf(current);

            // If not currently on first page for tab then go back one page
            if (idx > 0)
            {
                await CurrentTab.StopAsync();

                CurrentTab.CurrentPage = pages[idx - 1];
                CurrentTab.StartAsync();
                ModifyNavigation();
            }
            // If currently on first page of tab, then go back to the first tab
            // only if user is currently not on first tab
            else if (CurrentTab.Name != "Serial Connection")
            {
                await CurrentTab.StopAsync();

                CurrentTab = _tabs[0];
                CurrentTab.StartAsync();
                ModifyNavigation();
            }
        }
Example #5
0
    public int GetAmountOfSpentPoints(CurrentTab tab)
    {
        switch (tab)
        {
        case CurrentTab.Core:
            return(Stats.coreTalentsArray[1] + Stats.coreTalentsArray[2] + Stats.coreTalentsArray[3] +
                   Stats.coreTalentsArray[4]);

        case CurrentTab.Offense:
            return(Stats.offenseTalentsArray[1] + Stats.offenseTalentsArray[2] + Stats.offenseTalentsArray[3] +
                   Stats.offenseTalentsArray[4]);

        case CurrentTab.Defense:
            return(Stats.defenseTalentsArray[1] + Stats.defenseTalentsArray[2] + Stats.defenseTalentsArray[3] +
                   Stats.defenseTalentsArray[4]);

        case CurrentTab.Utility:
            return(Stats.utilityTalentsArray[1] + Stats.utilityTalentsArray[2] + Stats.utilityTalentsArray[3] +
                   Stats.utilityTalentsArray[4]);

        case CurrentTab.Bot:
            return(Stats.botTalentsArray[1] + Stats.botTalentsArray[2] + Stats.botTalentsArray[3] +
                   Stats.botTalentsArray[4]);

        default:
            return(0);
        }
    }
Example #6
0
 private void ReloadPastAction()
 {
     if (CurrentTab == null)
     {
         return;
     }
     CurrentTab.ReloadPastAsync();
 }
        /// <summary>
        /// Progresses the window forward one page or progresses user to different tab in tab control
        /// </summary>
        private async Task Forward()
        {
            // The first tab is a control tab thus it's forward operations are different
            if (_tabs.IndexOf(CurrentTab) == 0)
            {
                // if there are more tabs visible than just the first tab
                // go to the next visible tab
                if (_tabs.Where(x => x.Visible == true).Count() > 1)
                {
                    await CurrentTab.StopAsync();

                    CurrentTab = _tabs[1];
                    CurrentTab.StartAsync();
                    ModifyNavigation();
                }

                // If there are no other visible tabs then assuming that the user now wants to
                // input their credentials into the login screen so they can upload into CRM
                else
                {
                    var pages = CurrentTab.Pages;
                    var page  = CurrentTab.CurrentPage;
                    var idx   = pages.IndexOf(page);

                    if (idx < pages.Count - 1)
                    {
                        await CurrentTab.StopAsync();

                        CurrentTab.CurrentPage = pages[idx + 1];
                        CurrentTab.StartAsync();
                        ModifyNavigation();
                    }
                }
            }
            // if user is on any other tab but the first tab, go to the next page if there are additional pages
            // if user is at last page for this tab, close the tab and progress to login screen if there are no
            // more tabs besides the first tab otherwise do nothing
            else
            {
                var pages   = CurrentTab.Pages;
                var current = CurrentTab.CurrentPage;
                var idx     = pages.IndexOf(current);

                if (idx < pages.Count - 1)
                {
                    await CurrentTab.StopAsync();

                    CurrentTab.CurrentPage = pages[idx + 1];
                    CurrentTab.StartAsync();
                    ModifyNavigation();
                }
                else
                {
                    // Close this tab if we are finished commissioning this meter.
                    await CloseTab(new Tuple <string, string>(CurrentTab.SerialIdx, CurrentTab.MeterSerialNo), true);
                }
            }
        }
 public void SetRepresentedTab(CurrentTab tab)
 {
     _representedTab = tab;
     text = tab.ToString();
     var textObj = StaticScripts.CreateTextObj(name + "_text", text, new Vector3(0.02f, 0.02f), new Vector3(0f, 0f, 0f),
         FontType.DiabloFont, 96, new Color32(131, 176, 209, 255), TextAlignment.Center, true, name, FontStyle.Bold);
     textObj.transform.localPosition = text.Length > 8 ? new Vector3(0.9f, 0.5f, 0f) : new Vector3(0.9f, 1.1f - (textObj.GetComponent<Renderer>().bounds.size.x / 2f), 0f);
     textObj.transform.localScale = new Vector2(1f, 1.5f);
 }
Example #9
0
    public void SetRepresentedTab(CurrentTab tab)
    {
        _representedTab = tab;
        text            = tab.ToString();
        var textObj = StaticScripts.CreateTextObj(name + "_text", text, new Vector3(0.02f, 0.02f), new Vector3(0f, 0f, 0f),
                                                  FontType.DiabloFont, 96, new Color32(131, 176, 209, 255), TextAlignment.Center, true, name, FontStyle.Bold);

        textObj.transform.localPosition = text.Length > 8 ? new Vector3(0.9f, 0.5f, 0f) : new Vector3(0.9f, 1.1f - (textObj.GetComponent <Renderer>().bounds.size.x / 2f), 0f);
        textObj.transform.localScale    = new Vector2(1f, 1.5f);
    }
Example #10
0
        public void Previous()
        {
            if (CurrentTrack == null)
            {
                return;
            }
            var track = CurrentTab?.GetPreviousTrack(CurrentTrack);

            Play(track, CurrentTab);
        }
Example #11
0
        public void Next()
        {
            if (CurrentTrack == null)
            {
                return;
            }
            var track = CurrentTab?.GetNextTrack(CurrentTrack);

            CurrentTab?.Play(track);
        }
Example #12
0
    public void SubtractTalentPoints(CurrentTab tab, int index)
    {
        if (index > 4)
        {
            return;
        }
        switch (tab)
        {
        case CurrentTab.Core:
            if (Stats.coreTalentsArray[index] < 1)
            {
                return;
            }
            Stats.coreTalentsArray[index]--;
            Stats.coreTalentsArray[0]++;
            break;

        case CurrentTab.Offense:
            if (Stats.offenseTalentsArray[index] < 1)
            {
                return;
            }
            Stats.offenseTalentsArray[index]--;
            Stats.offenseTalentsArray[0]++;
            break;

        case CurrentTab.Defense:
            if (Stats.defenseTalentsArray[index] < 1)
            {
                return;
            }
            Stats.defenseTalentsArray[index]--;
            Stats.defenseTalentsArray[0]++;
            break;

        case CurrentTab.Utility:
            if (Stats.utilityTalentsArray[index] < 1)
            {
                return;
            }
            Stats.utilityTalentsArray[index]--;
            Stats.utilityTalentsArray[0]++;
            break;

        case CurrentTab.Bot:
            if (Stats.botTalentsArray[index] < 1)
            {
                return;
            }
            Stats.botTalentsArray[index]--;
            Stats.botTalentsArray[0]++;
            break;
        }
        RecalculateStats();
    }
 private void CancelFilterByTimeAction()
 {
     if (CurrentTab.IsAllTab())
     {
         // do nothing
     }
     else
     {
         LogEntriesCollectionView.Filter = null;
     }
 }
 private void LoadOlderLogAction()
 {
     for (int i = 0; i < TRIES; i++)
     {
         bool s = CurrentTab.LoadOlderLogEntry();
         if (s)
         {
             break;
         }
     }
 }
Example #15
0
        /// <summary>
        /// Shows the selected pane.
        /// </summary>
        private void ShowSelectedPane()
        {
            pnlAdvancedSettings.Visible = CurrentTab.Equals("Advanced Settings");
            pnlBasicProperty.Visible    = CurrentTab.Equals("Basic Settings");
            pnlMobileSettings.Visible   = CurrentTab.Equals("Mobile Local Settings");
            pnlCustomGridTab.Visible    = CurrentTab.Equals("Custom Grid Options");

            foreach (var kvp in CustomSettingsProviders)
            {
                kvp.Value.Visible = CurrentTab.Equals(kvp.Key.CustomSettingsTitle);
            }
        }
Example #16
0
 public void SetTab(string tab)
 {
     CurrentTab = Tabs[tab];
     foreach (var pair in Tabs)
     {
         bool isTab = pair.Key == tab;
         pair.Value.IsVisible        = isTab;
         pair.Value.Button.IsToggled = isTab;
     }
     CurrentTab.Select();
     Layout.SetComponentPosition(Tabs[tab], 0, 1, Layout.Cols, Layout.Rows - 1);
     Layout.UpdateSizes();
 }
        private void ShowLastLogsAction(object o)
        {
            if (!(o is bool))
            {
                return;
            }
            bool b = (bool)o;

            if (b)
            {
                CurrentTab.LoadLastLogs();
            }
            CurrentTab.IsAddingNewestEntries = b;
        }
Example #18
0
        public void CancelQuest(QuestInfo quest)
        {
            bool available = false, current = false, completed = false;

            ClientUserQuest userQuest = GameScene.Game.QuestLog.FirstOrDefault(x => x.Quest == quest);

            if (userQuest == null)
            {
                return;
            }

            if (CompletedTab.Quests.Contains(quest))
            {
                CompletedTab.Quests.Remove(quest);
                completed = true;
            }

            if (CurrentTab.Quests.Contains(quest))
            {
                CurrentTab.Quests.Remove(quest);
                current = true;
            }

            if (GameScene.Game.CanAccept(quest))
            {
                if (!AvailableTab.Quests.Contains(quest))
                {
                    AvailableTab.Quests.Add(quest);
                    available = true;
                }
            }

            GameScene.Game.QuestLog.Remove(userQuest);

            if (available)
            {
                AvailableTab.NeedUpdate = true;
                AvailableTab.UpdateQuestDisplay();
            }
            if (current)
            {
                CurrentTab.NeedUpdate = true;
                CurrentTab.UpdateQuestDisplay();
            }
            if (completed)
            {
                CompletedTab.NeedUpdate = true;
                CompletedTab.UpdateQuestDisplay();
            }
        }
Example #19
0
        /// <inheritdoc/>
        protected override void ChangeLanguage(string language)
        {
            // Set language and propagate change
            Settings.Current.General.Language = language;
            Program.UpdateLocale();

            // Refresh tab to update language-related stuff
            CurrentTab?.Open(this);

            // Inform user he/she needs to close the Main Form to refresh all locales
            if (Msg.YesNo(this, Resources.CloseModForLangChange, MsgSeverity.Info, Resources.CloseModForLangChangeYes, Resources.CloseModForLangChangeNo))
            {
                Restart();
            }
        }
        /// ------------------------------------------------------------------------------------
        void m_cieSimilarOptionsDropDownContainer_Closed(object sender, ToolStripDropDownClosedEventArgs e)
        {
            // Make sure the drop-down completely goes away before proceeding.
            Application.DoEvents();

            if (CurrentTab.CieSimilarOptionsDropDown.OptionsChanged)
            {
                // Save the options as the new defaults for the project.
                App.Project.SaveCIEOptions(CurrentTab.CieSimilarOptionsDropDown.CIEOptions);
                CurrentTab.ResultView.Grid.CIEOptions = CurrentTab.CieSimilarOptionsDropDown.CIEOptions;
                CurrentTab.CIEViewSimilarRefresh();
            }

            CurrentTab.CieSimilarOptionsDropDownContainer.Closed -= m_cieSimilarOptionsDropDownContainer_Closed;
        }
        /// <summary>
        /// Used to start the upload to crm process if the meters have already been commissioned but an
        /// internet connection was not available on site
        /// </summary>
        private async Task StartCRM()
        {
            if (CurrentTab.Name == "Serial Connection")
            {
                var pages   = CurrentTab.Pages;
                var current = CurrentTab.CurrentPage;
                var idx     = pages.IndexOf(current);

                await CurrentTab.StopAsync();

                CurrentTab.CurrentPage = pages[idx + 1];
                CurrentTab.StartAsync();
                ModifyNavigation();
            }
        }
        /// <summary>
        ///
        /// Closes the tab that is associated with the serial port that was recently closed
        /// and removes the serial and meter object from the collections that are hosting them
        /// simultaneously saves the meter object. Modifies collections used to control visible
        /// menu tabs
        /// </summary>
        /// <param name="args"></param>
        public async Task CloseTab(Tuple <string, string> args, bool complete = false)
        {
            // Close the comm port if the complete arg is true
            var comms = Globals.Serials;

            if (complete)
            {
                comms[args.Item1].Close();
            }

            // Retrieves the index for the tab in the underlying collection
            var idx = _tabs.FindIndex(t => t.MeterSerialNo == args.Item2);
            var tab = _tabs[idx];

            // Do not remove the first tab if there are other tabs open
            if (_tabs.Where(x => x.Visible == true).Count() > 1 && idx == 0)
            {
                return;
            }

            // "Close" (Hide) the desired tab
            tab.Visible = false;

            // If there are no more visible tabs, close the application and save meter data
            if (_tabs.Where(x => x.Visible == true).Count() == 0)
            {
                ShutdownProcedure();
            }
            // If the current tab is a meter tab and user is viewing this tab
            // Shift to the next open tab and save the meter data for this tab
            else if (CurrentTab == tab)
            {
                string id = CurrentTab.MeterSerialNo;
                await CurrentTab.StopAsync();

                CurrentTab = _tabs[idx - 1];
                CurrentTab.StartAsync();
                ModifyNavigation();
                var meters = Globals.Meters;
                if (complete)
                {
                    meters[id].Commissioned = true;
                }
                meters[id].Save(_toUploadDir);
            }

            ModifyTabs();
        }
Example #23
0
    void OnGUI()
    {
        if (Application.isPlaying)
        {
            //GUILayout.Label("Unable to edit triggers while game is playing...");
            //return;
        }
        Initialize();

        Rect leftFrame  = new Rect(0, 0, 300, this.position.height);
        Rect rightFrame = new Rect(301, 0, this.position.width - 300, this.position.height);

        GUILayout.BeginArea(leftFrame, GUI.skin.window);
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Triggers", (_currentTab == CurrentTab.Overview ? GUI.skin.box : GUI.skin.button), GUILayout.ExpandWidth(true)))
        {
            _currentTab = CurrentTab.Overview;
        }
        if (GUILayout.Button("Variables", _currentTab == CurrentTab.SymbolTable ? GUI.skin.box : GUI.skin.button, GUILayout.ExpandWidth(true)))
        {
            _currentTab = CurrentTab.SymbolTable;
        }
        GUILayout.EndHorizontal();
        if (_currentTab == CurrentTab.Overview)
        {
            _overviewTab.Draw();
        }
        else if (_currentTab == CurrentTab.SymbolTable)
        {
            _variableView.Draw();
        }
        GUILayout.EndArea();
        GUILayout.BeginArea(rightFrame, GUI.skin.window);
        _triggerEditor.Draw();
        GUILayout.EndArea();

        if (Event.current.type == EventType.MouseDown)
        {
            GUI.FocusControl(null);
            _eventEditorContext.Repaint = true;
        }

        if (_eventEditorContext.Repaint)
        {
            Repaint();
            _eventEditorContext.Repaint = false;
        }
    }
        private void LoadNewerLogArrayAction()
        {
            Log9KUtil.ExecuteCommand(StartRemovingFromTopCommand);
            int  pageUpDownToLoad;
            bool success = int.TryParse(PageUpDownToLoad, out pageUpDownToLoad);

            if (!success)
            {
                pageUpDownToLoad = 10;
            }
            for (int i = 0; i < pageUpDownToLoad; i++)
            {
                CurrentTab.LoadNewerLogEntry();
            }
            SelectedEntry = CurrentTab.LogEntryCollection[CurrentTab.LogEntryCollection.Count - 1];
        }
Example #25
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (TabControl != null)
                {
                    if (!TabControl.IsDisposed)
                    {
                        TabControl.Dispose();
                    }

                    TabControl = null;
                }

                if (AvailableTab != null)
                {
                    if (!AvailableTab.IsDisposed)
                    {
                        AvailableTab.Dispose();
                    }

                    AvailableTab = null;
                }

                if (CurrentTab != null)
                {
                    if (!CurrentTab.IsDisposed)
                    {
                        CurrentTab.Dispose();
                    }

                    CurrentTab = null;
                }

                if (CompletedTab != null)
                {
                    if (!CompletedTab.IsDisposed)
                    {
                        CompletedTab.Dispose();
                    }

                    CompletedTab = null;
                }
            }
        }
Example #26
0
        public void QuestChanged(ClientUserQuest quest)
        {
            if (AvailableTab.SelectedQuest?.QuestInfo == quest.Quest)
            {
                AvailableTab.UpdateQuestDisplay();
            }

            if (CurrentTab.SelectedQuest?.QuestInfo == quest.Quest)
            {
                CurrentTab.UpdateQuestDisplay();
            }

            if (CompletedTab.SelectedQuest?.QuestInfo == quest.Quest)
            {
                CompletedTab.UpdateQuestDisplay();
            }
        }
Example #27
0
    public void ResetTalentPoints(CurrentTab tab)
    {
        switch (tab)
        {
        case CurrentTab.Core:
            Stats.coreTalentsArray[0] = Stats.coreTalentsArray.Sum();
            for (int i = 1; i < Stats.coreTalentsArray.Length; i++)
            {
                Stats.coreTalentsArray[i] = 0;
            }
            break;

        case CurrentTab.Offense:
            Stats.offenseTalentsArray[0] = Stats.offenseTalentsArray.Sum();
            for (int i = 1; i < Stats.offenseTalentsArray.Length; i++)
            {
                Stats.offenseTalentsArray[i] = 0;
            }
            break;

        case CurrentTab.Defense:
            Stats.defenseTalentsArray[0] = Stats.defenseTalentsArray.Sum();
            for (int i = 1; i < Stats.defenseTalentsArray.Length; i++)
            {
                Stats.defenseTalentsArray[i] = 0;
            }
            break;

        case CurrentTab.Utility:
            Stats.utilityTalentsArray[0] = Stats.utilityTalentsArray.Sum();
            for (int i = 1; i < Stats.utilityTalentsArray.Length; i++)
            {
                Stats.utilityTalentsArray[i] = 0;
            }
            break;

        case CurrentTab.Bot:
            Stats.botTalentsArray[0] = Stats.botTalentsArray.Sum();
            for (int i = 1; i < Stats.botTalentsArray.Length; i++)
            {
                Stats.botTalentsArray[i] = 0;
            }
            break;
        }
    }
Example #28
0
        private void Send_btn_Click(object sender, EventArgs e)
        {
            if (Tabs_cbx.Text == "")
            {
                MessageBox.Show("Please Select a Tab", "Select a Tab", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Tabs_cbx.Focus();
                return;
            }

            // Start Word and Get Application Object
            oWord = new Word.Application();
            PlanSwift.Tab CurrentTab;
            oWord.Visible = true;
            object FilePath  = Environment.CurrentDirectory + @"\Templates\Work Order.dotx";
            object Readonly  = false;
            object missing   = System.Reflection.Missing.Value;
            object isVisible = true;
            object TStyle    = "Medium Shading 1 - Accent 1";

            //Open Template
            oDocument = (Word._Document)oWord.Documents.Open(ref FilePath, ref missing, ref Readonly, ref missing, ref missing,
                                                             ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible,
                                                             ref missing, ref missing, ref missing, ref missing);
            // Apply Table Formating Style
            oDocument.Tables[2].set_Style(ref TStyle);
            oDocument.Tables[2].Columns[3].Width = 40;
            oDocument.Tables[2].Columns[4].Width = 70;

            // Get Planswift Items
            CurrentTab = TGlobal.pc.Tabs.ByName(Tabs_cbx.Text);
            CurrentTab.MakeActive();
            for (int ItemIndex = 0; ItemIndex <= CurrentTab.Count - 1; ItemIndex++)
            {
                GetItems(CurrentTab[ItemIndex]);
            }

            //Delete Last unused Row
            oDocument.Tables[2].Rows[ItemNumber].Delete();
            //Free Microsoft Word
            oWord     = null;
            oDocument = null;
            this.Close();
        }
Example #29
0
        /**<summary>Saves the settings.</summary>*/
        public static void Save()
        {
            Settings.Default.TerrariaContentDirectory = TerrariaContentDirectory;
            Settings.Default.CurrentTab            = CurrentTab.ToString();
            Settings.Default.AutoCloseProgress     = AutoCloseProgress;
            Settings.Default.AutoCloseDropProgress = AutoCloseDropProgress;
            Settings.Default.AutoCloseCmdProgress  = AutoCloseCmdProgress;
            Settings.Default.CompressImages        = CompressImages;
            Settings.Default.CompletionSound       = CompletionSound;
            Settings.Default.PremultiplyAlpha      = PremultiplyAlpha;

            Settings.Default.ExtractFolderInput  = Extract.FolderInput;
            Settings.Default.ExtractFolderOutput = Extract.FolderOutput;
            Settings.Default.ExtractFileInput    = Extract.FileInput;
            Settings.Default.ExtractFileOutput   = Extract.FileOutput;

            Settings.Default.ConvertFolderInput  = Convert.FolderInput;
            Settings.Default.ConvertFolderOutput = Convert.FolderOutput;
            Settings.Default.ConvertFileInput    = Convert.FileInput;
            Settings.Default.ConvertFileOutput   = Convert.FileOutput;

            Settings.Default.BackupFolderContent = Backup.FolderContent;
            Settings.Default.BackupFolderBackup  = Backup.FolderBackup;

            Settings.Default.ScriptFile = Script.File;

            Settings.Default.ExtractMode = Extract.Mode.ToString();
            Settings.Default.ConvertMode = Convert.Mode.ToString();

            Settings.Default.ExtractAllowImages   = Extract.AllowImages;
            Settings.Default.ExtractAllowSounds   = Extract.AllowSounds;
            Settings.Default.ExtractAllowFonts    = Extract.AllowFonts;
            Settings.Default.ExtractAllowWaveBank = Extract.AllowWaveBank;
            Settings.Default.ExtractUseInput      = Extract.UseInput;

            Settings.Default.ConvertAllowImages = Convert.AllowImages;
            Settings.Default.ConvertAllowSounds = Convert.AllowSounds;
            Settings.Default.ConvertUseInput    = Convert.UseInput;

            Settings.Default.Save();
        }
        private void LoadStartingFromIDAction(object id)
        {
            if (!CurrentTab.IsAllTab())
            {
                return;
            }
            uint startFromID;
            uint i = id is uint?(uint)id : 0;

            if (i == 0)
            {
                string s = id as string;
                if (s == null)
                {
                    return;
                }
                if (!uint.TryParse(s, out startFromID))
                {
                    return;
                }
            }
            else
            {
                startFromID = i;
            }

            var da = CurrentTab.LoadEntries(startFromID);

            // let's select loaded entry
            if (da != null)
            {
                da.Completed += (sender, args) => {
                    foreach (Log9KEntry entry in LogEntriesCollectionView.Cast <Log9KEntry>().Where(entry => entry.ID == startFromID))
                    {
                        SelectedEntry = entry;
                    }
                };
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     Master.Page.Title = TITLE_TEXT + "Campaign Dashboard";
     //RadAjaxManager ram = (RadAjaxManager)this.Master.FindControl("RadAjaxManager1");
     //RadAjaxLoadingPanel alp = (RadAjaxLoadingPanel)this.Master.FindControl("AjaxLoadingPanel1");
     //ram.AjaxSettings.AddAjaxSetting(rgCampaignHistory, rgCampaignHistory, alp);
     //ram.AjaxSettings.AddAjaxSetting(rgCampaignHistory, rgCampaignHistory);
     //ram.AjaxSettings.AddAjaxSetting(rgCampaignHistory, tsCampaignDetails);
     //ram.AjaxSettings.AddAjaxSetting(rgCampaignHistory, mpCampaignDetails);
     //ram.AjaxSettings.AddAjaxSetting(tsCampaignDetails, tsCampaignDetails);
     //ram.AjaxSettings.AddAjaxSetting(tsCampaignDetails, mpCampaignDetails);
     if (!IsPostBack)
     {
         CurrentCampaignID = -1;
         CurrentTab        = 0;
         CurrentOverView   = null;
         CurrentTotals     = null;
         LoadCampaigns(true);
         tsCampaignDetails.SelectedIndex         = CurrentTab;
         mpCampaignDetails.PageViews[0].Selected = true;
         LoadDetailsByTab(CurrentTab.ToString(), true);
     }
 }
Example #32
0
 public void SubtractTalentPoints(CurrentTab tab, int index)
 {
     if (index > 4) return;
     switch (tab)
     {
         case CurrentTab.Core:
             if (Stats.coreTalentsArray[index] < 1) return;
             Stats.coreTalentsArray[index]--;
             Stats.coreTalentsArray[0]++;
             break;
         case CurrentTab.Offense:
             if (Stats.offenseTalentsArray[index] < 1) return;
             Stats.offenseTalentsArray[index]--;
             Stats.offenseTalentsArray[0]++;
             break;
         case CurrentTab.Defense:
             if (Stats.defenseTalentsArray[index] < 1) return;
             Stats.defenseTalentsArray[index]--;
             Stats.defenseTalentsArray[0]++;
             break;
         case CurrentTab.Utility:
             if (Stats.utilityTalentsArray[index] < 1) return;
             Stats.utilityTalentsArray[index] --;
             Stats.utilityTalentsArray[0]++;
             break;
         case CurrentTab.Bot:
             if (Stats.botTalentsArray[index] < 1) return;
             Stats.botTalentsArray[index]--;
             Stats.botTalentsArray[0]++;
             break;
     }
     RecalculateStats();
 }
Example #33
0
 public void ResetTalentPoints(CurrentTab tab)
 {
     switch (tab)
     {
         case CurrentTab.Core:
             Stats.coreTalentsArray[0] = Stats.coreTalentsArray.Sum();
             for (int i = 1; i < Stats.coreTalentsArray.Length; i++)
             {
                 Stats.coreTalentsArray[i] = 0;
             }
             break;
         case CurrentTab.Offense:
             Stats.offenseTalentsArray[0] = Stats.offenseTalentsArray.Sum();
             for (int i = 1; i < Stats.offenseTalentsArray.Length; i++)
             {
                 Stats.offenseTalentsArray[i] = 0;
             }
             break;
         case CurrentTab.Defense:
             Stats.defenseTalentsArray[0] = Stats.defenseTalentsArray.Sum();
             for (int i = 1; i < Stats.defenseTalentsArray.Length; i++)
             {
                 Stats.defenseTalentsArray[i] = 0;
             }
             break;
         case CurrentTab.Utility:
             Stats.utilityTalentsArray[0] = Stats.utilityTalentsArray.Sum();
             for (int i = 1; i < Stats.utilityTalentsArray.Length; i++)
             {
                 Stats.utilityTalentsArray[i] = 0;
             }
             break;
         case CurrentTab.Bot:
             Stats.botTalentsArray[0] = Stats.botTalentsArray.Sum();
             for (int i = 1; i < Stats.botTalentsArray.Length; i++)
             {
                 Stats.botTalentsArray[i] = 0;
             }
             break;
     }
 }
Example #34
0
 public int GetAmountOfUnspentCorePoints(CurrentTab tab)
 {
     switch (tab)
     {
         case CurrentTab.Core:
             return Stats.coreTalentsArray[0];
         case CurrentTab.Offense:
             return Stats.offenseTalentsArray[0];
         case CurrentTab.Defense:
             return Stats.defenseTalentsArray[0];
         case CurrentTab.Utility:
             return Stats.utilityTalentsArray[0];
         case CurrentTab.Bot:
             return Stats.botTalentsArray[0];
         default:
             return 0;
     }
 }
Example #35
0
 public int GetAmountOfTalentPoints(CurrentTab tab, int index)
 {
     if (index > 4 || index < 0) return 0;
     switch (tab)
     {
         case CurrentTab.Core:
             return Stats.coreTalentsArray[index];
         case CurrentTab.Offense:
             return Stats.offenseTalentsArray[index];
         case CurrentTab.Defense:
             return Stats.defenseTalentsArray[index];
         case CurrentTab.Utility:
             return Stats.utilityTalentsArray[index];
         case CurrentTab.Bot:
             return Stats.botTalentsArray[index];
         default:
             return 0;
     }
 }