Example #1
0
        private void btnCopyDirectory_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            var buttonEdit = sender as ButtonEdit;

            if (e.Button.Kind == ButtonPredefines.Delete)
            {
                buttonEdit.EditValue = null;
                return;
            }

            if (string.IsNullOrWhiteSpace(txtIPAddress.Text))
            {
                txtIPAddress.Focus();
            }
            else
            {
                var networkStream = GetNetworkStream(txtIPAddress.Text, 15000);

                if (networkStream is null)
                {
                    return;
                }

                var form = new MyExplorerForm(networkStream);
                form.ShowDialog();

                if (!string.IsNullOrWhiteSpace(form.Path))
                {
                    buttonEdit.EditValue = form.Path;
                }
            }
        }
Example #2
0
        private void btnSaveDirectory_ButtonPressed(object sender, ButtonPressedEventArgs e)
        {
            var buttonEdit = sender as ButtonEdit;

            if (e.Button.Kind == ButtonPredefines.Delete)
            {
                buttonEdit.EditValue = null;
                return;
            }

            if (string.IsNullOrWhiteSpace(txtIPAddress.Text) && !checkIsThisPC.Checked)
            {
                txtIPAddress.Focus();
            }
            else
            {
                if (checkIsThisPC.Checked)
                {
                    using (var xtraFolderBrowserDialog = new XtraFolderBrowserDialog())
                    {
                        xtraFolderBrowserDialog.DialogStyle = FolderBrowserDialogStyle.Wide;
                        if (xtraFolderBrowserDialog.ShowDialog() == DialogResult.OK)
                        {
                            buttonEdit.EditValue = xtraFolderBrowserDialog.SelectedPath;
                        }
                    }
                }
                else
                {
                    var networkStream = GetNetworkStream(txtIPAddress.Text, 15000);

                    if (networkStream is null)
                    {
                        return;
                    }

                    var form = new MyExplorerForm(networkStream);
                    form.ShowDialog();

                    if (!string.IsNullOrWhiteSpace(form.Path))
                    {
                        buttonEdit.EditValue = form.Path;
                    }
                }
            }
        }