本文整理汇总了C#中Smuxi.Engine.FrontendManager.Sync方法的典型用法代码示例。如果您正苦于以下问题:C# FrontendManager.Sync方法的具体用法?C# FrontendManager.Sync怎么用?C# FrontendManager.Sync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Smuxi.Engine.FrontendManager
的用法示例。
在下文中一共展示了FrontendManager.Sync方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConnectEngineToGUI
public static void ConnectEngineToGUI()
{
if (IsLocalEngine) {
// HACK: SessionManager.Register() is not used for local engines
_LocalSession.RegisterFrontendUI(_MainWindow.UI);
}
SyncConfig();
_FrontendManager = _Session.GetFrontendManager(_MainWindow.UI);
_FrontendManager.Sync();
// MS .NET doesn't like this with Remoting?
if (Type.GetType("Mono.Runtime") != null) {
// when are running on Mono, all should be good
if (_UserConfig.IsCaching) {
// when our UserConfig is cached, we need to invalidate the cache
// DISABLED: see FrontendManager._OnConfigChanged
//_FrontendManager.ConfigChangedDelegate = SyncConfig;
}
}
_MainWindow.ShowAll();
// make sure entry got attention :-P
_MainWindow.Entry.HasFocus = true;
// local sessions can't have network issues :)
if (_Session != _LocalSession) {
_FrontendManagerCheckerQueue = new TaskQueue("FrontendManagerCheckerQueue");
_FrontendManagerCheckerQueue.AbortedEvent += delegate {
#if LOG4NET
_Logger.Debug("_FrontendManagerCheckerQueue.AbortedEvent(): task queue aborted!");
#endif
};
_FrontendManagerCheckerQueue.ExceptionEvent +=
delegate(object sender, TaskQueueExceptionEventArgs e) {
#if LOG4NET
_Logger.Error("Exception in TaskQueue: ", e.Exception);
_Logger.Error("Inner-Exception: ", e.Exception.InnerException);
#endif
Frontend.ShowException(e.Exception);
};
_FrontendManagerCheckerQueue.Queue(delegate {
// keep looping as long as the checker returns true
while (CheckFrontendManagerStatus()) {
// FIXME: bail out somehow when we lost the connection
// without an exception in the meantime
// only check once per minute
Thread.Sleep(60 * 1000);
}
#if LOG4NET
_Logger.Debug("_FrontendManagerCheckerQueue(): " +
"CheckFrontendManagerStatus() returned false, "+
"time to say good bye!");
#endif
});
}
MainWindow.ChatViewManager.IsSensitive = true;
}
示例2: ConnectEngineToGUI
public static void ConnectEngineToGUI()
{
_FrontendManager = _Session.GetFrontendManager(_MainWindow.UI);
_FrontendManager.Sync();
if (_UserConfig.IsCaching) {
// when our UserConfig is cached, we need to invalidate the cache
_FrontendManager.ConfigChangedDelegate = new SimpleDelegate(_UserConfig.ClearCache);
}
// make sure entry got attention :-P
// BUG: MonoCurses
//_MainWindow.Entry.HasFocus = true;
}
示例3: ConnectEngineToGUI
public static void ConnectEngineToGUI()
{
_Session.RegisterFrontendUI(_MainWindow.UI);
_FrontendManager = _Session.GetFrontendManager(_MainWindow.UI);
_FrontendManager.Sync();
// MS .NET doesn't like this with Remoting?
if (Type.GetType("Mono.Runtime") != null) {
// when are running on Mono, all should be good
if (_UserConfig.IsCaching) {
// when our UserConfig is cached, we need to invalidate the cache
_FrontendManager.ConfigChangedDelegate = new SimpleDelegate(_UserConfig.ClearCache);
}
}
ApplyConfig(_UserConfig);
_MainWindow.ShowAll();
// make sure entry got attention :-P
_MainWindow.Entry.HasFocus = true;
// check once per minute the status of the frontend manager
GLib.Timeout.Add(60 * 1000, _CheckFrontendManagerStatus);
}
示例4: Init
public static void Init(string[] args)
{
System.Threading.Thread.CurrentThread.Name = "Main";
if (!(args.Length >= 1)) {
Console.Error.WriteLine("Usage: smuxi-test.exe profile");
Environment.Exit(1);
}
#if LOG4NET
_Logger.Info("smuxi-test starting");
#endif
_FrontendConfig = new FrontendConfig("Test");
_FrontendConfig.Load();
string profile = args[0];
if (String.IsNullOrEmpty(profile)) {
Console.Error.WriteLine("profile parameter must not be empty!");
Environment.Exit(1);
}
IFrontendUI ui = new TestUI();
Session session = null;
if (profile == "local") {
Engine.Engine.Init();
session = new Engine.Session(Engine.Engine.Config,
Engine.Engine.ProtocolManagerFactory,
"local");
session.RegisterFrontendUI(ui);
} else {
// remote engine
EngineManager engineManager = new EngineManager(_FrontendConfig, ui);
engineManager.Connect(profile);
session = engineManager.Session;
}
if (session == null) {
Console.Error.WriteLine("Session is null, something went wrong setting up or connecting to the engine!");
Environment.Exit(1);
}
_Session = session;
_UserConfig = session.UserConfig;
_FrontendManager = session.GetFrontendManager(ui);
_FrontendManager.Sync();
if (_UserConfig.IsCaching) {
// when our UserConfig is cached, we need to invalidate the cache
_FrontendManager.ConfigChangedDelegate = new SimpleDelegate(_UserConfig.ClearCache);
}
while (true) {
string line = Console.ReadLine();
// TODO: remove the entered line from output
//Console.WriteLine(Escape+"M");
_ExecuteCommand(line);
}
}