Esempio n. 1
0
        public StartPageView(IWorkingEnvironment environment, StartPageViewFactory factory)
            : base(Guids.StartPageView, environment)
        {
            Verify.Argument.IsNotNull(factory, "factory");

            InitializeComponent();

            _picLogo.Image  = GetLogo();
            _picLogo2.Image = GetGradient();

            _factory = factory;

            Text = Resources.StrStartPage;

            _lstLocalRepositories.ItemActivated  += OnLocalRepositoriesListItemActivated;
            _lstRecentRepositories.ItemActivated += OnRecentRepositoriesListItemActivated;

            _lstLocalRepositories.DragEnter += OnLocalRepositoriesDragEnter;
            _lstLocalRepositories.DragDrop  += OnLocalRepositoriesDragDrop;

            _lstLocalRepositories.KeyDown  += OnLocalRepositoriesKeyDown;
            _lstRecentRepositories.KeyDown += OnRecentRepositoriesKeyDown;

            _chkClosePageAfterRepositoryLoad                   = GitterApplication.Style.CreateCheckBox();
            _chkClosePageAfterRepositoryLoad.Text              = Resources.StrsClosePageAfterRepositoryLoad;
            _chkClosePageAfterRepositoryLoad.Control.Bounds    = new Rectangle(9, 491, 199, 20);
            _chkClosePageAfterRepositoryLoad.Control.Anchor    = AnchorStyles.Left | AnchorStyles.Bottom;
            _chkClosePageAfterRepositoryLoad.Control.Parent    = this;
            _chkClosePageAfterRepositoryLoad.IsChecked         = _factory.CloseAfterRepositoryLoad;
            _chkClosePageAfterRepositoryLoad.IsCheckedChanged += _chkClosePageAfterRepositoryLoad_CheckedChanged;

            _chkShowPageAtStartup                   = GitterApplication.Style.CreateCheckBox();
            _chkShowPageAtStartup.Text              = Resources.StrsShowPageOnStartup;
            _chkShowPageAtStartup.Control.Bounds    = new Rectangle(9, 511, 199, 20);
            _chkShowPageAtStartup.Control.Anchor    = AnchorStyles.Left | AnchorStyles.Bottom;
            _chkShowPageAtStartup.Control.Parent    = this;
            _chkShowPageAtStartup.IsChecked         = _factory.ShowOnStartup;
            _chkShowPageAtStartup.IsCheckedChanged += _chkShowPageAtStartup_CheckedChanged;

            _separator1.BackColor = GitterApplication.Style.Colors.Separator;
            _separator2.BackColor = GitterApplication.Style.Colors.Separator;

            _recentRepositoriesBinding = new NotifyCollectionBinding <RepositoryLink>(
                _lstRecentRepositories.Items,
                WorkingEnvironment.RepositoryManagerService.RecentRepositories,
                repo => new RecentRepositoryListItem(repo));
        }
Esempio n. 2
0
        public StartPageView(IWorkingEnvironment environment, StartPageViewFactory factory)
            : base(Guids.StartPageView, environment)
        {
            Verify.Argument.IsNotNull(factory, "factory");

            InitializeComponent();

            _picLogo.Image = GetLogo();
            _picLogo2.Image = GetGradient();

            _factory = factory;

            Text = Resources.StrStartPage;

            _lstLocalRepositories.ItemActivated += OnLocalRepositoriesListItemActivated;
            _lstRecentRepositories.ItemActivated += OnRecentRepositoriesListItemActivated;

            _lstLocalRepositories.DragEnter += OnLocalRepositoriesDragEnter;
            _lstLocalRepositories.DragDrop += OnLocalRepositoriesDragDrop;

            _lstLocalRepositories.KeyDown += OnLocalRepositoriesKeyDown;
            _lstRecentRepositories.KeyDown += OnRecentRepositoriesKeyDown;

            _chkClosePageAfterRepositoryLoad = GitterApplication.Style.CreateCheckBox();
            _chkClosePageAfterRepositoryLoad.Text = Resources.StrsClosePageAfterRepositoryLoad;
            _chkClosePageAfterRepositoryLoad.Control.Bounds = new Rectangle(9, 491, 199, 20);
            _chkClosePageAfterRepositoryLoad.Control.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            _chkClosePageAfterRepositoryLoad.Control.Parent = this;
            _chkClosePageAfterRepositoryLoad.IsChecked = _factory.CloseAfterRepositoryLoad;
            _chkClosePageAfterRepositoryLoad.IsCheckedChanged += _chkClosePageAfterRepositoryLoad_CheckedChanged;

            _chkShowPageAtStartup = GitterApplication.Style.CreateCheckBox();
            _chkShowPageAtStartup.Text = Resources.StrsShowPageOnStartup;
            _chkShowPageAtStartup.Control.Bounds = new Rectangle(9, 511, 199, 20);
            _chkShowPageAtStartup.Control.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            _chkShowPageAtStartup.Control.Parent = this;
            _chkShowPageAtStartup.IsChecked = _factory.ShowOnStartup;
            _chkShowPageAtStartup.IsCheckedChanged += _chkShowPageAtStartup_CheckedChanged;

            _separator1.BackColor = GitterApplication.Style.Colors.Separator;
            _separator2.BackColor = GitterApplication.Style.Colors.Separator;

            _recentRepositoriesBinding = new NotifyCollectionBinding<RepositoryLink>(
                _lstRecentRepositories.Items,
                WorkingEnvironment.RepositoryManagerService.RecentRepositories,
                repo => new RecentRepositoryListItem(repo));
        }
Esempio n. 3
0
        public StartPageView(IWorkingEnvironment environment, StartPageViewFactory factory)
            : base(Guids.StartPageView, environment)
        {
            Verify.Argument.IsNotNull(factory, nameof(factory));

            InitializeComponent();

            _picLogo.Image  = GetLogo();
            _picLogo2.Image = GetGradient();

            _factory      = factory;
            _repositories = new List <RepositoryListItem>();

            Text = Resources.StrStartPage;

            _txtFilter.BackColor     = GitterApplication.Style.Colors.Window;
            _txtFilter.HintForeColor = GitterApplication.Style.Colors.GrayText;
            _txtFilter.TextForeColor = GitterApplication.Style.Colors.WindowText;

            _lstLocalRepositories.SizeChanged += (s, e) =>
            {
                var x = _lstLocalRepositories.Width + _lstLocalRepositories.Left - _txtFilter.Width;
                if (x > _lblLocalRepositories.Left + _lblLocalRepositories.Width)
                {
                    _txtFilter.Left    = x;
                    _txtFilter.Visible = true;
                }
                else
                {
                    _txtFilter.Visible = false;
                }
            };

            _txtFilter.TextChanged += OnFilterTextChanged;

            _lstLocalRepositories.ItemActivated  += OnLocalRepositoriesListItemActivated;
            _lstRecentRepositories.ItemActivated += OnRecentRepositoriesListItemActivated;

            _lstLocalRepositories.DragEnter += OnLocalRepositoriesDragEnter;
            _lstLocalRepositories.DragDrop  += OnLocalRepositoriesDragDrop;

            _lstLocalRepositories.KeyDown  += OnLocalRepositoriesKeyDown;
            _lstRecentRepositories.KeyDown += OnRecentRepositoriesKeyDown;

            _chkClosePageAfterRepositoryLoad                   = GitterApplication.Style.CreateCheckBox();
            _chkClosePageAfterRepositoryLoad.Text              = Resources.StrsClosePageAfterRepositoryLoad;
            _chkClosePageAfterRepositoryLoad.Control.Bounds    = new Rectangle(9, 491, 199, 20);
            _chkClosePageAfterRepositoryLoad.Control.Anchor    = AnchorStyles.Left | AnchorStyles.Bottom;
            _chkClosePageAfterRepositoryLoad.Control.Parent    = this;
            _chkClosePageAfterRepositoryLoad.IsChecked         = _factory.CloseAfterRepositoryLoad;
            _chkClosePageAfterRepositoryLoad.IsCheckedChanged += _chkClosePageAfterRepositoryLoad_CheckedChanged;

            _chkShowPageAtStartup                   = GitterApplication.Style.CreateCheckBox();
            _chkShowPageAtStartup.Text              = Resources.StrsShowPageOnStartup;
            _chkShowPageAtStartup.Control.Bounds    = new Rectangle(9, 511, 199, 20);
            _chkShowPageAtStartup.Control.Anchor    = AnchorStyles.Left | AnchorStyles.Bottom;
            _chkShowPageAtStartup.Control.Parent    = this;
            _chkShowPageAtStartup.IsChecked         = _factory.ShowOnStartup;
            _chkShowPageAtStartup.IsCheckedChanged += _chkShowPageAtStartup_CheckedChanged;

            _separator1.BackColor = GitterApplication.Style.Colors.Separator;
            _separator2.BackColor = GitterApplication.Style.Colors.Separator;

            _recentRepositoriesBinding = new NotifyCollectionBinding <RepositoryLink>(
                _lstRecentRepositories.Items,
                WorkingEnvironment.RepositoryManagerService.RecentRepositories,
                repo => new RecentRepositoryListItem(repo));
        }