コード例 #1
0
ファイル: Account.cs プロジェクト: cixonline/cixreader
 /// <summary>
 /// This notification is triggered if the profile was updated from the
 /// server. We're only interested if the profile is for the current user.
 /// </summary>
 /// <param name="sender">The profiles task</param>
 /// <param name="args">Profile event arguments specifying the profile affected</param>
 private void OnProfileUpdated(object sender, ProfileEventArgs args)
 {
     Platform.UIThread(this, delegate
     {
         if (args.Profile.Username == CIX.Username)
         {
             RefreshAccount(args.Profile, false);
         }
     });
 }
コード例 #2
0
ファイル: ProfileView.cs プロジェクト: cixonline/cixreader
 /// <summary>
 /// Handle the event that is sent when a profile is updated. If the profile is the
 /// one we're displaying here, update what is displayed in the viewer.
 /// </summary>
 private void OnProfileUpdated(object sender, ProfileEventArgs args)
 {
     Platform.UIThread(this, delegate
     {
         if (_thisProfile != null && args.Profile.Username == _thisProfile.Username)
         {
             DisplayProfile();
         }
     });
 }
コード例 #3
0
        private void OnProfileEventReceived(System.Object aSource, ProfileEventArgs aArgs)
        {
            ExecuteSecure(() =>
            {
                //ConsoleWriteLine("Profile event received: " + aArgs.EventType.ToString());

                if (aArgs.EventType == ProfileEventType.ProfileNamesReceived && aArgs.ProfileUpdated)
                {
                    //Program.ShowInfoMessageBox(this, "Profile has been updated", "The application will close all features that are no longer authorized");
                }
                else if (aArgs.EventType == ProfileEventType.ProfileReceived)
                {
                    // Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                    //{
                    //MakeBtnEnable();
                    try
                    {
                        //getCamDeviceList();
                        CameraStateChangeEventListen();
                        AlarmEventListen(_connection.SessionContext.AlarmService);
                        // btnStatrlisten.IsEnabled = false;
                    }
                    catch (Exception ex)
                    {
                    }
                    //}));
                }

                if (aArgs.EventType == ProfileEventType.ProfileNamesReceived)
                {
                    System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        try
                        {
                            var _test = session.ProfileService.CurrentProfile;
                            IList <string> profileNames      = session.ProfileService.ProfileNames;
                            _comboBoxProfileNames.DataSource = profileNames;
                            if (profileNames.Count > 0)
                            {
                                _comboBoxProfileNames.SelectedIndex = 0;
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    }));
                }
                else if (aArgs.EventType == ProfileEventType.ProfileReceived)
                {
                    //BuildProfileTree(SessionContext.ProfileService.CurrentProfile);
                }
            });
        }
コード例 #4
0
 public void ProfileEvent(object sender, ProfileEventArgs e)
 {
     try
     {
         if (e.PanelBinding.PanelType == _streamDeckPanel.TypeOfPanel && _streamDeckPanel.HIDInstance == e.PanelBinding.HIDInstance)
         {
             LoadComboBoxLayers();
         }
     }
     catch (Exception ex)
     {
         Common.ShowErrorMessageBox(ex);
     }
 }
 public void ProfileEvent(object sender, ProfileEventArgs e)
 {
     try
     {
         if (e.PanelBinding.PanelType == GamingPanelEnum.PZ55SwitchPanel && _switchPanelPZ55.HIDInstance == e.PanelBinding.HIDInstance)
         {
             ShowGraphicConfiguration();
         }
     }
     catch (Exception ex)
     {
         Common.ShowErrorMessageBox(ex);
     }
 }
コード例 #6
0
 public void ProfileEvent(object sender, ProfileEventArgs e)
 {
     try
     {
         if (e.PanelBinding.PanelType == GamingPanelEnum.TPM && _tpmPanel.HIDInstance.Equals(e.PanelBinding.HIDInstance))
         {
             ShowGraphicConfiguration();
         }
     }
     catch (Exception ex)
     {
         Common.ShowErrorMessageBox(ex);
     }
 }
コード例 #7
0
        /// <summary>
        /// Save profile.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void SaveProfile(object sender, ProfileEventArgs e)
        {
            bool moveFirst   = false;
            var  profileList = _previewProfileController.GetProfilesByPortal(e.Profile.PortalId);

            if (e.Profile.Id == Null.NullInteger)
            {
                moveFirst = true;
            }

            //save profile
            _previewProfileController.Save(e.Profile);

            //if the profile is new, then move it to the top of list.
            if (moveFirst && profileList.Count > 0)
            {
                int moveId = e.Profile.Id;
                int nextId = profileList[0].Id;

                SortProfiles(moveId, nextId);
            }
        }
 public void ProfileEvent(object sender, ProfileEventArgs e)
 {
 }
コード例 #9
0
 private void OnProfileSelected(ProfileEventArgs args)
 {
     View.SelectProfile(args.Profile);
 }
コード例 #10
0
 private void OnProfileSaved(ProfileEventArgs args)
 {
     View.UpdateProfile(args.Profile);
 }
コード例 #11
0
 /// <summary>
 ///     Handles the CurrentStartupProjectsChanged event of the SolutionProxy control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ProfileEventArgs" /> instance containing the event data.</param>
 private void SolutionProxy_CurrentStartupProjectsChanged(object sender, ProfileEventArgs e)
 {
     UpdateCurrentStartupProjectService(e.Profile);
 }
コード例 #12
0
 void ActiveProfileChanged(object sender, ProfileEventArgs e)
 {
     CaptureRegion = e.Profile.CaptureRegion;
 }
コード例 #13
0
 void ChangeProfile(object sender, ProfileEventArgs e)
 {
     ChangeProfile(e.Profile);
 }
コード例 #14
0
 void RemoveDeletedProfile(object sender, ProfileEventArgs e)
 {
     AvailableProfiles.Remove(e.Profile);
 }
コード例 #15
0
 void AddCreatedProfile(object sender, ProfileEventArgs e)
 {
     AvailableProfiles.Add(e.Profile);
 }
コード例 #16
0
 public void OnActiveProfileChanged(ProfileEventArgs e)
 {
     EventHandler<ProfileEventArgs> handler = ActiveProfileChanged;
     if (handler != null)
     {
         handler(this, e);
     }
 }
コード例 #17
0
        private void OnProfileChanged(object sender, ProfileEventArgs e)
        {
            this.game = e.ActiveGameInstance;
            this.timerCheckFiles.Enabled = false;
            while (true)
            {
                try
                {
                    IniFiles.Load(game);
                    break;
                }
                catch (IniParsingException exc)
                {
                    DialogResult result = FormIniError.OpenDialog(exc);
                    if (result == DialogResult.Retry)
                    {
                        continue;
                    }
                    else if (result == DialogResult.Ignore)
                    {
                        continue;
                    }
                    else if (result == DialogResult.Abort)
                    {
                        Environment.Exit(-1);
                        return;
                    }
                    //MsgBox.Get("iniParsingError").FormatText(exc.Message).Show(MessageBoxIcon.Error);
                    //Application.Exit();
                    //return;
                }
            }
            LinkedTweaks.LoadValues();
            // TODO: For some reason, it won't update the resolution combobox, unless I add this workaround:
            numCustomRes_ValueChanged(null, null);

            // Change image
            switch (e.ActiveGameInstance.Edition)
            {
            case GameEdition.Steam:
                this.pictureBoxGameEdition.Image          = Resources.steam;
                this.toolStripStatusLabelEditionText.Text = "Steam";
                this.labelGameEdition.Text = "Steam";
                break;

            case GameEdition.BethesdaNet:
                this.pictureBoxGameEdition.Image          = Resources.bethesda;
                this.toolStripStatusLabelEditionText.Text = "Bethesda.net";
                this.labelGameEdition.Text = "Bethesda";
                break;

            case GameEdition.BethesdaNetPTS:
                this.pictureBoxGameEdition.Image          = Resources.bethesda_pts;
                this.toolStripStatusLabelEditionText.Text = "Bethesda.net (PTS)";
                this.labelGameEdition.Text = "Bethesda\n(PTS)";
                break;

            case GameEdition.MSStore:
                this.pictureBoxGameEdition.Image          = Resources.msstore;
                this.toolStripStatusLabelEditionText.Text = "Microsoft Store";
                this.labelGameEdition.Text = "Microsoft\nStore";
                break;

            default:
                this.pictureBoxGameEdition.Image          = Resources.help_128;
                this.toolStripStatusLabelEditionText.Text = Localization.GetString("unknown");
                this.labelGameEdition.Text = Localization.GetString("unknown");
                break;
            }

            LoadAccountProfile();
            LoadCustomTab();

            this.toolStripStatusLabelGameText.Text = e.ActiveGameInstance?.Title;
            this.timerCheckFiles.Enabled           = true;
        }
コード例 #18
0
ファイル: ProfileManager.cs プロジェクト: kmees/NMagnify
 public void OnProfileCreated(ProfileEventArgs e)
 {
     EventHandler<ProfileEventArgs> handler = ProfileCreated;
     if (handler != null)
     {
         handler(this, e);
     }
 }