當前位置: 首頁>>代碼示例>>C#>>正文


C# GitRepository.GetBranches方法代碼示例

本文整理匯總了C#中MonoDevelop.VersionControl.Git.GitRepository.GetBranches方法的典型用法代碼示例。如果您正苦於以下問題:C# GitRepository.GetBranches方法的具體用法?C# GitRepository.GetBranches怎麽用?C# GitRepository.GetBranches使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MonoDevelop.VersionControl.Git.GitRepository的用法示例。


在下文中一共展示了GitRepository.GetBranches方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EditBranchDialog

		public EditBranchDialog (GitRepository repo, string name, string tracking)
		{
			this.Build ();
			this.repo = repo;
			oldName = name;
			currentTracking = tracking;

			this.UseNativeContextMenus ();

			comboStore = new ListStore (typeof(string), typeof(Xwt.Drawing.Image), typeof (string), typeof(string));
			comboSources.Model = comboStore;
			var crp = new CellRendererImage ();
			comboSources.PackStart (crp, false);
			comboSources.AddAttribute (crp, "image", 1);
			var crt = new CellRendererText ();
			comboSources.PackStart (crt, true);
			comboSources.AddAttribute (crt, "text", 2);

			SemanticModelAttribute modelAttr = new SemanticModelAttribute ("comboStore__Branch", "comboStore__Icon", "comboStore__Name", "comboStore__Tracking");
			TypeDescriptor.AddAttributes (comboStore, modelAttr);

			foreach (Branch b in repo.GetBranches ()) {
				AddValues (b.FriendlyName, ImageService.GetIcon ("vc-branch", IconSize.Menu), "refs/heads/");
			}

			foreach (Remote r in repo.GetRemotes ()) {
				foreach (string b in repo.GetRemoteBranches (r.Name))
					AddValues (r.Name + "/" + b, ImageService.GetIcon ("vc-repository", IconSize.Menu), "refs/remotes/");
			}

			entryName.Text = name;
			checkTrack.Active = !string.IsNullOrEmpty (tracking);

			UpdateStatus ();
		}
開發者ID:sushihangover,項目名稱:monodevelop,代碼行數:35,代碼來源:EditBranchDialog.cs

示例2: EditBranchDialog

		public EditBranchDialog (GitRepository repo, Branch branch, bool isNew)
		{
			this.Build ();
			this.repo =  repo;
			
			comboStore = new ListStore (typeof(string), typeof(Gdk.Pixbuf), typeof (string));
			comboSources.Model = comboStore;
			CellRendererPixbuf crp = new CellRendererPixbuf ();
			comboSources.PackStart (crp, false);
			comboSources.AddAttribute (crp, "pixbuf", 1);
			CellRendererText crt = new CellRendererText ();
			comboSources.PackStart (crt, true);
			comboSources.AddAttribute (crt, "text", 2);
			
			if (branch != null) {
				if (!isNew)
					oldName = branch.Name;
				currentTracking = branch.Tracking;
				entryName.Text = branch.Name;
				if (currentTracking != null)
					checkTrack.Active = true;
			}
			
			foreach (Branch b in repo.GetBranches ()) {
				AddValues (b.Name, ImageService.GetPixbuf ("vc-git-branch"));
			}
			
			foreach (string t in repo.GetTags ())
				AddValues (t, ImageService.GetPixbuf ("vc-git-tag"));
			
			foreach (RemoteSource r in repo.GetRemotes ()) {
				foreach (string b in repo.GetRemoteBranches (r.Name))
					AddValues (r.Name + "/" + b, ImageService.GetPixbuf ("md-web-search-icon"));
			}
				
			UpdateStatus ();
		}
開發者ID:Tak,項目名稱:monodevelop-novell,代碼行數:37,代碼來源:EditBranchDialog.cs

示例3: EditBranchDialog

		public EditBranchDialog (GitRepository repo, Branch branch, bool isNew)
		{
			this.Build ();
			this.repo =  repo;
			
			comboStore = new ListStore (typeof(string), typeof(Xwt.Drawing.Image), typeof (string));
			comboSources.Model = comboStore;
			var crp = new CellRendererImage ();
			comboSources.PackStart (crp, false);
			comboSources.AddAttribute (crp, "image", 1);
			var crt = new CellRendererText ();
			comboSources.PackStart (crt, true);
			comboSources.AddAttribute (crt, "text", 2);
			
			if (branch != null) {
				if (!isNew)
					oldName = branch.Name;
				currentTracking = branch.Tracking;
				entryName.Text = branch.Name;
				checkTrack.Active = currentTracking != null;
			}
			
			foreach (Branch b in repo.GetBranches ()) {
				AddValues (b.Name, ImageService.GetIcon ("vc-branch", IconSize.Menu));
			}
			
			foreach (string t in repo.GetTags ())
				AddValues (t, ImageService.GetIcon ("vc-tag", IconSize.Menu));
			
			foreach (RemoteSource r in repo.GetRemotes ()) {
				foreach (string b in repo.GetRemoteBranches (r.Name))
					AddValues (r.Name + "/" + b, ImageService.GetIcon ("vc-repository", IconSize.Menu));
			}
				
			UpdateStatus ();
		}
開發者ID:Kalnor,項目名稱:monodevelop,代碼行數:36,代碼來源:EditBranchDialog.cs


注:本文中的MonoDevelop.VersionControl.Git.GitRepository.GetBranches方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。