Пример #1
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            LbAccounts.Items.Clear();
            LbStores.Items.Clear();
            TxtLog.Clear();
            TxtUpdates.Clear();

            (ConcurrentBag <DlQuestion> allQuestions, ConcurrentBag <DlReview> allReviews) = await ReloadAsync(Name, tbAccount.Text).ConfigureAwait(false);

            await Dispatcher.InvokeAsync(() =>
            {
                DlQuestions questions = (DlQuestions)Resources["Questions"];
                questions.Clear();
                foreach (DlQuestion x in allQuestions)
                {
                    questions.Add(x);
                }

                DlReviews reviews = (DlReviews)Resources["Reviews"];
                reviews.Clear();
                foreach (DlReview x in allReviews)
                {
                    reviews.Add(x);
                }
            });
        }
Пример #2
0
        //private static int GetXByIndex(int index) { return (index - 1) % 3; }
        //private static int GetYByIndex(int index) { return (index - 1) / 3; }

        private void ClearLogOnUI()
        {
            Invoke(new MethodInvoker(delegate
            {
                try { TxtLog.Clear(); }
                catch (Exception ex2) { Logger?.Error(ex2); }
            }));
        }
Пример #3
0
 private void VypisTimer_Tick(object sender, EventArgs e)
 {
     TxtLog.Clear();
     foreach (string a in ServerLog.VratS())
     {
         TxtLog.AppendText(a + Environment.NewLine);
     }
 }
Пример #4
0
 private void ComponentesQuandoIniciado()
 {
     TxtLog.Clear();
     TxtUsuario.Enabled  = false;
     TxtIP.Enabled       = false;
     BtnEntrar.Enabled   = false;
     BtnSair.Enabled     = true;
     PnlConteudo.Enabled = true;
     TxtMensagem.Focus();
 }
Пример #5
0
 public void Init()
 {
     // 至少提供下面的四个参数
     _client = new AuthingClient(new AuthingClientOptions()
     {
         AppId                 = "5e72d72e3798fb03e1d57b13",
         AppDomain             = "authing-net-sdk-demo.authing.cn",
         RedirectUri           = "https://authing.cn/guide/oidc/callback",
         PostLogoutRedirectUri = "https://authing.cn/guide/oidc/callback",
     });
     print = (str) => TxtLog.AppendText(str + "\r\n");
     clear = () => TxtLog.Clear();
 }
Пример #6
0
        private void SaveWindows()
        {
            mWindowsParams = new List <WindowParams>();
            EnumWindows(new EnumWindowsProc(EnumTheWindows), IntPtr.Zero);

            // Has now hWindList

            TxtLog.Clear();
//            mWindowsParams = new List<WindowParams>();

            String txt = "SAVE:" + Environment.NewLine;

            txt += "Num windows: " + mWindowsParams.Count + Environment.NewLine;
            //var processlist = Process.GetProcesses()
            //    .Where(p => p.MainWindowHandle != IntPtr.Zero);

            //foreach (Process process in processlist)
            //{
            foreach (WindowParams winParam in mWindowsParams)
            {
                //if (!String.IsNullOrEmpty(process.MainWindowTitle))
                //{
                //IntPtr hwnd = process.MainWindowHandle;
                //GetWindowRect(winParam.hWndPtr, out Rectangle rect);
                //if (winParam.rect.Top == 0 && winParam.rect.Left == 0)
                //    continue;

                //if (process.ProcessName == "ApplicationFrameHost")
                //    continue;

                //if (winParam.rect.Top > -1000) // Else assumed minimized
                //{
                //txt += String.Format("Saving process '{0}' (id {1})(title '{2}': ",
                //    process.ProcessName,
                //    process.Id,
                //    process.MainWindowTitle);

                txt += "Title '" + winParam.title + "': ";
                txt += "Top=" + winParam.rect.Top;
                txt += ",Left=" + winParam.rect.Left;
                txt += ",Height=" + winParam.rect.Height;
                txt += ",Width=" + winParam.rect.Width;
                txt += ",winState=" + winParam.windowState;
                txt += Environment.NewLine;

                //mWindowsParams.Add(new WindowParams()
                //{
                //    hWndPtr = hwnd,
                //    processName = "",
                //    processId = 0,
                //    top = rect.Top,
                //    left = rect.Left,
                //    width = rect.Width,
                //    height = rect.Height
                //});
                //}
                //}
            }

            TxtLog.Text = txt;
        }
Пример #7
0
 private void BtnClearLog_Click(object sender, RoutedEventArgs e)
 {
     TxtLog.Clear();
 }