Ejemplo n.º 1
0
        private void Click_Akk(object sender, RoutedEventArgs e)
        {
            WindowClient windowClient = new WindowClient(logins);

            windowClient.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        internal async Task Connect(ConnectionInfo connectionInfo, Session session, ILogger logger)
        {
            var address = connectionInfo.Network == "unix"
                ? $"unix://{connectionInfo.Address}"
                : connectionInfo.Address;

            var channel = new Channel(address, ChannelCredentials.Insecure);
            await channel.ConnectAsync();

            var interceptedChannel = channel.Intercept(new ExceptionLoggingInterceptor(logger));

            Console.Error.WriteLine("[DEBUG] GRPC Channel Connected");
            Whisper    = new WhisperClient(interceptedChannel, session, logger);
            Clipboard  = new ClipboardClient(interceptedChannel, session, logger);
            Filesystem = new FilesystemClient(interceptedChannel, session, logger);
            Cursor     = new CursorClient(interceptedChannel, session, logger);
            Keyboard   = new KeyboardClient(interceptedChannel, session, logger);
            Network    = new NetworkClient(interceptedChannel, session, logger);
            Process    = new ProcessClient(interceptedChannel, session, logger);
            Browser    = new BrowserClient(interceptedChannel, session, logger);
            Hover      = new HoverClient(interceptedChannel, session, logger);
            Window     = new WindowClient(interceptedChannel, session, logger);
            Storage    = new StorageClient(interceptedChannel, session, logger);
            UI         = new UIClient(interceptedChannel, session, logger);
        }
Ejemplo n.º 3
0
        private void go_back(object sender, RoutedEventArgs e)
        {
            WindowClient winadm = new WindowClient(logins);

            this.Close();
            winadm.Show();
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Create a new <see cref="LanguageClient"/>.
        /// </summary>
        /// <param name="logger">
        ///     The logger to use.
        /// </param>
        LanguageClient(ILogger logger)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            Log          = logger.ForSourceContext <LanguageClient>();
            Workspace    = new WorkspaceClient(this);
            Window       = new WindowClient(this);
            TextDocument = new TextDocumentClient(this);

            _dispatcher.RegisterHandler(_dynamicRegistrationHandler);
        }
        /// <summary>
        ///     Create a new <see cref="LanguageClient"/>.
        /// </summary>
        /// <param name="loggerFactory">
        ///     The logger to use.
        /// </param>
        LanguageClient(ILoggerFactory loggerFactory)
        {
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            LoggerFactory = loggerFactory;
            Log           = LoggerFactory.CreateLogger <LanguageClient>();
            Workspace     = new WorkspaceClient(this);
            Window        = new WindowClient(this);
            TextDocument  = new TextDocumentClient(this);

            _dispatcher.RegisterHandler(_dynamicRegistrationHandler);
        }
Ejemplo n.º 6
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string login    = Email_box.Text.Trim();
            string password = password_box.Password.Trim();

            try
            {
                DB             db      = new DB();
                DataTable      table   = new DataTable();
                SqlDataAdapter adapter = new SqlDataAdapter();
                SqlCommand     command = new SqlCommand("SELECT * FROM Client WHERE Email= @uL AND Password = @uP", db.getConnection());
                db.openConnection();

                command.Parameters.Add("@uL", SqlDbType.VarChar).Value = login;
                command.Parameters.Add("@uP", SqlDbType.VarChar).Value = password;
                adapter.SelectCommand = command;
                adapter.Fill(table);

                if (table.Rows.Count > 0)
                {
                    if (CheckRole())
                    {
                        WindowAdmin windowCompany = new WindowAdmin();
                        this.Close();
                        windowCompany.Show();
                    }
                    else
                    {
                        WindowClient client = new WindowClient(login);
                        this.Close();

                        client.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Неправильный логин или пароль");
                }
            }
            catch (SqlException)
            {
                MessageBox.Show("Отсутствует подключение с базой данных");
            }
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            WindowClient client = new WindowClient("http://localhost:8090");

            Console.WriteLine("The following windows are above the browser in z order:\n");
            foreach (WindowInfo window in OpenWindowGetter.GetWindowsAboveBrowser())
            {
                IntPtr handle = window.WindowHandle;
                string title  = window.WindowText;
                long   topX   = window.Info.rcWindow.Left;
                long   topY   = window.Info.rcWindow.Top;
                long   botX   = window.Info.rcWindow.Right;
                long   botY   = window.Info.rcWindow.Bottom;

                Console.WriteLine("{0}:      {1}\nTopX: {2}\nTopY: {3}\nBotX: {4}\nBotY: {5}\n\n", handle, title, topX, topY, botX, botY);

                client.SendWindowInfo(window).Wait();
            }
        }
Ejemplo n.º 8
0
        private void go_order(object sender, RoutedEventArgs e)
        {
            DB         db      = new DB();
            SqlCommand command = new SqlCommand("INSERT INTO OrderProduct ( Name, Price, TopPrice, Description, Login, ImagePath)"
                                                + "VALUES (@title, @price, @topprice, @desk, @login, @image)", db.getConnection());

            command.Parameters.AddWithValue("@title", title_box.Text);
            command.Parameters.AddWithValue("@price", price_box.Text);
            command.Parameters.AddWithValue("@topprice", topprice_box.Text);
            command.Parameters.AddWithValue("@desk", desk_box.Text);
            command.Parameters.AddWithValue("@login", logins);
            command.Parameters.AddWithValue("@image", Tovar.MainImagePath);


            db.openConnection();

            if (command.ExecuteNonQuery() == 1)
            {
                WindowClient winadm = new WindowClient(logins);
                MessageBox.Show("Товар успешно зарезервирована!");
                this.Close();
                winadm.Show();
            }
        }
Ejemplo n.º 9
0
        private void Client_OnClick(object sender, RoutedEventArgs e)
        {
            WindowClient wEmployee = new WindowClient();

            wEmployee.Show();
        }