Esempio n. 1
0
        public MainViewW()
        {
            InitializeComponent();

            Application.Current.Properties["migrationmode"] = "server";

            m_baseViewModel = new BaseViewModel();

            m_introViewModel = new IntroViewModel(lbMode);
            m_introViewModel.Name = "IntroViewModel";
            m_introViewModel.ViewTitle = "Welcome";
            m_introViewModel.lb = lbMode;
            m_introViewModel.isBrowser = true;

            Intro intro = new Intro();

            m_introViewModel.WelcomeMsg = intro.WelcomeMsg;
            m_introViewModel.InstallDir = intro.InstallDir;
            m_introViewModel.SetupViews(true);
            m_introViewModel.AddViews(true);

            lbMode.SelectedIndex = 0;
            DataContext = m_introViewModel;
        }
Esempio n. 2
0
        public void LoadConfig(Config config)
        {
            using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                // ========================
                // Import Options
                // ========================
                ImportMailOptions        = config.ImportOptions.Mail;
                ImportCalendarOptions    = config.ImportOptions.Calendar;
                ImportContactOptions     = config.ImportOptions.Contacts;
                ImportDeletedItemOptions = config.ImportOptions.DeletedItems;
                ImportJunkOptions        = config.ImportOptions.Junk;
                ImportTaskOptions        = config.ImportOptions.Tasks;
                ImportSentOptions        = config.ImportOptions.Sent;
                ImportRuleOptions        = config.ImportOptions.Rules;
                ImportOOOOptions         = config.ImportOptions.OOO;
                SetNextState();

                // ========================
                // Advanced Import Options
                // ========================
                MigrateONRAfter = config.AdvancedImportOptions.MigrateOnOrAfter.ToShortDateString();
                IsOnOrAfter     = config.AdvancedImportOptions.IsOnOrAfter;

                MaxMessageSize = config.AdvancedImportOptions.MaxMessageSize;

                DateFilterItem = config.AdvancedImportOptions.DateFilterItem;

                IsSkipPrevMigratedItems = config.AdvancedImportOptions.IsSkipPrevMigratedItems;
                IsMaxMessageSize        = config.AdvancedImportOptions.IsMaxMessageSize;
                IsSkipFolders           = config.AdvancedImportOptions.IsSkipFolders;
                SpecialCharReplace      = config.AdvancedImportOptions.SpecialCharReplace;
                MaxRetries = config.AdvancedImportOptions.MaxRetries;


                // DCB_BUG_104613 If cfg file says "Public Folders Migration", override this if this is not a server mig
                bool           bIsServerMig = true;
                IntroViewModel ivm          = ((IntroViewModel)ViewModelPtrs[(int)ViewType.INTRO]);
                if (ivm != null)
                {
                    bIsServerMig = ivm.rbServerMigration;
                }
                IsPublicFolders = bIsServerMig && config.AdvancedImportOptions.IsPublicFolders;

                IsZDesktop = config.AdvancedImportOptions.IsZDesktop;

                // ========================
                // General Options
                // ========================
                if (config.GeneralOptions != null)  // so old config files will work
                {
                    // Having read loglevel from the config XML, write it to the global log level
                    Log.SetLogLevel(Log.LogLevelStr2Enum(config.GeneralOptions.LogLevel));

                    MaxThreadCount = config.GeneralOptions.MaxThreadCount;
                    MaxErrorCount  = config.GeneralOptions.MaxErrorCount;
                }

                // ========================
                // ========================
                string returnval = "";
                returnval     = ConvertToCSV(config.AdvancedImportOptions.FoldersToSkip, ",");
                FoldersToSkip = returnval;

                // ========================
                // User provision
                // ========================
                savedDomain = config.UserProvision.DestinationDomain;
            }
        }