This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update #27 增加一个一键关闭所有参考图的功能
- Loading branch information
Showing
7 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Windows.Forms; | ||
|
||
namespace SETUNA.Main.Style | ||
{ | ||
// Token: 0x02000049 RID: 73 | ||
public class CDustScrapStyle : CPreStyle | ||
{ | ||
// Token: 0x060002BE RID: 702 RVA: 0x0000F520 File Offset: 0x0000D720 | ||
public CDustScrapStyle() | ||
{ | ||
_styleid = -12; | ||
_stylename = "关闭所有截图"; | ||
} | ||
|
||
// Token: 0x060002BF RID: 703 RVA: 0x0000F53B File Offset: 0x0000D73B | ||
public override void Apply(ref ScrapBase scrap) | ||
{ | ||
Layer.LayerManager.Instance.SuspendRefresh(); | ||
var result = MessageBox.Show(Mainform.Instance, "是否关闭所有截图", "提示", MessageBoxButtons.YesNo); | ||
Layer.LayerManager.Instance.ResumeRefresh(); | ||
|
||
if (result == DialogResult.Yes) | ||
{ | ||
scrap.Manager.CloseAllScrap(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Drawing; | ||
using System.IO; | ||
using System.Windows.Forms; | ||
|
||
namespace SETUNA.Main.Style | ||
{ | ||
// Token: 0x02000049 RID: 73 | ||
public class CPasteStyle : CPreStyle | ||
{ | ||
// Token: 0x060002BE RID: 702 RVA: 0x0000F520 File Offset: 0x0000D720 | ||
public CPasteStyle() | ||
{ | ||
_styleid = -13; | ||
_stylename = "从剪贴板中粘贴截图"; | ||
} | ||
|
||
// Token: 0x060002BF RID: 703 RVA: 0x0000F53B File Offset: 0x0000D73B | ||
public override void Apply(ref ScrapBase scrap) | ||
{ | ||
Image image = null; | ||
if (Clipboard.ContainsImage()) | ||
{ | ||
image = Clipboard.GetImage(); | ||
} | ||
else if (Clipboard.ContainsText()) | ||
{ | ||
var text = Clipboard.GetText(); | ||
if (File.Exists(text)) | ||
{ | ||
FileStream fileStream = null; | ||
try | ||
{ | ||
fileStream = new FileStream(text, FileMode.Open, FileAccess.Read); | ||
image = (Bitmap)Image.FromStream(fileStream); | ||
fileStream.Close(); | ||
fileStream = null; | ||
} | ||
catch | ||
{ | ||
} | ||
finally | ||
{ | ||
if (fileStream != null) | ||
{ | ||
fileStream.Close(); | ||
} | ||
} | ||
} | ||
} | ||
if (image != null) | ||
{ | ||
scrap.Manager.AddScrap(image, scrap.Left, scrap.Top, image.Width, image.Height); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters