本文整理汇总了C#中RedmineManager类的典型用法代码示例。如果您正苦于以下问题:C# RedmineManager类的具体用法?C# RedmineManager怎么用?C# RedmineManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RedmineManager类属于命名空间,在下文中一共展示了RedmineManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_Connect_With_Username_And_Password
public void Should_Connect_With_Username_And_Password()
{
var a = new RedmineManager(Helper.Uri, Helper.Username, Helper.Password);
var currentUser = a.GetCurrentUser();
Assert.NotNull(currentUser);
Assert.True(currentUser.Login.Equals(Helper.Username), "usernames not equals.");
}
示例2: Should_Connect_With_Api_Key
public void Should_Connect_With_Api_Key()
{
var a = new RedmineManager(Helper.Uri, Helper.ApiKey);
var currentUser = a.GetCurrentUser();
Assert.NotNull(currentUser);
Assert.True(currentUser.ApiKey.Equals(Helper.ApiKey),"api keys not equals.");
}
示例3: Create
public bool Create()
{
try
{
RedmineManager manager = new RedmineManager(Configuration.RedmineHost,
Configuration.RedmineUser, Configuration.RedminePassword);
//Create a issue.
var newIssue = new Issue
{
Subject = Title,
Description = Description,
Project = new IdentifiableName() { Id = ProjectId },
Tracker = new IdentifiableName() { Id = TrackerId }
};
User thisuser = (from u in manager.GetObjectList<User>(new System.Collections.Specialized.NameValueCollection())
where u.Login == Configuration.RedmineUser
select u).FirstOrDefault();
if (thisuser != null)
newIssue.AssignedTo = new IdentifiableName() { Id = thisuser.Id };
manager.CreateObject(newIssue);
}
catch { return false; }
return true;
}
示例4: ProjectManagerGateway
public ProjectManagerGateway(RedmineSettings redmineSettings)
{
Require.NotNull(redmineSettings, nameof(redmineSettings));
_redmineSettings = redmineSettings;
_redmineManager = new RedmineManager(redmineSettings.RedmineHost, redmineSettings.ApiKey);
}
示例5: BaseService
public BaseService()
{
const string host = "";
const string apiKey = "";
RedmineService = new RedmineManager(host, apiKey);
}
示例6: GetCredentialsIfNeeded
private static bool GetCredentialsIfNeeded(Configuration configuration)
{
if (configuration.OpenTickets)
{
// Get use name and password
Console.Write("Redmine Username: ");
_user = Console.ReadLine();
Console.Write("Redmine password: ");
_password = Console.ReadLine();
_redmineManager = new RedmineManager(configuration.RedmineUrl, _user, _password);
try
{
_redmineManager.GetCurrentUser();
return true;
}
catch (RedmineException)
{
return false;
}
}
return true;
}
示例7: getManager
private RedmineManager getManager() {
if (manager == null) {
try {
manager = new RedmineManager(buffer.host, buffer.apikey);
System.Net.ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(bypassAllCertificateStuff);
} catch (Redmine.Net.Api.RedmineException e) {
MessageBox.Show(e.Message,"Connection Error.");
manager = null;
}
}
return manager;
}
示例8: GetTrackers
public static Dictionary<string, int> GetTrackers()
{
RedmineManager manager = new RedmineManager(Configuration.RedmineHost,
Configuration.RedmineUser, Configuration.RedminePassword);
Dictionary<string, int> Trackers = new Dictionary<string, int>();
foreach (Tracker track in manager.GetObjectList<Tracker>(new NameValueCollection()))
{
Trackers.Add(track.Name, track.Id);
}
return Trackers;
}
示例9: GetProjects
public static Dictionary<string, int> GetProjects()
{
RedmineManager manager = new RedmineManager(Configuration.RedmineHost,
Configuration.RedmineUser, Configuration.RedminePassword);
Dictionary<string, int> Projects = new Dictionary<string, int>();
foreach (Project proj in manager.GetObjectList<Project>(new NameValueCollection()))
{
Projects.Add(proj.Name, proj.Id);
}
return Projects;
}
示例10: Client
public Client(string login, string password, string host)
{
this.login = login;
this.password = password;
this.host = host;
manager = new RedmineManager(host, login, password);
cacheissue = this.GetTotalIssue();
totalissue = this.GetTotalIssue();
totalproject = this.GetTotalProject();
projects = this.GetProjects();
_instance = this;
}
示例11: ConnectRMServer
public static void ConnectRMServer(RMConnectCmdletBase cmdlet)
{
// Redmine.Net.Api.RedmineWebClient client =
// new RedmineWebClient();
// client.
string host = "";
string apiKey = "";
var manager = new RedmineManager(host, apiKey);
// var parameters = new NameValueCollection {{"status_id", "*"}};
// foreach (var issue in manager.GetObjectList<Issue>(parameters))
// {
// Console.WriteLine("#{0}: {1}", issue.Id, issue.Subject);
// }
//
// //Create a issue.
// var newIssue = new Issue { Subject = "test", Project = new IdentifiableName{Id = 1}};
// manager.CreateObject(newIssue);
}
示例12: AddToList
private void AddToList(RedmineManager manager)
{
var textData = textBox.Text;
foreach (var issue in list)
{
var s = issue.Tracker.ToString();
s = s.Remove(0, 3);
string vParsed = "";
var v = issue.FixedVersion;
if (v != null)
vParsed = v.ToString().Remove(0, 3);
if (string.IsNullOrWhiteSpace(textData))
listBox.Items.Add("#" + issue.Id + ": " + s + " - " + issue.Subject + " " + vParsed);
else
if (vParsed.Contains(textData))
listBox.Items.Add("#" + issue.Id + ": " + s + " - " + issue.Subject + " " + vParsed);
}
}
示例13: button_Click
private void button_Click(object sender, RoutedEventArgs e)
{
JasonInformations info = new JasonInformations();
var manager = new RedmineManager(info.host, textBoxUser.Text, passwordBox.Password);
var parameters = new NameValueCollection { { "status_id", "*" }, { "limit", "100" } };
try
{
var test = manager.GetObjectList<Issue>(parameters).ToList();
MainWindow win2 = new MainWindow();
win2.manager = manager;
win2.subject = info.subject;
win2.list = test;
win2.info = info.destinatari;
win2.Show();
this.Close();
}
catch (Exception )
{
labelErrore.Visibility = Visibility.Visible;
this.Show();
}
}
示例14: SetMimeTypeXML
private void SetMimeTypeXML()
{
redmineManager = new RedmineManager(uri, apiKey, MimeFormat.xml);
}
示例15: SetMimeTypeJSON
private void SetMimeTypeJSON()
{
redmineManager = new RedmineManager(uri, apiKey, MimeFormat.json);
}