Exemple #1
0
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            SyncConflictsPageModelController pageModelController = new SyncConflictsPageModelController();
            UPMOrganizer syncConflictOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("SyncConflictsOrganizer"))
            {
                ExpandFound  = true,
                SubtitleText = LocalizedString.TextSyncConflictsTitle
            };

            this.ShouldShowTabsForSingleTab = false;
            UPMOrganizerAction retryAction       = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.retry"));
            UPMOrganizerAction reportErrorAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.report"));
            string             retryText         = LocalizedString.Localize(LocalizationKeys.TextGroupBasic, LocalizationKeys.KeyBasicSyncConflictsRetryAll, "Retry All");

            retryAction.LabelText = retryText;
            retryAction.IconName  = "Icon:Record";
            retryAction.SetTargetAction(this, this.RetryAll);
            this.AddOrganizerHeaderActionItem(retryAction);
            IOfflineStorage offlineStorage = UPOfflineStorage.DefaultStorage;

            if (!string.IsNullOrEmpty(ConfigurationUnitStore.DefaultStore.ConfigValue("Sync.ConflictEmailAddress")) &&
                offlineStorage.ConflictRequests?.Count > 1 &&
                !string.IsNullOrEmpty(offlineStorage.OfflineRequestXml()))
            {
                string sendRequestXmlText = LocalizedString.Localize(LocalizationKeys.TextGroupBasic, LocalizationKeys.KeyBasicSyncConflictsReportAllErrors, "Report all errors");
                reportErrorAction.LabelText = sendRequestXmlText;
                reportErrorAction.SetTargetAction(this, this.ReportAllErrors);
                this.AddOrganizerHeaderActionItem(reportErrorAction);
            }

            this.AddPageModelController(pageModelController);
            syncConflictOrganizer.AddPage(pageModelController.Page);
            this.TopLevelElement = syncConflictOrganizer;
        }
        /// <summary>
        /// Builds the pages from view reference.
        /// </summary>
        public override void BuildPagesFromViewReference()
        {
            SyncConflictsPageModelController pageModelController = new SyncConflictsPageModelController();
            UPMOrganizer syncConflictOrganizer = new UPMOrganizer(StringIdentifier.IdentifierWithStringId("SyncConflictOrganizer"))
            {
                ExpandFound                  = true,
                DisplaysTitleText            = true,
                LineCountAdditionalTitletext = 1,
                SubtitleText                 = LocalizedString.TextSyncConflictsTitle,
                TitleText           = this.SyncConflict.MainField.StringValue,
                AdditionalTitleText = (string)this.SyncConflict.DetailField?.FieldValue
            };

            this.ShouldShowTabsForSingleTab = false;
            if (this.IsDiscardAllowed())
            {
                UPMOrganizerAction discardAction = new UPMOrganizerAction(StringIdentifier.IdentifierWithStringId("action.discard"))
                {
                    LabelText = LocalizedString.Localize(LocalizationKeys.TextGroupBasic,
                                                         LocalizationKeys.KeyBasicSyncConflictsActionDiscardChanges, "DISCARD CONFLICT"),
                    IconName = "Icon:Trash"
                };

                discardAction.SetTargetAction(this, this.DiscardError);
                this.AddOrganizerHeaderActionItem(discardAction);
            }

            this.AddPageModelController(pageModelController);
            syncConflictOrganizer.AddPage(pageModelController.Page);
            this.TopLevelElement = syncConflictOrganizer;
        }
 /// <summary>
 /// Reports the error.
 /// </summary>
 /// <param name="actionDictionary">The action dictionary.</param>
 private void ReportError(object actionDictionary)
 {
     foreach (UPPageModelController pageModelController in this.PageModelControllers)
     {
         SyncConflictsPageModelController ctrl = pageModelController as SyncConflictsPageModelController;
         ctrl?.ReportErrorForConflict(this.SyncConflict);
     }
 }
 /// <summary>
 /// Discards the error.
 /// </summary>
 /// <param name="actionDictionary">The action dictionary.</param>
 private void DiscardError(object actionDictionary)
 {
     foreach (UPPageModelController pageModelController in this.PageModelControllers)
     {
         SyncConflictsPageModelController ctrl = pageModelController as SyncConflictsPageModelController;
         ctrl?.DiscardChangesForConflictAsync(this.SyncConflict);
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="UPSyncConflictsDetailOrganizerModelController"/> class.
        /// </summary>
        /// <param name="syncConflict">The synchronize conflict.</param>
        public UPSyncConflictsDetailOrganizerModelController(UPMSyncConflict syncConflict)
            : base(null, new UPOrganizerInitOptions(true, true))
        {
            this.SyncConflict = syncConflict;
            this.BuildPagesFromViewReference();

            foreach (UPPageModelController pageModelController in this.PageModelControllers)
            {
                SyncConflictsPageModelController ctrl = pageModelController as SyncConflictsPageModelController;
                ctrl?.Page.AddChild(this.SyncConflict);
            }
        }
Exemple #6
0
        /// <summary>
        /// Reports all errors.
        /// </summary>
        /// <param name="actionDictionary">The action dictionary.</param>
        private void ReportAllErrors(object actionDictionary)
        {
            SyncConflictsPageModelController syncPageModelController = this.SyncPageModelController;

            syncPageModelController.ReportAllError();
        }
Exemple #7
0
        /// <summary>
        /// Retries all.
        /// </summary>
        /// <param name="actionDictionary">The action dictionary.</param>
        private void RetryAll(object actionDictionary)
        {
            SyncConflictsPageModelController syncPageModelController = this.SyncPageModelController;

            syncPageModelController.RetryAllConflicts();
        }