Exemplo n.º 1
0
        private void OnRouteEditCommand(ISPContentState spContentState)
        {
            NavigationParameters _par = new NavigationParameters();

            _par.Add(typeof(ISPContentState).Name, spContentState);
            Context.RequestNavigate(Infrastructure.ViewNames.RouteEditorStateName, _par);
        }
Exemplo n.º 2
0
        //INavigationAware
        /// <summary>
        /// Called when the implementer has been navigated to.
        /// </summary>
        /// <param name="navigationContext">The navigation context <see cref="NavigationContext"/>.</param>
        public override void OnNavigatedTo(NavigationContext navigationContext)
        {
            base.OnNavigatedTo(navigationContext);
            RestoreSettings();
            ISPContentState _spContentState = (ISPContentState)navigationContext.Parameters[typeof(ISPContentState).Name];

            Debug.Assert(_spContentState != null, string.Format("{0} parameter cannot be null while navigating to ArchivingViewModel.", typeof(ISPContentState).Name));
            Debug.Assert(_spContentState.SPConnected == true, "SP has to be connected before navigating to ArchivingViewModel.");
            Debug.Assert(!String.IsNullOrEmpty(_spContentState.SharePointWebsiteURL), "SharePoint Website URL cannot be empty.");
            URL = _spContentState.SharePointWebsiteURL;
            ISQLContentState _sqlContentState = (ISQLContentState)navigationContext.Parameters[typeof(ISQLContentState).Name];

            Debug.Assert(_sqlContentState != null, string.Format("{0} parameter cannot be null while navigating to ArchivingViewModel.", typeof(ISPContentState).Name));
            Debug.Assert(_sqlContentState.SQLConnected == true, "SP has to be connected before navigating to ArchivingViewModel.");
            Debug.Assert(!String.IsNullOrEmpty(_sqlContentState.SQLConnectionString), "Connection string cannot be empty.");
            SQLServer            = _sqlContentState.SQLConnectionString;
            SyncLastRunDate      = _sqlContentState.SyncLastRunDate.LocalizedString();
            SyncLastRunBy        = _sqlContentState.SyncLastRunBy.GetValueOrDefault(Settings.Default.RunByUnknown);
            CleanupLastRunDate   = _sqlContentState.CleanupLastRunDate.LocalizedString();
            CleanupLastRunBy     = _sqlContentState.CleanupLastRunBy.GetValueOrDefault(Settings.Default.RunByUnknown);
            ArchivingLastRunDate = _sqlContentState.ArchivingLastRunDate.LocalizedString();
            ArchivingLastRunBy   = _sqlContentState.ArchivingLastRunBy.GetValueOrDefault(Settings.Default.RunByUnknown);
            //Log the current state.
            string _msg = String.Format("OnNavigatedTo - created view model {0} for SharePoint: {1} and database {2}.", typeof(ArchivingViewModel).Name, URL, SQLServer);

            m_loggingService.Log(_msg, Category.Debug, Priority.Low);
        }
Exemplo n.º 3
0
        private void OnArchiveCommand(ISPContentState spContentState, ISQLContentState sqlContentState)
        {
            NavigationParameters _par = new NavigationParameters();

            _par.Add(typeof(ISPContentState).Name, spContentState);
            _par.Add(typeof(ISQLContentState).Name, sqlContentState);
            Context.RequestNavigate(Infrastructure.ViewNames.ArchivalStateName, _par);
        }