本文整理汇总了C#中Connection.Authenticate方法的典型用法代码示例。如果您正苦于以下问题:C# Connection.Authenticate方法的具体用法?C# Connection.Authenticate怎么用?C# Connection.Authenticate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connection
的用法示例。
在下文中一共展示了Connection.Authenticate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginProcessing
protected override void BeginProcessing()
{
// Sample for now...credentials will move out (obviously)
Connection = new Connection("youtrack.jetbrains.net");
Connection.Authenticate("youtrackapi", "youtrackapi");
}
示例2: Main
static void Main(string[] args)
{
var connection = new Connection("youtrack.lamione.cz");
connection.Authenticate("root", "hop,scotch3");
var issueManagement = new IssueManagement(connection);
var issues = issueManagement.GetAllIssuesForProject("HM").ToArray();
var metaissues = issues.
Cast<dynamic>().
ToDictionary(iss => (string) iss.Id, issue => new SyncIssue
{
Id = issue.Id,
Summary = issue.Summary,
Subtasks = GetSubtasks(issue.Links),
Type = issue.Type
});
var tree = from issue in metaissues
where issue.Value.Type == "Requirement"
select new SyncIssue
{
Id = issue.Key,
Summary = issue.Value.Summary,
Childs = GetChilds(issue.Value.Subtasks.Select(sub => sub.Value), metaissues),
Type = issue.Value.Type
};
Console.WriteLine("END");
}
示例3: SetConnection
private void SetConnection()
{
if (!_isAuthenticated)
{
UserCredentials creds = new UserCredentials(Username, AccessKey);
_client = new CF_Client();
_conn = new CF_Connection(creds, _client);
_conn.Authenticate();
CheckContainer();
_isAuthenticated = true;
}
}
示例4: DeleteAll
public void DeleteAll()
{
var conn = new Connection("localhost", 2669);
conn.Authenticate("root", "10Pounds");
var issueManagement = new IssueManagement(conn);
foreach (var issueId in issueManagement.GetAllIssuesForProject("EJ").Select(x => x.Id))
{
var conn1 = new Connection("localhost", 2669);
conn1.Authenticate("root", "10Pounds");
var issueManagement1 = new IssueManagement(conn1);
issueManagement1.ApplyCommand(issueId, "remove", string.Empty);
}
}
示例5: Connect
public Connection Connect()
{
var connection = new Connection(
this.youTrackSettings.Host,
this.youTrackSettings.Port,
this.youTrackSettings.UseSSL);
if (!string.IsNullOrEmpty(this.youTrackSettings.Username))
{
connection.Authenticate(this.youTrackSettings.Username, this.youTrackSettings.Password);
var projectManagement = new ProjectManagement(connection);
this.ProjectStates = projectManagement.GetStates();
this.ResolvedStates = projectManagement.GetResolutions();
this.ProjectPriorities = projectManagement.GetPriorities();
}
return connection;
}
示例6: Go
public void Go()
{
var rep = new BugRepository();
foreach (var issue in rep.GetBugs().Select(bug => new Issue()
{
Summary = bug.Summary,
Description = PandocHelper.Convert(bug.Description).Replace("<br />", string.Empty),
Assignee = "Unassigned",
State = MapBugStatus(bug.Status),
Type = "Bug",
ProjectShortName = "EJ"
}))
{
var conn = new Connection("localhost", 2669);
conn.Authenticate("root", "10Pounds");
var issueManagement = new IssueManagement(conn);
issueManagement.CreateIssue(issue);
}
}
示例7: CreateIssueManagement
private static IssueManagement CreateIssueManagement(Config config)
{
var connection = new Connection(config.Host, config.Port, config.UseSsl, config.Path);
if (!string.IsNullOrEmpty(config.Username) && !string.IsNullOrEmpty(config.Password))
{
connection.Authenticate(config.Username, config.Password);
}
return new IssueManagement(connection);
}
示例8: YouTrackGate
public YouTrackGate(string username,string password, List<IProjectTreeGetter> getterModules)
{
GetterModules = getterModules;
connection = new Connection(YoutrackServerAddress);
connection.Authenticate(username,password);
}