private void HandleCredentialsUpdatedEvent(object sender,
                                                   CollectionUpdatedEventArgs <ICredentialRecord>
                                                   collectionUpdatedEventArgs)
        {
            var repo = sender as ICredentialRepository;

            repo?.SaveCredentials(repo.Config.Key);
        }
Пример #2
0
 private void CredentialRepositoryListOnCredentialsUpdated(object sender, CollectionUpdatedEventArgs <ICredentialRecord> collectionUpdatedEventArgs)
 {
     SetObjectList();
 }
Пример #3
0
 private void CredentialRepositoryListOnRepositoriesUpdated(object sender, CollectionUpdatedEventArgs <ICredentialRepository> arg)
 {
     SetObjectList();
 }
Пример #4
0
 private void OnRepositoriesUpdated(object sender, CollectionUpdatedEventArgs <ICredentialRepository> args)
 {
     SetListObjects(CredentialRepositoryList.CredentialProviders);
 }
 protected virtual void RaiseCredentialsUpdatedEvent(object sender,
                                                     CollectionUpdatedEventArgs <ICredentialRecord> args)
 {
     CredentialsUpdated?.Invoke(this, args);
 }
Пример #6
0
 private void RaiseCredentialsUpdatedEvent(object sender, CollectionUpdatedEventArgs <ICredentialRecord> args)
 {
     CredentialsUpdated?.Invoke(sender, args);
 }
Пример #7
0
 private void CurrentlySelectedExternalToolsOnCollectionUpdated(object sender,
                                                                CollectionUpdatedEventArgs <ExternalTool>
                                                                collectionUpdatedEventArgs)
 {
     UpdateEditorControls();
 }
 private void HandleRepositoriesUpdatedEvent(object sender,
                                             CollectionUpdatedEventArgs <ICredentialRepository>
                                             collectionUpdatedEventArgs)
 {
     SaveRepositoryList();
 }
Пример #9
0
        static void OnForumPageUpdated(object sender, CollectionUpdatedEventArgs<Awful.Models.ThreadData> e)
        {
            SAForumPage page = sender as SAForumPage;
            if (page == null) return;

            ThreadPool.QueueUserWorkItem(state =>
                {
                    try
                    {
                        using (var db = new SAForumDB())
                        {
                            foreach (var item in e.Collection)
                            {
                                var thread = item as SAThread;
                                if (thread != null)
                                {
                                    var query = from t in db.Threads
                                                where t.ID == thread.ID
                                                select t;

                                    var single = query.SingleOrDefault();

                                    if (single == null) { db.Threads.InsertOnSubmit(thread); }
                                }
                            }

                            db.SubmitChanges(ConflictMode.FailOnFirstConflict);
                        }
                    }

                    catch (Exception ex)
                    {
                        string error = string.Format("An error occurred while updating the Thread DB: [{0}] {1}", ex.Message, ex.StackTrace);
                        Awful.Core.Event.Logger.AddEntry(error);
                    }

                }, null);
        }