本文整理汇总了C#中Window.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Window.ToString方法的具体用法?C# Window.ToString怎么用?C# Window.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetGallery
public static async Task<Response<List<Image>>> GetGallery(Section? section = null, Sort? sort = null, Window? window = null, bool? showViral = null, int? page = null)
{
string uri = "gallery";
if (section != null)
{
uri += "/" + section.ToString().ToLower();
if(sort != null)
{
uri += "/" + sort.ToString().ToLower();
if(window != null)
{
uri += "/" + window.ToString().ToLower();
if (showViral != null)
{
uri += "/" + showViral.ToString();
if (page != null)
{
uri += "/" + page;
}
}
}
}
}
return await NetworkHelper.GetRequest<List<Image>>(uri);
}
示例2: TestBasics
public void TestBasics()
{
var window1 = new Window(123.1, 456.2);
Assert.AreEqual(123.1, window1.Width);
Assert.AreEqual(456.2, window1.Center);
Assert.AreEqual("123.10/456.20", window1.ToString());
Assert.IsFalse(window1.Equals(new object()));
var window2 = new Window(1.231, 456.2);
Assert.AreNotEqual(window1, window2);
var window3 = new Window(123.1, 4.562);
Assert.AreNotEqual(window1, window3);
var window4 = new Window(123.1, 456.2);
Assert.AreEqual(window1, window4);
}
示例3: GetSubreddditGallery
public static async Task<Response<List<Image>>> GetSubreddditGallery(string subreddit, Sort? sort = null, Window? window = null, int? page = null)
{
//{ subreddit}/{ sort}/{ window}/{ page}
string uri = "gallery/r/" + subreddit;
if (sort != null)
{
uri += "/" + sort.ToString().ToLower();
if (window != null)
{
uri += "/" + window.ToString().ToLower();
if (page != null)
{
uri += "/" + page;
}
}
}
return await NetworkHelper.GetRequest<List<Image>>(uri);
}
示例4: GetTopicGallery
public static async Task<Response<List<Image>>> GetTopicGallery(int topicId, Sort? sort = null, Window? window = null, int? page = null)
{
//{topicId}/{sort}/{window}/{page}
string uri = "topics/" + topicId;
if (sort != null)
{
uri += "/" + sort.ToString().ToLower();
if (window != null)
{
uri += "/" + window.ToString().ToLower();
if (page != null)
{
uri += "/" + page;
}
}
}
return await NetworkHelper.GetRequest<List<Image>>(uri);
}