Esempio n. 1
0
        public MainWindow()
        {
            dc.UseSSL       = true;
            dc.HostName     = "imap.gmail.com";
            dc.UserName     = "******";
            dc.UserPassword = "******";
            dc.Port         = 993;

            this.DataContext = dc;

            InitializeComponent();

            var history = Persister.GetConnectionHistory();

            if (history != null && history.Any())
            {
                SelectHistory.Items.Add(new ComboBoxItem()
                {
                    IsEnabled = false, IsSelected = true, Content = "Select Credentials"
                });
                foreach (var item in history)
                {
                    SelectHistory.Items.Add(new ComboBoxItem()
                    {
                        Content = string.Format("{0}\n{1}", item.HostName, item.UserName), DataContext = item
                    });
                }
            }
            else
            {
                SelectHistory.Visibility = Visibility.Collapsed;
            }
        }