Exemple #1
0
 public static void DeregisterPresenter(ILoggerTarget logTargetView)
 {
     Log.ShowLog -= delegate(string obj)
     {
         logTargetView.SetCommandLine(obj);
     };
 }
Exemple #2
0
        public VM_MainWindow()
        {
            RenderDelegate = new E3DEngine.EngineDelegateRef();
            RenderDelegate.InitilizeEngine();
            outFunc        = ShowLog;
            threadFunc     = operateThread;
            threadLockFunc = lockThread;
            IntPtr ptr  = Marshal.GetFunctionPointerForDelegate(outFunc);
            IntPtr tptr = Marshal.GetFunctionPointerForDelegate(threadFunc);

            RenderDelegate.RegisterThreadFunc(tptr);
            RenderDelegate.SetDebugLogOutFunc(ptr);
            Common.Debug.ShowLogHandle = ShowLog;
        }
Exemple #3
0
 public MainWindow()
 {
     InitializeComponent();
     WeChat       = new WeChatSdk();
     Contacts     = new ObservableCollection <ContactModel>();
     DataContext  = this;
     ShowLogEvent = (msg) =>
     {
         this.tb_Log.AppendText(msg);
         this.tb_Log.AppendText(Environment.NewLine);
         this.tb_Log.ScrollToEnd();
     };
     WeChat.LogEvent            += WeChat_LogEvent;
     WeChat.ReceiveContactEvent += WeChat_ReceiveContactEvent;
     WeChat.ReceiveOtherIMEvent += WeChat_ReceiveOtherIMEvent;
     WeChat.WeChatInitEvent     += WeChat_WeChatInitEvent;
     WeChat.ConnetionCloseEvent += WeChat_ConnetionCloseEvent;
     btn_OpenWeChat.Click       += Btn_OpenWeChat_Click;
 }
Exemple #4
0
 /// <summary>
 /// Register callback function
 /// </summary>
 /// <param name="func">Function with string type argument</param>
 public static void RegisterShowLogDelegate(ShowLogDelegate func)
 {
     _showLogHandler = func;
 }