public RepositoryConfigurationListItem(IWorkingEnvironment environment) : base(CachedResources.Bitmaps["ImgConfiguration"], Resources.StrConfig) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; }
public RepositoryRemotesListItem(IWorkingEnvironment environment) : base(CachedResources.Bitmaps["ImgRemotes"], Resources.StrRemotes) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; }
protected RepositoryExplorerItemBase(IWorkingEnvironment env, TeamCityGuiProvider guiProvider, Bitmap image, string text) { _environment = env; _guiProvider = guiProvider; _image = image; _text = text; }
public RepositoryContributorsListItem(IWorkingEnvironment environment) : base(CachedResources.Bitmaps["ImgUsers"], Resources.StrContributors) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; }
public RepositoryStashListItem(IWorkingEnvironment environment) : base(CachedResources.Bitmaps["ImgStash"], Resources.StrStash) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; }
/// <summary>Create <see cref="AddParameterDialog"/>.</summary> /// <param name="environment">Application environment.</param> /// <param name="configFile">Config file to use.</param> public AddParameterDialog(IWorkingEnvironment environment, ConfigFile configFile) : this(environment) { Verify.Argument.IsFalse(configFile != ConfigFile.System && configFile != ConfigFile.User, "configFile"); _configFile = configFile; }
public void AttachToEnvironment(IWorkingEnvironment environment) { Verify.Argument.IsNotNull(environment, "environment"); _repositoryExplorer = new RepositoryExplorer(environment, this); environment.ProvideRepositoryExplorerItem(_repositoryExplorer.RootItem); }
public ConfigurationPage(IWorkingEnvironment environment) : base(Guid) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; InitializeComponent(); _lstSystemConfig.Style = GitterApplication.DefaultStyle; _lstUserConfig.Style = GitterApplication.DefaultStyle; _pageUser.Text = Resources.StrCurrentUser; _pageSystem.Text = Resources.StrSystem; _btnAddUserParameter.Text = Resources.StrAddParameter; _btnAddSystemParameter.Text = Resources.StrAddParameter; var gitAccessor = environment.RepositoryProviders .OfType<IGitRepositoryProvider>() .First() .GitAccessor; _userCfg = ConfigurationFile.OpenCurrentUserFile(gitAccessor); _systemCfg = ConfigurationFile.OpenSystemFile(gitAccessor); _lstUserConfig.LoadData(_userCfg); _lstSystemConfig.LoadData(_systemCfg); }
public RepositoryHistoryListItem(IWorkingEnvironment environment) : base(CachedResources.Bitmaps["ImgHistory"], Resources.StrHistory) { if(environment == null) throw new System.ArgumentNullException("environment"); _environment = environment; }
public RepositoryExplorerView(IWorkingEnvironment environment) : base(Guids.RepositoryExplorerView, environment) { InitializeComponent(); Text = Resources.StrRepositoryExplorer; }
public RepositoryRootItem(IWorkingEnvironment environment, string repository) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; _repository = repository; Expand(); }
/// <summary>Create <see cref="AddParameterDialog"/>.</summary> /// <param name="environment">Application environment.</param> /// <param name="repository">Related <see cref="Repository"/>.</param> public AddParameterDialog(IWorkingEnvironment environment, Repository repository) : this(environment) { Verify.Argument.IsNotNull(repository, "repository"); _repository = repository; _configFile = ConfigFile.Repository; }
public RepositoryExplorerViewFactory(IWorkingEnvironment environment) : base(Guids.RepositoryExplorerView, Resources.StrRepositoryExplorer, CachedResources.Bitmaps["ImgRepositoryExplorer"], true) { Verify.Argument.IsNotNull(environment, "environment"); _rootItem = new RepositoryRootItem(environment, null); DefaultViewPosition = ViewPosition.Left; }
public RepositoryExplorer(IWorkingEnvironment environment, RedmineGuiProvider guiProvider) { Verify.Argument.IsNotNull(environment, "environment"); Verify.Argument.IsNotNull(guiProvider, "guiProvider"); _service = guiProvider.ServiceContext; _rootItem = new RepositoryExplorerRootListItem(environment, guiProvider); }
public RepositoryExplorerRootListItem(IWorkingEnvironment env, RedmineGuiProvider guiProvider) : base(env, guiProvider, CachedResources.Bitmaps["ImgRedmine"], Resources.StrRedmine) { Items.Add(new RepositoryExplorerNewsListItem(env, guiProvider)); Items.Add(new RepositoryExplorerIssuesListItem(env, guiProvider)); Items.Add(new RepositoryExplorerVersionsListItem(env, guiProvider)); Expand(); }
/// <summary>Create <see cref="ViewBase"/>.</summary> public ViewBase(Guid guid, IWorkingEnvironment environment) : this() { Verify.Argument.IsNotNull(environment, "environment"); _guid = guid; _environment = environment; }
public void DetachFromEnvironment(IWorkingEnvironment environment) { Verify.Argument.IsNotNull(environment, "environment"); var views1 = environment.ViewDockService.FindViews(Guids.BuildTypeBuildsViewGuid).ToList(); foreach(var view in views1) view.Close(); environment.RemoveRepositoryExplorerItem(_repositoryExplorer.RootItem); _repositoryExplorer = null; }
public RedmineMenu(IWorkingEnvironment environment, RedmineGuiProvider guiProvider) { Verify.Argument.IsNotNull(environment, "environment"); Verify.Argument.IsNotNull(guiProvider, "guiProvider"); _workingEnvironment = environment; _guiProvider = guiProvider; Items.Add(new ToolStripMenuItem("Setup...", null, OnSetupClick)); }
public WebBrowserView(Guid guid, IWorkingEnvironment environment) : base(guid, environment) { InitializeComponent(); Text = Resources.StrWebBrowser; //_webBrowser.DocumentCompleted += OnWebBrowserDocumentCompleted; AddTopToolStrip(_toolbar = new WebBrowserViewToolbar(this)); }
public void DetachFromEnvironment(IWorkingEnvironment environment) { var views1 = environment.ViewDockService.FindViews(Guids.IssuesViewGuid).ToList(); foreach(var view in views1) view.Close(); var views2 = environment.ViewDockService.FindViews(Guids.NewsViewGuid).ToList(); foreach(var view in views2) view.Close(); var views3 = environment.ViewDockService.FindViews(Guids.VersionsViewGuid).ToList(); foreach(var view in views3) view.Close(); environment.RemoveRepositoryExplorerItem(_repositoryExplorer.RootItem); _repositoryExplorer = null; }
public OptionsDialog(IWorkingEnvironment environment) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; InitializeComponent(); Text = Resources.StrOptions; _lstOptions.Style = GitterApplication.DefaultStyle; _propertyPages = new Dictionary<Guid, PropertyPage>(); }
public PropertyPage CreatePropertyPage(IWorkingEnvironment environment) { Verify.Argument.IsNotNull(environment, "environment"); if(_getPropertyPage != null) { return _getPropertyPage(environment); } else { return null; } }
/// <summary>Initializes a new instance of the <see cref="LogView"/> class.</summary> public LogView(IWorkingEnvironment environment) : base(LogViewFactory.Guid, environment) { Height = 200; _logListBox = new LogListBox() { BorderStyle = BorderStyle.None, Dock = DockStyle.Fill, Parent = this, }; Text = Resources.StrLog; }
/// <summary>Create <see cref="AddParameterDialog"/>.</summary> /// <param name="environment">Application environment.</param> private AddParameterDialog(IWorkingEnvironment environment) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; InitializeComponent(); Text = Resources.StrAddParameter; _lblName.Text = Resources.StrName.AddColon(); _lblValue.Text = Resources.StrValue.AddColon(); GitterApplication.FontManager.InputFont.Apply(_txtName, _txtValue); }
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)); }
public UserIdentificationDialog(IWorkingEnvironment environment, Repository repository) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; _repository = repository; _repositoryProvider = environment.GetRepositoryProvider<RepositoryProvider>(); InitializeComponent(); Text = Resources.StrUserIdentification; _lblUser.Text = Resources.StrUsername.AddColon(); _lblEmail.Text = Resources.StrEmail.AddColon(); _lblUseThisUserNameAndEmail.Text = Resources.StrsUseThisUserNameAndEmail.AddColon(); _radSetUserGlobally.Text = Resources.StrsForCurrentWindowsUser; _radSetUserForRepositoryOnly.Text = Resources.StrsForCurrentRepositoryOnly; if(repository != null) { var userName = repository.Configuration.TryGetParameter(GitConstants.UserNameParameter); if(userName != null) { _txtUsername.Text = _oldUserName = userName.Value; } else { _txtUsername.Text = Environment.UserName; } var userEmail = repository.Configuration.TryGetParameter(GitConstants.UserEmailParameter); if(userEmail != null) { _txtEmail.Text = _oldUserEmail = userEmail.Value; } else { _txtEmail.Text = string.Format("{0}@{1}", Environment.UserName, Environment.UserDomainName); } } else { _radSetUserForRepositoryOnly.Enabled = false; } GitterApplication.FontManager.InputFont.Apply(_txtUsername, _txtEmail); }
public AddRepositoryDialog(IWorkingEnvironment environment, LocalRepositoriesListBox repositoriyList) { Verify.Argument.IsNotNull(environment, "environment"); Verify.Argument.IsNotNull(repositoriyList, "repositoriyList"); _environment = environment; _repositoryList = repositoriyList; InitializeComponent(); Text = Resources.StrAddRepository; _lblPath.Text = Resources.StrPath.AddColon(); _lblDescription.Text = Resources.StrDescription.AddColon(); GitterApplication.FontManager.InputFont.Apply(_txtPath, _txtDescription); }
public VersionCheckDialog( IWorkingEnvironment environment, IGitRepositoryProvider gitRepositoryProvider, Version requiredVersion, Version installedVersion) { Verify.Argument.IsNotNull(environment, "environment"); Verify.Argument.IsNotNull(gitRepositoryProvider, "gitRepositoryProvider"); Verify.Argument.IsNotNull(requiredVersion, "requiredVersion"); _environment = environment; _gitRepositoryProvider = gitRepositoryProvider; _requiredVersion = requiredVersion; _installedVersion = installedVersion; InitializeComponent(); Text = Resources.StrGitVersionCheck; if(_installedVersion == null) { _lblMessage.Text = Resources.MsgGitIsNotInstalled; _lblInstalledVersionValue.Text = Resources.StrlNotInstalled.SurroundWith("<", ">"); } else { _lblMessage.Text = Resources.MsgGitVersionIsOutdated; _lblInstalledVersionValue.Text = _installedVersion.ToString(); } _lblRequiredVersion.Text = Resources.StrRequiredVersion.AddColon(); _lblInstalledVersion.Text = Resources.StrInstalledVersion.AddColon(); _lblAdditionalMessage.Text = Resources.MsgGitSupportWillBeDisabled; _lnkRefresh.Text = Resources.StrlRefresh; _lnkGoToDownloadPage.Text = Resources.StrlGoToDownloadPage; _lnkConfigure.Text = Resources.StrlConfigure; _lnkRefreshLatestVersion.Text = Resources.StrlRefresh; _lnkDownload.Text = Resources.StrlDownload; _lblRequiredVersionValue.Text = _requiredVersion.ToString(); _lblLatestVersion.Text = Resources.StrLatestVersion.AddColon(); UpdateStatus(); }
public StandardToolbar(IWorkingEnvironment environment) { Verify.Argument.IsNotNull(environment, "environment"); _environment = environment; Text = Resources.StrStandard; const TextImageRelation tir = TextImageRelation.ImageAboveText; const ToolStripItemDisplayStyle ds = ToolStripItemDisplayStyle.ImageAndText; Items.AddRange(new ToolStripItem[] { _initRepositoryButton = new ToolStripButton(Resources.StrInit, CachedResources.Bitmaps["ImgRepositoryInitSmall"], OnInitRepositoryClick) { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipInit }, _cloneRepositoryButton = new ToolStripButton(Resources.StrClone, CachedResources.Bitmaps["ImgRepositoryCloneSmall"], OnCloneRepositoryClick) { TextImageRelation = tir, DisplayStyle = ds, ToolTipText = Resources.TipClone }, }); }
public BuildTypeBuildsView(IWorkingEnvironment environment) : base(Guids.BuildTypeBuildsViewGuid, environment) { _lstBuilds = new CustomListBox(); _lstBuilds.BorderStyle = System.Windows.Forms.BorderStyle.None; _lstBuilds.Columns.AddRange(new CustomListBoxColumn[] { new CustomListBoxColumn((int)ColumnId.Id, Resources.StrId) { Width = 50 }, new CustomListBoxColumn((int)ColumnId.Number, Resources.StrNumber) { Width = 150 }, new DateColumn((int)ColumnId.StartDate, Resources.StrStartDate, true) { Width = 150 }, new CustomListBoxColumn((int)ColumnId.Status, Resources.StrStatus) { Width = 100 }, }); _lstBuilds.Bounds = this.ClientRectangle; _lstBuilds.Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom; _lstBuilds.Parent = this; }
public void Execute(IWorkingEnvironment env) { _execute(env); }
protected override ViewBase CreateViewCore(IWorkingEnvironment environment) { return(new RemotesView(_guiProvider)); }
public PropertyPage CreatePropertyPage(IWorkingEnvironment environment) { Verify.Argument.IsNotNull(environment, nameof(environment)); return(_getPropertyPage?.Invoke(environment)); }
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)); }
public RepositoryExplorerIssuesListItem(IWorkingEnvironment env, RedmineGuiProvider guiProvider) : base(env, guiProvider, CachedResources.Bitmaps["ImgBug"], Resources.StrIssues) { }
/// <summary>Create <see cref="RedmineViewBase"/>.</summary> public TeamCityViewBase(Guid guid, IWorkingEnvironment environment) : base(guid, environment) { }
/// <summary>Create new view with specified parameters.</summary> /// <param name="environment">Application working environment.</param> /// <param name="parameters">Creation parameters.</param> /// <returns>Created view.</returns> protected override ViewBase CreateViewCore(IWorkingEnvironment environment) { return(new WebBrowserView(Guid, environment)); }
public bool LoadFor(IWorkingEnvironment environment, Section section) { Verify.Argument.IsNotNull(environment, nameof(environment)); if (section != null) { var providerName = section.GetValue <string>("AccessorProvider", string.Empty); if (!string.IsNullOrWhiteSpace(providerName)) { ActiveGitAccessorProvider = GitAccessorProviders.FirstOrDefault( prov => prov.Name == providerName); } if (ActiveGitAccessorProvider == null) { ActiveGitAccessorProvider = GitAccessorProviders.First(); } var gitAccessorSection = section.TryGetSection(ActiveGitAccessorProvider.Name); if (gitAccessorSection != null) { GitAccessor.LoadFrom(gitAccessorSection); } } else { ActiveGitAccessorProvider = GitAccessorProviders.First(); } Version gitVersion; try { gitVersion = _gitAccessor.GitVersion; } catch (Exception exc) when(!exc.IsCritical()) { gitVersion = null; } if (gitVersion == null || gitVersion < MinimumRequiredGitVersion) { using (var dlg = new VersionCheckDialog(environment, this, MinimumRequiredGitVersion, gitVersion)) { dlg.Run(environment.MainForm); gitVersion = dlg.InstalledVersion; if (gitVersion == null || gitVersion < _minVersion) { return(false); } } } GlobalOptions.RegisterPropertyPageFactory( new PropertyPageFactory( GitOptionsPage.Guid, Resources.StrGit, null, PropertyPageFactory.RootGroupGuid, env => new GitOptionsPage(env))); GlobalOptions.RegisterPropertyPageFactory( new PropertyPageFactory( ConfigurationPage.Guid, Resources.StrConfig, null, GitOptionsPage.Guid, env => new ConfigurationPage(env))); _environment = environment; _configSection = section; return(true); }
public RepositoryExplorerRootListItem(IWorkingEnvironment env, TeamCityGuiProvider guiProvider) : base(env, guiProvider, CachedResources.Bitmaps["ImgTeamCity"], Resources.StrTeamCity) { Expand(); }
public ViewMenuItem(IViewFactory factory, IWorkingEnvironment environment) : base(factory.Name, factory.Image, OnClick) { _factory = factory; _environment = environment; }
public static bool IsDev(this IWorkingEnvironment environment) { return(environment.EnvironmentName == EnvironmentNames.Dev); }
public static bool IsLocal(this IWorkingEnvironment environment) { return(environment.EnvironmentName == EnvironmentNames.Local); }
/// <summary>Create new view with specified parameters.</summary> /// <param name="environment">Application working environment.</param> /// <returns>Created view.</returns> protected override ViewBase CreateViewCore(IWorkingEnvironment environment) { return(new LogView(environment)); }
protected override ViewBase CreateViewCore(IWorkingEnvironment environment) { return(new DiffView(Guids.ContextualDiffViewGuid, _guiProvider)); }
public void AttachToEnvironment(IWorkingEnvironment environment) { _repositoryExplorer = new RepositoryExplorer(environment, this); environment.ProvideRepositoryExplorerItem(_repositoryExplorer.RootItem); }
/// <summary>Create new view with specified parameters.</summary> /// <param name="environment">Application working environment.</param> /// <returns>Created view.</returns> protected override ViewBase CreateViewCore(IWorkingEnvironment environment) { return(new StartPageView(environment, this)); }
/// <summary>Create <see cref="RedmineViewBase"/>.</summary> public RedmineViewBase(Guid guid, IWorkingEnvironment environment) : base(guid, environment) { }