本文整理汇总了C#中Window.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# Window.Refresh方法的具体用法?C# Window.Refresh怎么用?C# Window.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.Refresh方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
Console.WindowWidth = 100;
Curses.InitScr();
Curses.StartColor();
Curses.InitPair(1, Colors.WHITE, Colors.BLACK);
mainDisplay = new Window(Console.WindowHeight, Console.WindowWidth, 0, 0);
mainDisplay.EnableScroll = true;
Window commandInput = new Window(1, Console.WindowWidth, Console.WindowHeight - 1, 0);
commandInput.Color = 1;
mainDisplay.Color = 1;
mCore.Init(EventHandler);
CommandHandler.Initialize();
while (true)
{
commandInput.Clear();
commandInput.Add(">");
String command = commandInput.GetString();
CommandHandler.HandleCommand(command);
commandInput.Refresh();
}
}
示例2: CreateUser
/// <summary>
/// Creates a user using OAuth
/// </summary>
private void CreateUser()
{
OAuthAccessToken userKey = new OAuthAccessToken();
Profile defaultProfile = new Profile();
TwitterService service = new TwitterService(appKey.Token, appKey.TokenSecret);
OAuthRequestToken requestToken = service.GetRequestToken();
Uri uri = service.GetAuthorizationUri(requestToken);
Process.Start(uri.ToString());
service.AuthenticateWith(appKey.Token, appKey.TokenSecret);
Window auth = new Window(1, ScreenInfo.WindowWidth, 0, 0);
Curses.Echo = true;
auth.Add("Please input the authentication number: ");
auth.Refresh();
string verifier = auth.GetString(7);
userKey = service.GetAccessToken(requestToken, verifier);
defaultProfile.Active = true;
defaultProfile.Default = true;
defaultProfile.UserKey = userKey.Token;
defaultProfile.UserSecret = userKey.TokenSecret;
defaultProfile.Name = userKey.ScreenName;
profiles.Add(defaultProfile);
Curses.Echo = false;
auth.Dispose();
WriteFile();
}
示例3: IsMissingArgs
public static bool IsMissingArgs(string command)
{
try
{
bool checker = command.Split(' ')[1].Length != 2;
}
catch (IndexOutOfRangeException)
{
Window argsMiss = new Window(1, ScreenInfo.WindowWidth, 0, 0);
argsMiss.Add(" Error: input was not complete.\n");
argsMiss.Add(" You probaby didn't use enough args");
argsMiss.Refresh();
argsMiss.GetChar();
argsMiss.Dispose();
return true;
}
return false;
}
示例4: AddProfile
public void AddProfile()
{
ScreenDraw.Tweets.Clear();
ScreenDraw.Tweets.Refresh();
OAuthAccessToken userKey = new OAuthAccessToken();
OAuthRequestToken requestToken = User.Account.GetRequestToken();
Window auth = new Window(1, ScreenInfo.WindowWidth, 3, 0);
Uri uri = User.Account.GetAuthorizationUri(requestToken);
Process.Start(uri.ToString());
Curses.Echo = true;
auth.Add("Please input the authentication number: ");
auth.Refresh();
string verifier = auth.GetString(7);
userKey = User.Account.GetAccessToken(requestToken, verifier);
Profile newProfile = new Profile();
newProfile.Name = userKey.ScreenName;
newProfile.UserKey = userKey.Token;
newProfile.UserSecret = userKey.TokenSecret;
if (ProfileExists(newProfile))
{
ScreenDraw.ShowMessage("User already exists in the list");
}
else
{
profiles.Add(newProfile);
WriteFile();
ScreenDraw.ShowMessage("User added");
}
Curses.Echo = false;
auth.Dispose();
ScreenDraw draw = new ScreenDraw();
draw.ShowTimeline();
}
示例5: ProfileSelection
/// <summary>
/// A menu and logic to select/add/remove profiles
/// </summary>
private void ProfileSelection()
{
int pressedKey;
int selection = 0;
menu = new Window(User.profiles.Count + 10, ScreenInfo.WindowWidth, (ScreenInfo.WindowHeight / 2) - 2, 0);
do
{
menu.Clear();
menu.Keypad = true;
menu.Color = 11;
MenuDrawInMiddle("What would you like to do?\n", 0);
if (selection == 0)
{
menu.Color = 21;
}
MenuDrawInMiddle("Add profile");
menu.Color = 11;
menu.Add("\n");
if (selection == 1)
{
menu.Color = 21;
}
MenuDrawInMiddle("Remove a profile");
menu.Add("\n");
menu.Color = 11;
if (selection == 2)
{
menu.Color = 21;
}
MenuDrawInMiddle("Switch profiles");
menu.Add("\n");
menu.Color = 11;
if (selection == 3)
{
menu.Color = 21;
}
menu.Refresh();
MenuDrawInMiddle("Select default profile");
menu.Add("\n");
menu.Color = 11;
if (selection == 4)
{
menu.Color = 21;
}
MenuDrawInMiddle("Go back");
menu.Color = 11;
menu.Refresh();
pressedKey = menu.GetChar();
if (pressedKey == Keys.UP)
{
if (selection == 0)
{
Curses.Beep();
}
else
{
selection--;
}
}
else if (pressedKey == Keys.DOWN)
{
if (selection == 4)
{
Curses.Beep();
}
else
{
selection++;
}
}
} while (pressedKey != 10);
menu.Clear();
menu.Refresh();
if (selection == 0)
{
getUser.AddProfile();
}
else if (selection == 1)
{
Profile deletingProfile = drawing.SelectUser();
int minorSelection = 0;
int pressedChar;
do
{
menu.Clear();
menu.Color = 11;
MenuDrawInMiddle("Are you sure you want to remove " + deletingProfile.Name + "?", 0);
if (minorSelection == 0)
{
menu.Color = 21;
MenuDrawInMiddle("Yes", 2);
//.........这里部分代码省略.........