public void PopulateConfig(bool isServer) { ConfigViewModelS serverSourceModel = (ConfigViewModelS)ViewModelPtrs[(int)ViewType.SVRSRC]; ConfigViewModelSDest serverDestModel = (ConfigViewModelSDest)ViewModelPtrs[(int)ViewType.SVRDEST]; ConfigViewModelU userSourceModel = (ConfigViewModelU)ViewModelPtrs[(int)ViewType.USRSRC]; ConfigViewModelUDest userDestModel = (ConfigViewModelUDest)ViewModelPtrs[(int)ViewType.USRDEST]; OptionsViewModel optionsModel = (OptionsViewModel)ViewModelPtrs[(int)ViewType.OPTIONS]; UsersViewModel usersModel = (UsersViewModel)ViewModelPtrs[(int)ViewType.USERS]; m_config.SourceServer.Profile = ""; if (isServer) { int sel = serverSourceModel.CurrentProfileSelection; if (sel != -1) { if (serverSourceModel.ProfileList.Count > 0) { m_config.SourceServer.Profile = serverSourceModel.ProfileList[sel]; } } m_config.SourceServer.Hostname = serverSourceModel.MailServerHostName; m_config.SourceServer.AdminID = serverSourceModel.MailServerAdminID; m_config.SourceServer.AdminPwd = serverSourceModel.MailServerAdminPwd; m_config.SourceServer.UseProfile = serverSourceModel.Isprofile; m_config.ZimbraServer.Hostname = serverDestModel.ZimbraServerHostName; m_config.ZimbraServer.Port = serverDestModel.ZimbraPort; m_config.ZimbraServer.AdminID = serverDestModel.ZimbraAdmin; m_config.ZimbraServer.AdminPwd = serverDestModel.ZimbraAdminPasswd; m_config.ZimbraServer.UseSSL = serverDestModel.ZimbraSSL; // FBS bug 73500 -- 5/18/12 if (usersModel.ZimbraDomain.Length == 0) { if (usersModel.DomainsFilledIn) { m_config.UserProvision.DestinationDomain = usersModel.DomainList[usersModel.CurrentDomainSelection]; } else if (savedDomain != null) { if (savedDomain.Length > 0) { m_config.UserProvision.DestinationDomain = savedDomain; } } } else { m_config.UserProvision.DestinationDomain = usersModel.ZimbraDomain; } // } else { int sel = userSourceModel.CurrentProfileSelection; if (sel != -1) { if (userSourceModel.ProfileList.Count > 0) { m_config.SourceServer.Profile = userSourceModel.ProfileList[sel]; } } m_config.SourceServer.DataFile = userSourceModel.PSTFile; m_config.SourceServer.UseProfile = userSourceModel.Isprofile; m_config.ZimbraServer.Hostname = userDestModel.ZimbraServerHostName; m_config.ZimbraServer.Port = userDestModel.ZimbraPort; m_config.ZimbraServer.UserAccount = userDestModel.ZimbraUser; m_config.ZimbraServer.UserPassword = userDestModel.ZimbraUserPasswd; } m_config.GeneralOptions.LogLevel = optionsModel.LogLevel; m_config.GeneralOptions.Verbose = optionsModel.LoggingVerbose; m_config.GeneralOptions.MaxThreadCount = optionsModel.MaxThreadCount; m_config.GeneralOptions.MaxErrorCount = optionsModel.MaxErrorCount; m_config.ImportOptions.Mail = optionsModel.ImportMailOptions; m_config.ImportOptions.Calendar = optionsModel.ImportCalendarOptions; m_config.ImportOptions.Contacts = optionsModel.ImportContactOptions; m_config.ImportOptions.DeletedItems = optionsModel.ImportDeletedItemOptions; m_config.ImportOptions.Junk = optionsModel.ImportJunkOptions; m_config.ImportOptions.Tasks = optionsModel.ImportTaskOptions; m_config.ImportOptions.Sent = optionsModel.ImportSentOptions; m_config.ImportOptions.Rules = optionsModel.ImportRuleOptions; m_config.ImportOptions.OOO = optionsModel.ImportOOOOptions; m_config.AdvancedImportOptions.IsOnOrAfter = optionsModel.IsOnOrAfter; m_config.AdvancedImportOptions.MigrateOnOrAfter = (optionsModel.IsOnOrAfter) ? DateTime.Parse(optionsModel.MigrateONRAfter) : DateTime.Now.AddMonths(-3); m_config.AdvancedImportOptions.IsSkipPrevMigratedItems = optionsModel.IsSkipPrevMigratedItems; m_config.AdvancedImportOptions.IsMaxMessageSize = optionsModel.IsMaxMessageSize; m_config.AdvancedImportOptions.MaxMessageSize = (optionsModel.IsMaxMessageSize) ? optionsModel.MaxMessageSize : ""; m_config.AdvancedImportOptions.DateFilterItem = optionsModel.DateFilterItem; m_config.AdvancedImportOptions.SpecialCharReplace = optionsModel.SpecialCharReplace; m_config.AdvancedImportOptions.CSVDelimiter = optionsModel.CSVDelimiter; m_config.AdvancedImportOptions.LangID = optionsModel.LangID; m_config.AdvancedImportOptions.IsPublicFolders = optionsModel.IsPublicFolders; // deal with skip folders m_config.AdvancedImportOptions.IsSkipFolders = optionsModel.IsSkipFolders; if (optionsModel.IsSkipFolders) { if (optionsModel.FoldersToSkip != null) { if (optionsModel.FoldersToSkip.Length > 0) { string[] nameTokens = optionsModel.FoldersToSkip.Split(','); int numToSkip = nameTokens.Length; if (m_config.AdvancedImportOptions.FoldersToSkip == null) { m_config.AdvancedImportOptions.FoldersToSkip = new Folder[numToSkip]; } for (int i = 0; i < numToSkip; i++) { Folder folder = new Folder(); folder.FolderName = nameTokens.GetValue(i).ToString(); m_config.AdvancedImportOptions.FoldersToSkip[i] = folder; } } } } else { m_config.AdvancedImportOptions.FoldersToSkip = null; } }
public void PopulateConfigForSaving(bool isServer) // Called from from ViewModel Save() methods to populate m_config before serializing to disk { using (LogBlock logblock = Log.NotTracing()?null: new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name)) { // Get ptr to each page from ViewModelPtrs ConfigViewModelS serverSourceModel = (ConfigViewModelS)ViewModelPtrs[(int)ViewType.SVRSRC]; ConfigViewModelSDest serverDestModel = (ConfigViewModelSDest)ViewModelPtrs[(int)ViewType.SVRDEST]; ConfigViewModelU userSourceModel = (ConfigViewModelU)ViewModelPtrs[(int)ViewType.USRSRC]; ConfigViewModelUDest userDestModel = (ConfigViewModelUDest)ViewModelPtrs[(int)ViewType.USRDEST]; OptionsViewModel optionsModel = (OptionsViewModel)ViewModelPtrs[(int)ViewType.OPTIONS]; UsersViewModel usersModel = (UsersViewModel)ViewModelPtrs[(int)ViewType.USERS]; ScheduleViewModel scheduleModel = (ScheduleViewModel)ViewModelPtrs[(int)ViewType.SCHED]; m_config.GeneralOptions.SchemaVersion = 1; // Schema version - increment if you change any of the options m_config.SourceServer.Profile = ""; if (isServer) { // ============================================================== // Server Migration // ============================================================== m_config.GeneralOptions.MigType = 1; // ------------------------------ // SourceServer // ------------------------------ int sel = serverSourceModel.CurrentProfileSelection; if (sel != -1) { if (serverSourceModel.ProfileList.Count > 0) { m_config.SourceServer.Profile = serverSourceModel.ProfileList[sel]; } } m_config.SourceServer.Hostname = serverSourceModel.MailServerHostName; m_config.SourceServer.AdminID = serverSourceModel.MailServerAdminID; m_config.SourceServer.AdminPwd = serverSourceModel.MailServerAdminPwd; m_config.SourceServer.UseProfile = serverSourceModel.Isprofile; // ------------------------------ // ZimbraServer (= dest server) // ------------------------------ m_config.ZimbraServer.Hostname = serverDestModel.ZimbraServerHostName; m_config.ZimbraServer.Port = serverDestModel.ZimbraPort; m_config.ZimbraServer.AdminID = serverDestModel.ZimbraAdmin; m_config.ZimbraServer.AdminPwd = serverDestModel.ZimbraAdminPasswd; m_config.ZimbraServer.UseSSL = serverDestModel.ZimbraSSL; // ------------------------------ // UserProvision // ------------------------------ // FBS bug 73500 -- 5/18/12 if (usersModel.ZimbraDomain.Length == 0) { if (usersModel.DomainsFilledIn) { m_config.UserProvision.DestinationDomain = usersModel.DomainList[usersModel.CurrentDomainSelection]; m_config.UserProvision.COS = scheduleModel.CosList[scheduleModel.CurrentCOSSelection].CosName; } else if (savedDomain != null) { if (savedDomain.Length > 0) { m_config.UserProvision.DestinationDomain = savedDomain; } } } else { m_config.UserProvision.DestinationDomain = usersModel.ZimbraDomain; m_config.UserProvision.COS = scheduleModel.COS; } } else { // ============================================================== // User Migration (or ZD) // ============================================================== m_config.GeneralOptions.MigType = 2; // ------------------------------ // SourceServer // ------------------------------ int sel = userSourceModel.CurrentProfileSelection; if (sel != -1) { if (userSourceModel.ProfileList.Count > 0) { m_config.SourceServer.Profile = userSourceModel.ProfileList[sel]; } } m_config.SourceServer.DataFile = userSourceModel.PSTFile; m_config.SourceServer.UseProfile = userSourceModel.Isprofile; // ------------------------------ // ZimbraServer (= dest server) // ------------------------------ m_config.ZimbraServer.Hostname = userDestModel.ZimbraServerHostName; m_config.ZimbraServer.Port = userDestModel.ZimbraPort; m_config.ZimbraServer.UserAccount = userDestModel.ZimbraUser; m_config.ZimbraServer.UserPassword = userDestModel.ZimbraUserPasswd; m_config.ZimbraServer.UseSSL = userDestModel.ZimbraSSL; } /* * DCB - Where is the block for ZD settings?! */ // ============================================================== // Common to Server and User migration // ============================================================== // ------------------------------ // GeneralOptions // ------------------------------ m_config.GeneralOptions.LogLevel = Log.GlobalLogLevel.ToString(); m_config.GeneralOptions.MaxThreadCount = optionsModel.MaxThreadCount; m_config.GeneralOptions.MaxErrorCount = optionsModel.MaxErrorCount; // ------------------------------ // ImportOptions // ------------------------------ m_config.ImportOptions.Mail = optionsModel.ImportMailOptions; m_config.ImportOptions.Calendar = optionsModel.ImportCalendarOptions; m_config.ImportOptions.Contacts = optionsModel.ImportContactOptions; m_config.ImportOptions.DeletedItems = optionsModel.ImportDeletedItemOptions; m_config.ImportOptions.Junk = optionsModel.ImportJunkOptions; m_config.ImportOptions.Tasks = optionsModel.ImportTaskOptions; m_config.ImportOptions.Sent = optionsModel.ImportSentOptions; m_config.ImportOptions.Rules = optionsModel.ImportRuleOptions; m_config.ImportOptions.OOO = optionsModel.ImportOOOOptions; // ------------------------------ // AdvancedImportOptions // ------------------------------ m_config.AdvancedImportOptions.IsOnOrAfter = optionsModel.IsOnOrAfter; m_config.AdvancedImportOptions.MigrateOnOrAfter = (optionsModel.IsOnOrAfter) ? DateTime.Parse(optionsModel.MigrateONRAfter) : DateTime.Now.AddMonths(-3); m_config.AdvancedImportOptions.IsSkipPrevMigratedItems = optionsModel.IsSkipPrevMigratedItems; m_config.AdvancedImportOptions.IsMaxMessageSize = optionsModel.IsMaxMessageSize; m_config.AdvancedImportOptions.MaxMessageSize = (optionsModel.IsMaxMessageSize) ? optionsModel.MaxMessageSize : ""; m_config.AdvancedImportOptions.DateFilterItem = optionsModel.DateFilterItem; m_config.AdvancedImportOptions.SpecialCharReplace = optionsModel.SpecialCharReplace; m_config.AdvancedImportOptions.CSVDelimiter = optionsModel.CSVDelimiter; m_config.AdvancedImportOptions.IsPublicFolders = optionsModel.IsPublicFolders; m_config.AdvancedImportOptions.IsZDesktop = optionsModel.IsZDesktop; // Skipped folders m_config.AdvancedImportOptions.IsSkipFolders = optionsModel.IsSkipFolders; if (optionsModel.IsSkipFolders) { if (optionsModel.FoldersToSkip != null) { if (optionsModel.FoldersToSkip.Length > 0) { string[] nameTokens = optionsModel.FoldersToSkip.Split(','); int numToSkip = nameTokens.Length; if (m_config.AdvancedImportOptions.FoldersToSkip == null) { m_config.AdvancedImportOptions.FoldersToSkip = new Folder[numToSkip]; } for (int i = 0; i < numToSkip; i++) { Folder folder = new Folder(); folder.FolderName = nameTokens.GetValue(i).ToString(); m_config.AdvancedImportOptions.FoldersToSkip[i] = folder; } } } } else { m_config.AdvancedImportOptions.FoldersToSkip = null; } } }
public void SetupViews(bool isBrowser) { m_isBrowser = isBrowser; BaseViewModel.isServer = true; // because we start out with Server on -- wouldn't get set by command IsServerMigration = true; IsUserMigration = false; savedDomain = ""; ZimbraValues.GetZimbraValues().ClientVersion = BuildNum; m_configViewModelS = new ConfigViewModelS(); m_configViewModelS.Name = "ConfigViewModelS"; m_configViewModelS.ViewTitle = "Source"; m_configViewModelS.lb = lb; m_configViewModelS.isBrowser = isBrowser; m_configViewModelS.OutlookProfile = ""; m_configViewModelS.MailServerHostName = ""; m_configViewModelS.MailServerAdminID = ""; m_configViewModelS.MailServerAdminPwd = ""; m_configViewModelU = new ConfigViewModelU(); m_configViewModelU.Name = "ConfigViewModelU"; m_configViewModelU.ViewTitle = "Source"; m_configViewModelU.lb = lb; m_configViewModelU.isBrowser = isBrowser; m_configViewModelU.OutlookProfile = ""; m_configViewModelU.PSTFile = ""; m_configViewModelU.OutlookProfile = ""; m_configViewModelSDest = new ConfigViewModelSDest(); m_configViewModelSDest.Name = "ConfigViewModelSDest"; m_configViewModelSDest.ViewTitle = "Destination"; m_configViewModelSDest.lb = lb; m_configViewModelSDest.isBrowser = isBrowser; m_configViewModelSDest.ZimbraServerHostName = ""; m_configViewModelSDest.ZimbraPort = ""; m_configViewModelSDest.ZimbraAdmin = ""; m_configViewModelSDest.ZimbraAdminPasswd = ""; m_configViewModelSDest.ZimbraSSL = true; m_configViewModelUDest = new ConfigViewModelUDest(); m_configViewModelUDest.Name = "ConfigViewModelUDest"; m_configViewModelUDest.ViewTitle = "Destination"; m_configViewModelUDest.lb = lb; m_configViewModelUDest.isBrowser = isBrowser; m_configViewModelUDest.ZimbraServerHostName = ""; m_configViewModelUDest.ZimbraPort = ""; m_configViewModelUDest.ZimbraUser = ""; m_configViewModelUDest.ZimbraUserPasswd = ""; m_configViewModelUDest.ZimbraSSL = true; m_optionsViewModel = new OptionsViewModel(); m_optionsViewModel.Name = "OptionsViewModel"; m_optionsViewModel.ViewTitle = "Options"; m_optionsViewModel.lb = lb; m_optionsViewModel.isBrowser = isBrowser; m_optionsViewModel.ImportMailOptions = true; m_optionsViewModel.ImportTaskOptions = true; m_optionsViewModel.ImportCalendarOptions = true; m_optionsViewModel.ImportContactOptions = true; m_optionsViewModel.ImportRuleOptions = true; m_optionsViewModel.ImportOOOOptions = true; m_optionsViewModel.ImportJunkOptions = false; m_optionsViewModel.ImportDeletedItemOptions = false; m_optionsViewModel.ImportSentOptions = false; m_optionsViewModel.LoggingVerbose = false; m_optionsViewModel.LogLevel = LogLevel.Info.ToString(); m_optionsViewModel.MaxThreadCount = 0; m_optionsViewModel.MaxErrorCount = 0; m_optionsViewModel.OEnableRulesAndOOO = true; m_optionsViewModel.OEnableNext = true; m_optionsViewModel.MigrateONRAfter = (DateTime.Now.AddMonths(-3)).ToShortDateString(); m_optionsViewModel.IsMaxMessageSize = false; m_optionsViewModel.IsSkipPrevMigratedItems = false; m_optionsViewModel.MaxMessageSize = ""; m_optionsViewModel.IsSkipFolders = false; m_scheduleViewModel = new ScheduleViewModel(); m_scheduleViewModel.Name = "Schedule"; m_scheduleViewModel.ViewTitle = "Migrate"; m_scheduleViewModel.lb = lb; m_scheduleViewModel.isBrowser = isBrowser; m_scheduleViewModel.COS = "default"; m_scheduleViewModel.DefaultPWD = ""; m_scheduleViewModel.ScheduleDate = DateTime.Now.ToShortDateString(); m_scheduleViewModel.EnableProvGB = false; m_usersViewModel = new UsersViewModel("", ""); m_usersViewModel.Name = "Users"; m_usersViewModel.ViewTitle = "Users"; m_usersViewModel.lb = lb; m_usersViewModel.ZimbraDomain = ""; m_usersViewModel.isBrowser = isBrowser; m_usersViewModel.CurrentUserSelection = -1; m_usersViewModel.svm = m_scheduleViewModel; // LDAP Browser needs to get to ScheduleView to set EnableMigrate m_resultsViewModel = new AccountResultsViewModel(m_scheduleViewModel, -1, 0, "", "", "", 0, "", 0, 0, false); m_resultsViewModel.Name = "Results"; m_resultsViewModel.ViewTitle = "Results"; m_resultsViewModel.isBrowser = isBrowser; m_resultsViewModel.CurrentAccountSelection = -1; m_resultsViewModel.OpenLogFileEnabled = false; SetupViewModelPtrs(); TheViews = new ObservableCollection <object>(); TheViews.Add(this); }
public void SetupViews(bool isBrowser) { m_isBrowser = isBrowser; BaseViewModel.isServer = true; // because we start out with Server on -- wouldn't get set by command IsServerMigration = true; IsUserMigration = false; savedDomain = ""; ZimbraValues.GetZimbraValues().ClientVersion = BuildNum; m_configViewModelS = new ConfigViewModelS(); m_configViewModelS.Name = "ConfigViewModelS"; m_configViewModelS.ViewTitle = "Source"; m_configViewModelS.lb = lb; m_configViewModelS.isBrowser = isBrowser; m_configViewModelS.OutlookProfile = ""; m_configViewModelS.MailServerHostName = ""; m_configViewModelS.MailServerAdminID = ""; m_configViewModelS.MailServerAdminPwd = ""; m_configViewModelU = new ConfigViewModelU(); m_configViewModelU.Name = "ConfigViewModelU"; m_configViewModelU.ViewTitle = "Source"; m_configViewModelU.lb = lb; m_configViewModelU.isBrowser = isBrowser; m_configViewModelU.OutlookProfile = ""; m_configViewModelU.PSTFile = ""; m_configViewModelU.OutlookProfile = ""; m_configViewModelSDest = new ConfigViewModelSDest(); m_configViewModelSDest.Name = "ConfigViewModelSDest"; m_configViewModelSDest.ViewTitle = "Destination"; m_configViewModelSDest.lb = lb; m_configViewModelSDest.isBrowser = isBrowser; m_configViewModelSDest.ZimbraServerHostName = ""; m_configViewModelSDest.ZimbraPort = ""; m_configViewModelSDest.ZimbraAdmin = ""; m_configViewModelSDest.ZimbraAdminPasswd = ""; m_configViewModelSDest.ZimbraSSL = true; m_configViewModelUDest = new ConfigViewModelUDest(); m_configViewModelUDest.Name = "ConfigViewModelUDest"; m_configViewModelUDest.ViewTitle = "Destination"; m_configViewModelUDest.lb = lb; m_configViewModelUDest.isBrowser = isBrowser; m_configViewModelUDest.ZimbraServerHostName = ""; m_configViewModelUDest.ZimbraPort = ""; m_configViewModelUDest.ZimbraUser = ""; m_configViewModelUDest.ZimbraUserPasswd = ""; m_configViewModelUDest.ZimbraSSL = true; m_optionsViewModel = new OptionsViewModel(); m_optionsViewModel.Name = "OptionsViewModel"; m_optionsViewModel.ViewTitle = "Options"; m_optionsViewModel.lb = lb; m_optionsViewModel.isBrowser = isBrowser; m_optionsViewModel.ImportMailOptions = true; m_optionsViewModel.ImportTaskOptions = true; m_optionsViewModel.ImportCalendarOptions = true; m_optionsViewModel.ImportContactOptions = true; m_optionsViewModel.ImportRuleOptions = true; m_optionsViewModel.ImportOOOOptions = true; m_optionsViewModel.ImportJunkOptions = false; m_optionsViewModel.ImportDeletedItemOptions = false; m_optionsViewModel.ImportSentOptions = false; m_optionsViewModel.LoggingVerbose = false; m_optionsViewModel.LogLevel = LogLevel.Info.ToString(); m_optionsViewModel.MaxThreadCount = 0; m_optionsViewModel.MaxErrorCount = 0; m_optionsViewModel.OEnableRulesAndOOO = true; m_optionsViewModel.OEnableNext = true; m_optionsViewModel.MigrateONRAfter = (DateTime.Now.AddMonths(-3)).ToShortDateString(); m_optionsViewModel.IsMaxMessageSize = false; m_optionsViewModel.IsSkipPrevMigratedItems = false; m_optionsViewModel.MaxMessageSize = ""; m_optionsViewModel.IsSkipFolders = false; m_scheduleViewModel = new ScheduleViewModel(); m_scheduleViewModel.Name = "Schedule"; m_scheduleViewModel.ViewTitle = "Migrate"; m_scheduleViewModel.lb = lb; m_scheduleViewModel.isBrowser = isBrowser; m_scheduleViewModel.COS = "default"; m_scheduleViewModel.DefaultPWD = ""; m_scheduleViewModel.ScheduleDate = DateTime.Now.ToShortDateString(); m_scheduleViewModel.EnableProvGB = false; m_usersViewModel = new UsersViewModel("", ""); m_usersViewModel.Name = "Users"; m_usersViewModel.ViewTitle = "Users"; m_usersViewModel.lb = lb; m_usersViewModel.ZimbraDomain = ""; m_usersViewModel.isBrowser = isBrowser; m_usersViewModel.CurrentUserSelection = -1; m_usersViewModel.svm = m_scheduleViewModel; // LDAP Browser needs to get to ScheduleView to set EnableMigrate m_resultsViewModel = new AccountResultsViewModel(m_scheduleViewModel, -1, 0, "", "", "", 0, "", 0, 0, false); m_resultsViewModel.Name = "Results"; m_resultsViewModel.ViewTitle = "Results"; m_resultsViewModel.isBrowser = isBrowser; m_resultsViewModel.CurrentAccountSelection = -1; m_resultsViewModel.OpenLogFileEnabled = false; SetupViewModelPtrs(); TheViews = new ObservableCollection<object>(); TheViews.Add(this); }
public void SetupViews(bool isBrowser) { using (LogBlock logblock = Log.NotTracing()?null: new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name)) { m_isBrowser = isBrowser; BaseViewModel.isServer = true; // because we start out with Server on -- wouldn't get set by command rbServerMigration = true; rbUserMigration = false; savedDomain = ""; ZimbraValues.GetZimbraValues().ClientVersion = BuildNum; // ------------------------------------------------------------ // Source pages // ------------------------------------------------------------ // Server mig version m_configViewModelS = new ConfigViewModelS(); m_configViewModelS.Name = "ConfigViewModelS"; m_configViewModelS.ViewTitle = "Source"; m_configViewModelS.lb = lb; m_configViewModelS.isBrowser = isBrowser; m_configViewModelS.OutlookProfile = ""; m_configViewModelS.MailServerHostName = ""; m_configViewModelS.MailServerAdminID = ""; m_configViewModelS.MailServerAdminPwd = ""; // User mig version m_configViewModelU = new ConfigViewModelU(); m_configViewModelU.Name = "ConfigViewModelU"; m_configViewModelU.ViewTitle = "Source"; m_configViewModelU.lb = lb; m_configViewModelU.isBrowser = isBrowser; m_configViewModelU.OutlookProfile = ""; m_configViewModelU.PSTFile = ""; m_configViewModelU.OutlookProfile = ""; // ZD mig version m_configViewModelZU = new ConfigViewModelZU(); m_configViewModelZU.Name = "ConfigViewModelZU"; m_configViewModelZU.ViewTitle = "Source"; m_configViewModelZU.lb = lb; m_configViewModelZU.isBrowser = isBrowser; m_configViewModelZU.OutlookProfile = ""; m_configViewModelZU.PSTFile = ""; m_configViewModelZU.OutlookProfile = ""; // ------------------------------------------------------------ // Destination pages // ------------------------------------------------------------ // Server mig version m_configViewModelSDest = new ConfigViewModelSDest(); m_configViewModelSDest.Name = "ConfigViewModelSDest"; m_configViewModelSDest.ViewTitle = "Destination"; m_configViewModelSDest.lb = lb; m_configViewModelSDest.isBrowser = isBrowser; m_configViewModelSDest.ZimbraServerHostName = ""; m_configViewModelSDest.ZimbraPort = ""; m_configViewModelSDest.ZimbraAdmin = ""; m_configViewModelSDest.ZimbraAdminPasswd = ""; m_configViewModelSDest.ZimbraSSL = true; // User mig version m_configViewModelUDest = new ConfigViewModelUDest(); m_configViewModelUDest.Name = "ConfigViewModelUDest"; m_configViewModelUDest.ViewTitle = "Destination"; m_configViewModelUDest.lb = lb; m_configViewModelUDest.isBrowser = isBrowser; m_configViewModelUDest.ZimbraServerHostName = ""; m_configViewModelUDest.ZimbraPort = ""; m_configViewModelUDest.ZimbraUser = ""; m_configViewModelUDest.ZimbraUserPasswd = ""; m_configViewModelUDest.ZimbraSSL = true; // ZD mig version // (No dest page for ZD) // ------------------------------------------------------------ // Option page // ------------------------------------------------------------ m_optionsViewModel = new OptionsViewModel(); m_optionsViewModel.Name = "OptionsViewModel"; m_optionsViewModel.ViewTitle = "Options"; m_optionsViewModel.lb = lb; m_optionsViewModel.isBrowser = isBrowser; m_optionsViewModel.ImportMailOptions = true; m_optionsViewModel.ImportTaskOptions = true; m_optionsViewModel.ImportCalendarOptions = true; m_optionsViewModel.ImportContactOptions = true; m_optionsViewModel.ImportRuleOptions = true; m_optionsViewModel.ImportOOOOptions = true; m_optionsViewModel.ImportJunkOptions = false; m_optionsViewModel.ImportDeletedItemOptions = false; m_optionsViewModel.ImportSentOptions = false; m_optionsViewModel.MaxThreadCount = 0; m_optionsViewModel.MaxErrorCount = 0; m_optionsViewModel.OEnableRulesAndOOO = true; m_optionsViewModel.OEnablePF = true; m_optionsViewModel.OEnableNext = true; m_optionsViewModel.MigrateONRAfter = (DateTime.Now.AddMonths(-3)).ToShortDateString(); m_optionsViewModel.IsMaxMessageSize = false; m_optionsViewModel.IsSkipPrevMigratedItems = false; m_optionsViewModel.MaxMessageSize = ""; m_optionsViewModel.IsSkipFolders = false; // ------------------------------------------------------------ // Scedule page // ------------------------------------------------------------ m_scheduleViewModel = new ScheduleViewModel(); m_scheduleViewModel.Name = "Schedule"; m_scheduleViewModel.ViewTitle = "Migrate"; m_scheduleViewModel.lb = lb; m_scheduleViewModel.isBrowser = isBrowser; m_scheduleViewModel.COS = "default"; m_scheduleViewModel.DefaultPWD = ""; m_scheduleViewModel.ScheduleDate = DateTime.Now.ToShortDateString(); m_scheduleViewModel.EnableProvGB = false; // ------------------------------------------------------------ // Users page // ------------------------------------------------------------ m_usersViewModel = new UsersViewModel("", ""); m_usersViewModel.Name = "Users"; m_usersViewModel.ViewTitle = "Users"; m_usersViewModel.lb = lb; m_usersViewModel.ZimbraDomain = ""; m_usersViewModel.isBrowser = isBrowser; m_usersViewModel.CurrentUserSelection = -1; m_usersViewModel.svm = m_scheduleViewModel; // LDAP Browser needs to get to ScheduleView to set EnableMigrate // ------------------------------------------------------------ // Public folders page // ------------------------------------------------------------ m_publicfoldersViewModel = new PublicfoldersViewModel("", ""); m_publicfoldersViewModel.Name = "PublicFolders"; m_publicfoldersViewModel.ViewTitle = "Public Folders"; m_publicfoldersViewModel.lb = lb; m_publicfoldersViewModel.ZimbraDomain = ""; m_publicfoldersViewModel.isBrowser = isBrowser; m_publicfoldersViewModel.svm = m_scheduleViewModel; // LDAP Browser needs to get to ScheduleView to set EnableMigrate // ------------------------------------------------------------ // Results page // ------------------------------------------------------------ m_resultsViewModel = new AccountResultsViewModel(m_scheduleViewModel, -1, "", false); m_resultsViewModel.Name = "Results"; m_resultsViewModel.ViewTitle = "Results"; m_resultsViewModel.isBrowser = isBrowser; m_resultsViewModel.CurrentAccountSelection = -1; m_resultsViewModel.OpenLogFileEnabled = false; SetupViewModelPtrs(); TheViews = new ObservableCollection <object>(); TheViews.Add(this); } }