mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 09:17:36 +13:00
paste.ee expiration and syntax works now
This commit is contained in:
parent
f5175e89f0
commit
8131eeb7a6
4 changed files with 18 additions and 7 deletions
|
@ -85,9 +85,13 @@ public int Compare(object x, object y)
|
||||||
|
|
||||||
// Compare the two items
|
// Compare the two items
|
||||||
if (SortByDate)
|
if (SortByDate)
|
||||||
|
{
|
||||||
compareResult = DateTime.Compare((DateTime)listviewX.SubItems[ColumnToSort].Tag, (DateTime)listviewY.SubItems[ColumnToSort].Tag);
|
compareResult = DateTime.Compare((DateTime)listviewX.SubItems[ColumnToSort].Tag, (DateTime)listviewY.SubItems[ColumnToSort].Tag);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text);
|
compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text);
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate correct return value based on object comparison
|
// Calculate correct return value based on object comparison
|
||||||
if (OrderOfSort == SortOrder.Ascending)
|
if (OrderOfSort == SortOrder.Ascending)
|
||||||
|
|
|
@ -407,15 +407,17 @@ private void lvHistory_ItemDrag(object sender, ItemDragEventArgs e)
|
||||||
{
|
{
|
||||||
HistoryItem hi = (HistoryItem)item.Tag;
|
HistoryItem hi = (HistoryItem)item.Tag;
|
||||||
if (File.Exists(hi.Filepath))
|
if (File.Exists(hi.Filepath))
|
||||||
|
{
|
||||||
selection.Add(hi.Filepath);
|
selection.Add(hi.Filepath);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (selection.Count == 0)
|
if (selection.Count > 0)
|
||||||
return;
|
{
|
||||||
|
|
||||||
DataObject data = new DataObject(DataFormats.FileDrop, selection.ToArray());
|
DataObject data = new DataObject(DataFormats.FileDrop, selection.ToArray());
|
||||||
DoDragDrop(data, DragDropEffects.Copy);
|
DoDragDrop(data, DragDropEffects.Copy);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void txtFilenameFilter_TextChanged(object sender, EventArgs e)
|
private void txtFilenameFilter_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,7 +131,10 @@ private void txtResult_KeyDown(object sender, KeyEventArgs e)
|
||||||
if (e.Control && e.KeyCode == Keys.A)
|
if (e.Control && e.KeyCode == Keys.A)
|
||||||
{
|
{
|
||||||
if (sender != null)
|
if (sender != null)
|
||||||
|
{
|
||||||
((TextBox)sender).SelectAll();
|
((TextBox)sender).SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
e.SuppressKeyPress = true; // TextBox will beep if it gets the CTRL+A
|
e.SuppressKeyPress = true; // TextBox will beep if it gets the CTRL+A
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,12 +83,13 @@ public override UploadResult UploadText(string text, string fileName)
|
||||||
{
|
{
|
||||||
encrypted = false,
|
encrypted = false,
|
||||||
description = "",
|
description = "",
|
||||||
|
expiration = "never",
|
||||||
sections = new Paste_eeSubmitRequestBodySection[]
|
sections = new Paste_eeSubmitRequestBodySection[]
|
||||||
{
|
{
|
||||||
new Paste_eeSubmitRequestBodySection()
|
new Paste_eeSubmitRequestBodySection()
|
||||||
{
|
{
|
||||||
name = "",
|
name = "",
|
||||||
//syntax = "autodetect",
|
syntax = "autodetect",
|
||||||
contents = text
|
contents = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,13 +118,14 @@ public class Paste_eeSubmitRequestBody
|
||||||
{
|
{
|
||||||
public bool encrypted { get; set; }
|
public bool encrypted { get; set; }
|
||||||
public string description { get; set; }
|
public string description { get; set; }
|
||||||
|
public string expiration { get; set; }
|
||||||
public Paste_eeSubmitRequestBodySection[] sections { get; set; }
|
public Paste_eeSubmitRequestBodySection[] sections { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Paste_eeSubmitRequestBodySection
|
public class Paste_eeSubmitRequestBodySection
|
||||||
{
|
{
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
//public string syntax { get; set; }
|
public string syntax { get; set; }
|
||||||
public string contents { get; set; }
|
public string contents { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue