This commit is contained in:
Alexander 2018-12-25 17:22:59 +02:00
parent 62492e1ec8
commit 005a3bf1fc

View file

@ -1266,34 +1266,37 @@ private void customRTB_DragDrop(object sender, DragEventArgs e)
return; return;
} }
string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false); private void RightToLeftEditorMenuStrip_Click(object sender, EventArgs e)
foreach (string file in FileList) OpenFile.FileName = file; foreach (string file in FileList) OpenFile.FileName = file;
object fname = e.Data.GetData("FileDrop"); object fname = e.Data.GetData("FileDrop");
if (fname != null) if (fname != null)
{ {
var list = fname as string[]; if (RightToLeftEditorMenuStrip.Checked)
if (list != null && !string.IsNullOrWhiteSpace(list[0])) if (list != null && !string.IsNullOrWhiteSpace(list[0]))
{
if (!WordWrapToolStripMenuItem.Checked)
{ {
if (!OpenFile.FileName.Contains(".cnp")) string rtbTxt = CustomRTB.Text;
{ CustomRTB.Clear();
string opnfile = File.ReadAllText(OpenFile.FileName); CustomRTB.RightToLeft = RightToLeft.Yes;
string NameWithotPath = Path.GetFileName(OpenFile.FileName); Application.DoEvents();
customRTB.Text = opnfile; CustomRTB.Text = rtbTxt;
this.Text = appName + NameWithotPath;
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
customRTB.Select(Convert.ToInt32(cc2), 0); customRTB.Select(Convert.ToInt32(cc2), 0);
currentFilename = Path.GetFileName(OpenFile.FileName); currentFilename = Path.GetFileName(OpenFile.FileName);
filePath = OpenFile.FileName; filePath = OpenFile.FileName;
return; return;
} }
PublicVar.openFileName = Path.GetFileName(OpenFile.FileName); else
DecryptAES(); DecryptAES();
if (PublicVar.okPressed == true) if (PublicVar.okPressed == true)
{ {
PublicVar.okPressed = false; CustomRTB.RightToLeft = RightToLeft.Yes;
}
} }
} }
else
{
CustomRTB.RightToLeft = RightToLeft.No;
}
} }
public void saveConfirm(bool exit) public void saveConfirm(bool exit)