├── .gitignore
├── .gitmodules
├── .nuget
└── NuGet.exe
├── ActionListWinForms.nuspec
├── ActionsDemo
├── AboutBox.Designer.cs
├── AboutBox.cs
├── AboutBox.resx
├── Crad.Windows.Forms.Actions.Sample.csproj
├── EditorForm.Designer.cs
├── EditorForm.cs
├── EditorForm.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── Resources
│ ├── About.jpg
│ ├── Font.png
│ ├── New.png
│ ├── Open.png
│ └── Save.png
├── Crad.Windows.Forms.Actions.Design
├── ActionCollectionEditor.cs
├── Crad.Windows.Forms.Actions.Design.csproj
├── Properties
│ └── AssemblyInfo.cs
└── license.txt
├── Crad.Windows.Forms.Actions.sln
├── Crad.Windows.Forms.Actions.vs2008.sln
├── Crad.Windows.Forms.Actions.vs2010.sln
├── Crad.Windows.Forms.Actions
├── AboutAction.cs
├── Action.cs
├── ActionCollection.cs
├── ActionList.cs
├── ActionTargetDescriptionInfo.cs
├── AlignCenterAction.cs
├── AlignCenterAction.resx
├── AlignLeftAction.cs
├── AlignLeftAction.resx
├── AlignRightAction.cs
├── AlignRightAction.resx
├── AlignmentBaseAction.cs
├── AlignmentBaseAction.resx
├── BoldAction.cs
├── BoldAction.resx
├── ComponentExtension.cs
├── CopyAction.cs
├── CopyAction.resx
├── Crad.Windows.Forms.Actions.csproj
├── Crad.snk
├── CutAction.cs
├── CutAction.resx
├── DeleteAction.cs
├── DeleteAction.resx
├── FontStyleAction.cs
├── FontStyleAction.resx
├── Images
│ ├── Action.bmp
│ └── ActionList.bmp
├── ItalicAction.cs
├── ItalicAction.resx
├── ListAction.cs
├── ListAction.resx
├── PasteAction.cs
├── PasteAction.resx
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── RedoAction.cs
├── RedoAction.resx
├── Resources
│ ├── AlignCenter.png
│ ├── AlignJustified.png
│ ├── AlignLeft.png
│ ├── AlignRight.png
│ ├── BulletedList.png
│ ├── Copy.png
│ ├── Cut.png
│ ├── Paste.png
│ ├── Redo.png
│ ├── StyleBold.png
│ ├── StyleItalic.png
│ ├── StyleUnderline.png
│ ├── Undo.png
│ └── delete.png
├── RichTextAction.cs
├── SelectAllAction.cs
├── SelectAllAction.resx
├── StandardActionAttribute.cs
├── TextBoxBaseAction.cs
├── UnderlineAction.cs
├── UnderlineAction.resx
├── UndoAction.cs
├── UndoAction.resx
├── UpdatablePropertyAttribute.cs
├── ViewDetailsAction.cs
├── ViewDetailsAction.resx
├── ViewLargeIconsAction.cs
├── ViewLargeIconsAction.resx
├── ViewListAction.cs
├── ViewListAction.resx
├── ViewSmallIconsAction.cs
├── ViewSmallIconsAction.resx
└── license.txt
├── README.md
├── SharedAssemblyInfo.cs
├── all.bat
├── clean.bat
├── debug.bat
├── license_cpl1.0.txt
├── release.net40.bat
├── sign.ps1
└── tools
├── NDepend.Helpers.FileDirectoryPath.dll
├── Toolbox.exe
├── gacutil_2.0.exe
├── gacutil_2.0.exe.config
├── gacutil_4.0.exe
└── gacutil_4.0.exe.config
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 | *.suo
3 | *.user
4 | _ReSharper*
5 | *.csproj.user
6 | *.resharper.user
7 | *.userprefs
8 | *.suo
9 | *.cache
10 | *.trx
11 | *.pidb
12 | Thumbs.db
13 | [Bb]in
14 | [Dd]ebug
15 | [Oo]bj
16 | [Rr]elease
17 | [Tt]est[Rr]esult*
18 | _UpgradeReport_Files
19 | *[Pp]ublish.xml
20 | *.project
21 | *.metadata
22 | logs
23 | *.generated.cs
24 | T4MVC.cs
25 | /SharpSnmpLib/sharpsnmplib.snk
26 | /packages
27 | /setup.exe
28 | /.nuget/*.nupkg
29 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "processviewer"]
2 | path = processviewer
3 | url = git://github.com/lextm/processviewer.git
4 |
--------------------------------------------------------------------------------
/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/ActionListWinForms.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2.0.0.0
5 | Marco De Sanctis, Lex Li, and other contributors
6 | Marco De Sanctis, Lex Li, and other contributors
7 | CPL-1.0
8 | https://github.com/lextm/ActionListWinForms
9 | ActionListWinForms
10 | Crad's ActionList for .NET
11 | true
12 | Everyone who has worked with Borland's Delphi knows how powerful Actions are. Actions are used to link together various UI elements, such as buttons, menu items, and toolbar buttons, making them behave consistently: linked items are checked/ unchecked/ enabled/ disabled at the same time, and they share the same Text and eventually Image property and, of course, execute the same code once clicked.
13 |
14 | ActionList for .NET brings these features to Windows Forms developers.
15 |
16 | Please also download and execute 1.3.0 installer from https://dl.dropbox.com/u/103746479/installers/actionlist/setup.exe so as to enable design time support in Visual Studio.
17 | ActionList control for Windows Forms, similar to TActionList from Delphi VCL.
18 | 01/04/2020: 2.0.0
19 | * [GH#13] Removed support for obsolete controls.
20 |
21 | 12/15/2012: 1.3.0
22 | * [GH#11] Better control over AutoToolTip property of ToolStripItem.
23 | * [GH#12] Added support for Visual Studio Express 2012 for Windows Desktop.
24 |
25 | 08/12/2012: 1.2.0
26 | * [GH#1] Fixed NullReferenceException when placed on UserControl.
27 | * [GH#2] Fixed disposal exception when container control is disposed.
28 | * [GH#3] Fixed Action missing in Actions editor within SharpDevelop issue.
29 | * [GH#6] Fixed ToolTipText of ToolStripButton return empty string issue.
30 | * [GH#8] Added a Visual Studio friendly installer.
31 | * [GH#9] Split design time support to a separate assembly.
32 |
33 | 04/30/2006: Crad's Actions 1.1.1.0 released.
34 | * Support for creating custom Actions added (with a brief description in this article).
35 | * Some new StandardActions added, like ListView actions and About action.
36 |
37 | 04/22/2006: First version.
38 | (C) Marco De Sanctis, Lex Li, and other contributors
39 | en-US
40 | windows forms action list winforms controls actionlist visualstudio
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ActionsDemo/AboutBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Windows.Forms;
6 | using System.Reflection;
7 |
8 | namespace Crad.Windows.Forms.Actions.Sample
9 | {
10 | partial class AboutBox : Form
11 | {
12 | public AboutBox()
13 | {
14 | InitializeComponent();
15 |
16 | // Initialize the AboutBox to display the product information from the assembly information.
17 | // Change assembly information settings for your application through either:
18 | // - Project->Properties->Application->Assembly Information
19 | // - AssemblyInfo.cs
20 | this.Text = String.Format("About {0}", AssemblyTitle);
21 | this.labelProductName.Text = AssemblyProduct;
22 | this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
23 | this.labelCopyright.Text = AssemblyCopyright;
24 | this.labelCompanyName.Text = AssemblyCompany;
25 | }
26 |
27 | #region Assembly Attribute Accessors
28 |
29 | public string AssemblyTitle
30 | {
31 | get
32 | {
33 | // Get all Title attributes on this assembly
34 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
35 | // If there is at least one Title attribute
36 | if (attributes.Length > 0)
37 | {
38 | // Select the first one
39 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
40 | // If it is not an empty string, return it
41 | if (titleAttribute.Title != "")
42 | return titleAttribute.Title;
43 | }
44 | // If there was no Title attribute, or if the Title attribute was the empty string, return the .exe name
45 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
46 | }
47 | }
48 |
49 | public string AssemblyVersion
50 | {
51 | get
52 | {
53 | return Assembly.GetExecutingAssembly().GetName().Version.ToString();
54 | }
55 | }
56 |
57 | public string AssemblyDescription
58 | {
59 | get
60 | {
61 | // Get all Description attributes on this assembly
62 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
63 | // If there aren't any Description attributes, return an empty string
64 | if (attributes.Length == 0)
65 | return "";
66 | // If there is a Description attribute, return its value
67 | return ((AssemblyDescriptionAttribute)attributes[0]).Description;
68 | }
69 | }
70 |
71 | public string AssemblyProduct
72 | {
73 | get
74 | {
75 | // Get all Product attributes on this assembly
76 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
77 | // If there aren't any Product attributes, return an empty string
78 | if (attributes.Length == 0)
79 | return "";
80 | // If there is a Product attribute, return its value
81 | return ((AssemblyProductAttribute)attributes[0]).Product;
82 | }
83 | }
84 |
85 | public string AssemblyCopyright
86 | {
87 | get
88 | {
89 | // Get all Copyright attributes on this assembly
90 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
91 | // If there aren't any Copyright attributes, return an empty string
92 | if (attributes.Length == 0)
93 | return "";
94 | // If there is a Copyright attribute, return its value
95 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
96 | }
97 | }
98 |
99 | public string AssemblyCompany
100 | {
101 | get
102 | {
103 | // Get all Company attributes on this assembly
104 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
105 | // If there aren't any Company attributes, return an empty string
106 | if (attributes.Length == 0)
107 | return "";
108 | // If there is a Company attribute, return its value
109 | return ((AssemblyCompanyAttribute)attributes[0]).Company;
110 | }
111 | }
112 | #endregion
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/ActionsDemo/AboutBox.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | The purpose of this simple RTF editor is to demonstrate a possible usage of Crad's Actions for .NET 2.0.
122 | Crad's Actions are absolutely free and released under Common Public License 1.0.
123 |
124 | If you want more informations, you can catch some at the URL
125 | http://blogs.ugidotnet.org/crad/category/1935.aspx
126 | or subscribing the feed
127 | http://blogs.ugidotnet.org/crad/category/1935.aspx/rss
128 |
129 | Any kind of feedback about this work is really appreciated. Eventually, you can contact me using "Contacts" section on my personal blog:
130 | http://blogs.ugidotnet.org/crad/contact.aspx
131 |
132 |
--------------------------------------------------------------------------------
/ActionsDemo/Crad.Windows.Forms.Actions.Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.30729
7 | 2.0
8 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}
9 | WinExe
10 | Properties
11 | Crad.Windows.Forms.Actions.Sample
12 | Crad.Windows.Forms.Actions.Sample
13 | Crad.Windows.Forms.Actions.Sample.Program
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | v2.0
23 |
24 |
25 |
26 |
27 | 2.0
28 | publish\
29 | true
30 | Disk
31 | false
32 | Foreground
33 | 7
34 | Days
35 | false
36 | false
37 | true
38 | 0
39 | 1.0.0.%2a
40 | false
41 | false
42 | true
43 | true
44 |
45 |
46 | true
47 | full
48 | false
49 | bin\Debug\
50 | DEBUG;TRACE
51 | prompt
52 | 4
53 |
54 |
55 | pdbonly
56 | true
57 | bin\Release\
58 | TRACE
59 | prompt
60 | 4
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | Form
70 |
71 |
72 | AboutBox.cs
73 |
74 |
75 | Form
76 |
77 |
78 | EditorForm.cs
79 |
80 |
81 |
82 |
83 | Designer
84 | AboutBox.cs
85 |
86 |
87 | Designer
88 | EditorForm.cs
89 |
90 |
91 | ResXFileCodeGenerator
92 | Resources.Designer.cs
93 | Designer
94 |
95 |
96 | True
97 | Resources.resx
98 | True
99 |
100 |
101 | SettingsSingleFileGenerator
102 | Settings.Designer.cs
103 |
104 |
105 | True
106 | Settings.settings
107 | True
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | {6e50d1bd-d8ea-4992-8b25-c5a0d7e179a5}
128 | Crad.Windows.Forms.Actions
129 |
130 |
131 |
132 |
133 | False
134 | .NET Framework 3.5 SP1 Client Profile
135 | false
136 |
137 |
138 | False
139 | .NET Framework 3.5 SP1
140 | true
141 |
142 |
143 |
144 |
151 |
--------------------------------------------------------------------------------
/ActionsDemo/EditorForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Text;
6 | using System.Windows.Forms;
7 |
8 | namespace Crad.Windows.Forms.Actions.Sample
9 | {
10 | public partial class EditorForm : Form
11 | {
12 | private bool _modified;
13 | private bool modified
14 | {
15 | get { return _modified; }
16 | set
17 | {
18 | if (_modified != value)
19 | {
20 | _modified = value;
21 | buildFormTitle();
22 | }
23 | }
24 | }
25 |
26 | private string _fileName;
27 | private string fileName
28 | {
29 | get
30 | {
31 | if (string.IsNullOrEmpty(_fileName))
32 | return "Untitled Document";
33 | else
34 | return _fileName;
35 | }
36 | set
37 | {
38 | if (_fileName != value)
39 | {
40 | _fileName = value;
41 | buildFormTitle();
42 | }
43 | }
44 | }
45 |
46 | private void buildFormTitle()
47 | {
48 | StringBuilder sb = new StringBuilder(Application.ProductName);
49 | sb.Append(" - ");
50 | sb.Append(fileName);
51 | if (modified)
52 | sb.Append(" *");
53 | this.Text = sb.ToString();
54 | }
55 |
56 | public EditorForm()
57 | {
58 | InitializeComponent();
59 | buildFormTitle();
60 | actAbout.Text = string.Format("About {0}...", Application.ProductName);
61 | }
62 |
63 | private void richTextBox1_TextChanged(object sender, EventArgs e)
64 | {
65 | modified = true;
66 | }
67 |
68 | private void actNew_Execute(object sender, EventArgs e)
69 | {
70 | richTextBox1.Text = string.Empty;
71 | fileName = string.Empty;
72 | modified = false;
73 | }
74 |
75 | private void actNew_BeforeExecute(object sender, CancelEventArgs e)
76 | {
77 | askSaveChanges(e);
78 | }
79 |
80 | private void askSaveChanges(CancelEventArgs e)
81 | {
82 | DialogResult toSave = (modified ?
83 | MessageBox.Show("Save changes?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) :
84 | DialogResult.No);
85 |
86 | if (toSave == DialogResult.Cancel)
87 | {
88 | e.Cancel = true;
89 | return;
90 | }
91 |
92 | if (toSave == DialogResult.Yes)
93 | {
94 | actSave.DoExecute();
95 | e.Cancel = modified; // this checks if user cancelled save
96 | }
97 | }
98 |
99 | private void actSave_Update(object sender, EventArgs e)
100 | {
101 | actSave.Enabled = modified;
102 | }
103 |
104 | private void actSave_Execute(object sender, EventArgs e)
105 | {
106 | if (string.IsNullOrEmpty(_fileName))
107 | actSaveAs.DoExecute();
108 | else
109 | saveRTF(_fileName);
110 | }
111 |
112 | private void saveRTF(string fileName)
113 | {
114 | richTextBox1.SaveFile(fileName);
115 | this.fileName = fileName;
116 | modified = false;
117 | }
118 |
119 | private void actSaveAs_Execute(object sender, EventArgs e)
120 | {
121 | saveFileDialog1.FileName = fileName;
122 |
123 | if (saveFileDialog1.ShowDialog() == DialogResult.OK)
124 | saveRTF(saveFileDialog1.FileName);
125 | }
126 |
127 | private void actLoad_BeforeExecute(object sender, CancelEventArgs e)
128 | {
129 | askSaveChanges(e);
130 | }
131 |
132 | private void actLoad_Execute(object sender, EventArgs e)
133 | {
134 | if (openFileDialog1.ShowDialog() == DialogResult.OK)
135 | loadRTF(openFileDialog1.FileName);
136 | }
137 |
138 | private void loadRTF(string fileName)
139 | {
140 | richTextBox1.LoadFile(fileName);
141 | this.fileName = fileName;
142 | modified = false;
143 | }
144 |
145 | private void actExit_Execute(object sender, EventArgs e)
146 | {
147 | Application.Exit();
148 | }
149 |
150 | private void actSelectFont_Execute(object sender, EventArgs e)
151 | {
152 | fontDialog1.Font = richTextBox1.SelectionFont;
153 | if (fontDialog1.ShowDialog() == DialogResult.OK)
154 | richTextBox1.SelectionFont = fontDialog1.Font;
155 | }
156 |
157 | private void EditorForm_FormClosing(object sender, FormClosingEventArgs e)
158 | {
159 | CancelEventArgs cea = new CancelEventArgs(false);
160 | askSaveChanges(cea);
161 | e.Cancel = cea.Cancel;
162 | }
163 |
164 | private void actAbout_Execute(object sender, EventArgs e)
165 | {
166 | AboutBox f = new AboutBox();
167 | f.ShowDialog();
168 | }
169 |
170 | }
171 | }
--------------------------------------------------------------------------------
/ActionsDemo/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 |
5 | namespace Crad.Windows.Forms.Actions.Sample
6 | {
7 | static class Program
8 | {
9 | ///
10 | /// The main entry point for the application.
11 | ///
12 | [STAThread]
13 | static void Main()
14 | {
15 | Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new EditorForm());
19 | }
20 |
21 | static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
22 | {
23 | MessageBox.Show("Woooops! Unexpected error!" + Environment.NewLine + Environment.NewLine + e.Exception.Message);
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/ActionsDemo/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Crad's simple RTF Editor")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Crad's simple RTF Editor")]
13 | [assembly: AssemblyCopyright("Copyright © 2006")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d32a800e-8039-40c0-9614-1360ffd03fb1")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
--------------------------------------------------------------------------------
/ActionsDemo/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.17379
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Crad.Windows.Forms.Actions.Sample.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Crad.Windows.Forms.Actions.Sample.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | internal static System.Drawing.Bitmap About {
64 | get {
65 | object obj = ResourceManager.GetObject("About", resourceCulture);
66 | return ((System.Drawing.Bitmap)(obj));
67 | }
68 | }
69 |
70 | internal static System.Drawing.Bitmap Font {
71 | get {
72 | object obj = ResourceManager.GetObject("Font", resourceCulture);
73 | return ((System.Drawing.Bitmap)(obj));
74 | }
75 | }
76 |
77 | internal static System.Drawing.Bitmap New {
78 | get {
79 | object obj = ResourceManager.GetObject("New", resourceCulture);
80 | return ((System.Drawing.Bitmap)(obj));
81 | }
82 | }
83 |
84 | internal static System.Drawing.Bitmap Open {
85 | get {
86 | object obj = ResourceManager.GetObject("Open", resourceCulture);
87 | return ((System.Drawing.Bitmap)(obj));
88 | }
89 | }
90 |
91 | internal static System.Drawing.Bitmap Save {
92 | get {
93 | object obj = ResourceManager.GetObject("Save", resourceCulture);
94 | return ((System.Drawing.Bitmap)(obj));
95 | }
96 | }
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/ActionsDemo/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.17379
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Crad.Windows.Forms.Actions.Sample.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ActionsDemo/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ActionsDemo/Resources/About.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/ActionsDemo/Resources/About.jpg
--------------------------------------------------------------------------------
/ActionsDemo/Resources/Font.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/ActionsDemo/Resources/Font.png
--------------------------------------------------------------------------------
/ActionsDemo/Resources/New.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/ActionsDemo/Resources/New.png
--------------------------------------------------------------------------------
/ActionsDemo/Resources/Open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/ActionsDemo/Resources/Open.png
--------------------------------------------------------------------------------
/ActionsDemo/Resources/Save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/ActionsDemo/Resources/Save.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions.Design/ActionCollectionEditor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.ComponentModel.Design;
4 | using System.Diagnostics;
5 | using System.Reflection;
6 | using System.Collections.Generic;
7 | using System.Windows.Forms;
8 |
9 | namespace Crad.Windows.Forms.Actions.Design
10 | {
11 | internal sealed class ActionCollectionEditor : CollectionEditor
12 | {
13 | private Type[] returnedTypes;
14 |
15 | public ActionCollectionEditor()
16 | : base(typeof(ActionCollection))
17 | {}
18 |
19 | protected override Type[] CreateNewItemTypes()
20 | {
21 | return returnedTypes;
22 | }
23 | public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
24 | {
25 | if (returnedTypes == null)
26 | {
27 | returnedTypes = getReturnedTypes(provider);
28 | }
29 | return base.EditValue(context, provider, value);
30 | }
31 |
32 | private Type[] getReturnedTypes(IServiceProvider provider)
33 | {
34 | List res = new List();
35 |
36 | ITypeDiscoveryService tds = (ITypeDiscoveryService)
37 | provider.GetService(typeof(ITypeDiscoveryService));
38 |
39 | if (tds != null)
40 | {
41 | foreach (Type actionType in tds.GetTypes(typeof(Action), false))
42 | {
43 | if (actionType.GetCustomAttributes(typeof(StandardActionAttribute), false).Length > 0 &&
44 | !res.Contains(actionType))
45 | {
46 | res.Add(actionType);
47 | }
48 | }
49 |
50 | // IMPORTANT: SharpDevelop's type discovery service fails to return Action above,
51 | // so the following adds Action to the list so as to match Visual Studio result.
52 | Type action = typeof(Action);
53 | if (!res.Contains(action))
54 | {
55 | res.Insert(0, action);
56 | }
57 | }
58 |
59 | return res.ToArray();
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions.Design/Crad.Windows.Forms.Actions.Design.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 9.0.30729
7 | 2.0
8 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}
9 | Library
10 | Properties
11 | Crad.Windows.Forms.Actions.Design
12 | Crad.Windows.Forms.Actions.Design
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | v2.0
22 |
23 |
24 |
25 |
26 | 2.0
27 | publish\
28 | true
29 | Disk
30 | false
31 | Foreground
32 | 7
33 | Days
34 | false
35 | false
36 | true
37 | 0
38 | 1.0.0.%2a
39 | false
40 | false
41 | true
42 | False
43 | File
44 |
45 |
46 | true
47 | full
48 | false
49 | bin\Debug\
50 | DEBUG;TRACE
51 | prompt
52 | 4
53 |
54 |
55 | pdbonly
56 | true
57 | bin\Release\
58 | TRACE
59 | prompt
60 | 4
61 |
62 |
63 | true
64 |
65 |
66 | ..\Crad.Windows.Forms.Actions\Crad.snk
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | Properties\SharedAssemblyInfo.cs
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | False
86 | .NET Framework 3.5 SP1 Client Profile
87 | false
88 |
89 |
90 | False
91 | .NET Framework 3.5 SP1
92 | true
93 |
94 |
95 |
96 |
97 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}
98 | Crad.Windows.Forms.Actions
99 |
100 |
101 |
102 |
109 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions.Design/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Crad.Windows.Forms.Actions.Design")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Crad.Windows.Forms.Actions")]
13 | [assembly: AssemblyCopyright("Copyright © 2006")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("E7555FF9-1EA2-4264-822A-A4C88B4164C2")]
24 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio 11
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions", "Crad.Windows.Forms.Actions\Crad.Windows.Forms.Actions.csproj", "{6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}"
4 | EndProject
5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions.Sample", "ActionsDemo\Crad.Windows.Forms.Actions.Sample.csproj", "{88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}"
6 | EndProject
7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions.Design", "Crad.Windows.Forms.Actions.Design\Crad.Windows.Forms.Actions.Design.csproj", "{CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}"
8 | EndProject
9 | Global
10 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
11 | Debug|Any CPU = Debug|Any CPU
12 | Release|Any CPU = Release|Any CPU
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
17 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
21 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
22 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Release|Any CPU.Build.0 = Release|Any CPU
23 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | EndGlobalSection
28 | GlobalSection(SolutionProperties) = preSolution
29 | HideSolutionNode = FALSE
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions.vs2008.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 10.00
3 | # Visual Studio 2008
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions", "Crad.Windows.Forms.Actions\Crad.Windows.Forms.Actions.csproj", "{6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions.Sample", "ActionsDemo\Crad.Windows.Forms.Actions.Sample.csproj", "{88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions.Design", "Crad.Windows.Forms.Actions.Design\Crad.Windows.Forms.Actions.Design.csproj", "{CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{CE82748B-E0C9-4F94-904E-9E6C68066891}"
11 | ProjectSection(SolutionItems) = preProject
12 | SharedAssemblyInfo.cs = SharedAssemblyInfo.cs
13 | EndProjectSection
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|Any CPU = Debug|Any CPU
18 | Release|Any CPU = Release|Any CPU
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
24 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Release|Any CPU.Build.0 = Release|Any CPU
25 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Release|Any CPU.Build.0 = Release|Any CPU
29 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
31 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
32 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Release|Any CPU.Build.0 = Release|Any CPU
33 | EndGlobalSection
34 | GlobalSection(SolutionProperties) = preSolution
35 | HideSolutionNode = FALSE
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions.vs2010.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual C# Express 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions", "Crad.Windows.Forms.Actions\Crad.Windows.Forms.Actions.csproj", "{6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions.Sample", "ActionsDemo\Crad.Windows.Forms.Actions.Sample.csproj", "{88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crad.Windows.Forms.Actions.Design", "Crad.Windows.Forms.Actions.Design\Crad.Windows.Forms.Actions.Design.csproj", "{CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {6E50D1BD-D8EA-4992-8B25-C5A0D7E179A5}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {88AB67C7-A0CF-4811-BC0F-7F908A38E9CF}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {CC59F79A-4F31-454A-B969-DDC2DA5F6DA6}.Release|Any CPU.Build.0 = Release|Any CPU
28 | EndGlobalSection
29 | GlobalSection(SolutionProperties) = preSolution
30 | HideSolutionNode = FALSE
31 | EndGlobalSection
32 | EndGlobal
33 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AboutAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Forms;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | [StandardAction]
8 | public class AboutAction: Action, ISupportInitialize
9 | {
10 | public AboutAction()
11 | {
12 | productName = Application.ProductName;
13 | textPrefix = "About {0}...";
14 | }
15 |
16 | private string productName;
17 |
18 | private string textPrefix;
19 | [DefaultValue("About {0}...")]
20 | public string TextPrefix
21 | {
22 | get { return textPrefix; }
23 | set
24 | {
25 | textPrefix = value;
26 | (this as ISupportInitialize).EndInit();
27 | }
28 | }
29 |
30 | #region ISupportInitialize Members
31 |
32 | void ISupportInitialize.BeginInit()
33 | {
34 | }
35 |
36 | void ISupportInitialize.EndInit()
37 | {
38 | if (!ComponentExtension.IsInDesignMode(this))
39 | this.Text = string.Format(textPrefix, productName);
40 | }
41 |
42 | #endregion
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ActionCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 | using System.ComponentModel;
4 | using System.Drawing.Design;
5 |
6 | namespace Crad.Windows.Forms.Actions
7 | {
8 | [Editor("Crad.Windows.Forms.Actions.Design.ActionCollectionEditor, Crad.Windows.Forms.Actions.Design", typeof(UITypeEditor))]
9 | public class ActionCollection: Collection
10 | {
11 | public ActionCollection(ActionList parent)
12 | {
13 | this.parent = parent;
14 | }
15 |
16 | private ActionList parent;
17 | public ActionList Parent
18 | {
19 | get { return parent; }
20 | }
21 |
22 | protected override void ClearItems()
23 | {
24 | foreach (Action action in this)
25 | action.ActionList = null;
26 |
27 | base.ClearItems();
28 | }
29 |
30 | protected override void InsertItem(int index, Action item)
31 | {
32 | base.InsertItem(index, item);
33 | item.ActionList = Parent;
34 | }
35 |
36 | protected override void RemoveItem(int index)
37 | {
38 | this[index].ActionList = null;
39 | base.RemoveItem(index);
40 | }
41 |
42 | protected override void SetItem(int index, Action item)
43 | {
44 | if (this.Count > index)
45 | this[index].ActionList = null;
46 | base.SetItem(index, item);
47 |
48 | item.ActionList = Parent;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ActionTargetDescriptionInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Collections.Generic;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | public class ActionTargetDescriptionInfo
8 | {
9 | public ActionTargetDescriptionInfo(Type targetType)
10 | {
11 | this.properties = new Dictionary();
12 | this.targetType = targetType;
13 |
14 | foreach (PropertyInfo property in targetType.GetProperties())
15 | properties.Add(property.Name, property);
16 | }
17 |
18 | private Dictionary properties;
19 |
20 | private Type targetType;
21 | public Type TargetType
22 | {
23 | get { return targetType; }
24 | }
25 |
26 | internal void SetValue(string propertyName, object target, object value)
27 | {
28 | if (properties.ContainsKey(propertyName))
29 | properties[propertyName].SetValue(target, value, null);
30 | }
31 |
32 | internal object GetValue(string propertyName, object source)
33 | {
34 | if (properties.ContainsKey(propertyName))
35 | return properties[propertyName].GetValue(source, null);
36 |
37 | return null;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AlignCenterAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class AlignCenterAction: AlignmentBaseAction
8 | {
9 | protected override HorizontalAlignment Alignment
10 | {
11 | get
12 | {
13 | return HorizontalAlignment.Center;
14 | }
15 | }
16 |
17 | public AlignCenterAction()
18 | {
19 | InitializeComponent();
20 | }
21 | private void InitializeComponent()
22 | {
23 | //
24 | // AlignCenterAction
25 | //
26 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.AlignCenter;
27 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
28 | this.Text = "&Center";
29 | this.ToolTipText = "Center alignment";
30 |
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AlignCenterAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AlignLeftAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class AlignLeftAction: AlignmentBaseAction
8 | {
9 | protected override HorizontalAlignment Alignment
10 | {
11 | get { return HorizontalAlignment.Left; }
12 | }
13 |
14 | public AlignLeftAction()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | private void InitializeComponent()
20 | {
21 | //
22 | // AlignLeftAction
23 | //
24 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.AlignLeft;
25 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
26 | this.Text = "&Left";
27 | this.ToolTipText = "Left alignment";
28 |
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AlignLeftAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AlignRightAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class AlignRightAction: AlignmentBaseAction
8 | {
9 | protected override HorizontalAlignment Alignment
10 | {
11 | get { return HorizontalAlignment.Right; }
12 | }
13 |
14 | public AlignRightAction()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | private void InitializeComponent()
20 | {
21 | //
22 | // AlignRightAction
23 | //
24 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.AlignRight;
25 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R)));
26 | this.Text = "&Right";
27 | this.ToolTipText = "Right alignment";
28 |
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AlignRightAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AlignmentBaseAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | public class AlignmentBaseAction: RichTextAction
7 | {
8 | protected virtual HorizontalAlignment Alignment
9 | {
10 | get { return HorizontalAlignment.Left; }
11 | }
12 |
13 | protected override void OnExecute(EventArgs e)
14 | {
15 | if (!ComponentExtension.IsInDesignMode(this) && ActiveRichTextBox != null)
16 | {
17 | ActiveRichTextBox.SelectionAlignment = Alignment;
18 | }
19 | base.OnExecute(e);
20 | }
21 | protected override void OnUpdate(EventArgs e)
22 | {
23 | if (!ComponentExtension.IsInDesignMode(this))
24 | {
25 | this.Checked =
26 | (ActiveRichTextBox != null &&
27 | ActiveRichTextBox.SelectionAlignment == Alignment);
28 | }
29 | base.OnUpdate(e);
30 | }
31 |
32 | public AlignmentBaseAction()
33 | {
34 | InitializeComponent();
35 | }
36 |
37 | private void InitializeComponent()
38 | {
39 | //
40 | // ParagraphStyleAction
41 | //
42 | this.CheckOnClick = true;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/AlignmentBaseAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/BoldAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Drawing;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | [StandardAction]
8 | public class BoldAction: FontStyleAction
9 | {
10 | public BoldAction()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | #region InitializeComponent
16 | private void InitializeComponent()
17 | {
18 | //
19 | // BoldAction
20 | //
21 | this.CheckOnClick = true;
22 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.StyleBold;
23 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.B)));
24 | this.Text = "&Bold";
25 | this.ToolTipText = "Bold";
26 |
27 | }
28 | #endregion
29 |
30 | protected override FontStyle ActionFontStyle
31 | {
32 | get
33 | {
34 | return FontStyle.Bold;
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/BoldAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ComponentExtension.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Created by SharpDevelop.
3 | * User: Lex
4 | * Date: 8/4/2012
5 | * Time: 2:31 PM
6 | *
7 | * To change this template use Tools | Options | Coding | Edit Standard Headers.
8 | */
9 | using System;
10 | using System.ComponentModel;
11 | using System.Collections.Generic;
12 | using System.Windows.Forms;
13 |
14 | namespace Crad.Windows.Forms.Actions
15 | {
16 | ///
17 | /// Description of ComponentHelper.
18 | ///
19 | public static class ComponentExtension
20 | {
21 | private static bool _designMode;
22 |
23 | static ComponentExtension()
24 | {
25 | var designerHosts = new List() { "devenv", "vcsexpress", "vbexpress", "vcexpress", "wdexpress", "sharpdevelop" };
26 | var processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName.ToLowerInvariant();
27 | _designMode = designerHosts.Contains(processName);
28 | }
29 |
30 | internal static bool IsInDesignMode(Component component)
31 | {
32 | // TODO: make this function an extension method if upgraded to .NET 3.5+
33 | return _designMode;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/CopyAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Crad.Windows.Forms.Actions
4 | {
5 | [StandardAction]
6 | public class CopyAction: TextBoxBaseAction
7 | {
8 | public CopyAction()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | //
16 | // CopyAction
17 | //
18 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.Copy;
19 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
20 | this.Text = "&Copy";
21 | this.ToolTipText = "Copy";
22 |
23 | }
24 |
25 | protected override void OnExecute(EventArgs e)
26 | {
27 | if (!ComponentExtension.IsInDesignMode(this) && ActiveTextBox != null)
28 | {
29 | ActiveTextBox.Copy();
30 | }
31 | base.OnExecute(e);
32 | }
33 |
34 | protected override void OnUpdate(EventArgs e)
35 | {
36 | if (!ComponentExtension.IsInDesignMode(this))
37 | {
38 | this.Enabled = (ActiveTextBox != null &&
39 | ActiveTextBox.SelectionLength > 0);
40 | }
41 | base.OnUpdate(e);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/CopyAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Crad.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Crad.snk
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/CutAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | [StandardAction]
8 | public class CutAction: TextBoxBaseAction
9 | {
10 | public CutAction()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private void InitializeComponent()
16 | {
17 | //
18 | // CutAction
19 | //
20 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.Cut;
21 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
22 | this.Text = "Cu&t";
23 | this.ToolTipText = "Cut";
24 |
25 | }
26 |
27 | protected override void OnExecute(EventArgs e)
28 | {
29 | if (!ComponentExtension.IsInDesignMode(this) && ActiveTextBox != null)
30 | {
31 | ActiveTextBox.Cut();
32 | }
33 | base.OnExecute(e);
34 | }
35 | protected override void OnUpdate(EventArgs e)
36 | {
37 | if (!ComponentExtension.IsInDesignMode(this))
38 | {
39 | this.Enabled = (ActiveTextBox != null &&
40 | ActiveTextBox.SelectionLength > 0 && !ActiveTextBox.ReadOnly);
41 | }
42 | base.OnUpdate(e);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/CutAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/DeleteAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class DeleteAction: TextBoxBaseAction
8 | {
9 | public DeleteAction()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | //
17 | // DeleteAction
18 | //
19 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.delete;
20 | this.ShortcutKeys = System.Windows.Forms.Keys.Delete;
21 | this.Text = "&Delete";
22 | this.ToolTipText = "Delete";
23 | }
24 |
25 | protected override void OnExecute(EventArgs e)
26 | {
27 | if (!ComponentExtension.IsInDesignMode(this) && ActiveTextBox != null)
28 | {
29 | ActiveTextBox.SelectedText = string.Empty;
30 | }
31 | base.OnExecute(e);
32 | }
33 | protected override void OnUpdate(EventArgs e)
34 | {
35 | if (!ComponentExtension.IsInDesignMode(this))
36 | {
37 | this.Enabled = (ActiveTextBox != null &&
38 | ActiveTextBox.SelectionLength > 0 && !ActiveTextBox.ReadOnly);
39 | }
40 | base.OnUpdate(e);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/DeleteAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/FontStyleAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Drawing;
4 | using System.Windows.Forms;
5 |
6 | namespace Crad.Windows.Forms.Actions
7 | {
8 | public class FontStyleAction: RichTextAction
9 | {
10 | protected override void OnExecute(EventArgs e)
11 | {
12 | if (!ComponentExtension.IsInDesignMode(this) && ActiveRichTextBox != null)
13 | {
14 | setFontStyle(ActiveRichTextBox, ActionFontStyle);
15 | }
16 | base.OnExecute(e);
17 | }
18 | protected override void OnUpdate(EventArgs e)
19 | {
20 | if (!ComponentExtension.IsInDesignMode(this))
21 | {
22 | this.Checked =
23 | (ActiveRichTextBox != null &&
24 | hasFontStyle(ActiveRichTextBox, ActionFontStyle));
25 | }
26 | base.OnUpdate(e);
27 | }
28 |
29 | private bool hasFontStyle(RichTextBox rtb, FontStyle style)
30 | {
31 | return (rtb.SelectionFont.Style & style) == style;
32 | }
33 | private void setFontStyle(RichTextBox rtb, FontStyle style)
34 | {
35 | if (rtb.SelectionLength == 0)
36 | setCharFontStyle(rtb, style);
37 | else
38 | {
39 | // to avoid screen refreshing, we create a fake RichTextBox
40 | using (RichTextBox a = new RichTextBox())
41 | {
42 | a.SuspendLayout();
43 | a.SelectedRtf = rtb.SelectedRtf;
44 | a.SelectAll();
45 | int selectionStart = a.SelectionStart;
46 | int selectionLength = a.SelectionLength;
47 | int selectionEnd = selectionStart + selectionLength;
48 | for (int x = selectionStart; x < selectionEnd; ++x)
49 | {
50 | // Set temporary selection
51 | a.Select(x, 1);
52 | // Toggle font style of the selection
53 | setCharFontStyle(a, style);
54 | }
55 | // Restore the original selection
56 | a.SelectAll();
57 | rtb.SelectedRtf = a.SelectedRtf;
58 | }
59 | }
60 | }
61 |
62 | private void setCharFontStyle(RichTextBox rtb, FontStyle style)
63 | {
64 | if (this.Checked)
65 | rtb.SelectionFont = new Font(rtb.SelectionFont,
66 | rtb.SelectionFont.Style | style);
67 | else
68 | rtb.SelectionFont = new Font(rtb.SelectionFont,
69 | rtb.SelectionFont.Style & (~style));
70 | }
71 | protected virtual FontStyle ActionFontStyle
72 | {
73 | get { return FontStyle.Regular; }
74 | }
75 |
76 | private void InitializeComponent()
77 | {
78 | //
79 | // FontStyleAction
80 | //
81 | this.CheckOnClick = true;
82 |
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/FontStyleAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Images/Action.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Images/Action.bmp
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Images/ActionList.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Images/ActionList.bmp
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ItalicAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Drawing;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | [StandardAction]
8 | public class ItalicAction: FontStyleAction
9 | {
10 | public ItalicAction()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private void InitializeComponent()
16 | {
17 | //
18 | // ItalicAction
19 | //
20 | this.CheckOnClick = true;
21 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.StyleItalic;
22 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
23 | this.Text = "&Italic";
24 | this.ToolTipText = "Italic";
25 |
26 | }
27 |
28 | protected override FontStyle ActionFontStyle
29 | {
30 | get
31 | {
32 | return FontStyle.Italic;
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ItalicAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ListAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Forms;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | public class ListAction: Action
8 | {
9 | public ListAction()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private ListView targetListView;
15 |
16 | [DefaultValue(null)]
17 | public ListView TargetListView
18 | {
19 | get { return targetListView; }
20 | set { targetListView = value; }
21 | }
22 |
23 |
24 | protected virtual View ListViewStyle
25 | {
26 | get { return View.Details; }
27 | }
28 |
29 | protected override void OnExecute(EventArgs e)
30 | {
31 | if (!ComponentExtension.IsInDesignMode(this) && TargetListView != null)
32 | {
33 | TargetListView.View = ListViewStyle;
34 | }
35 | base.OnExecute(e);
36 | }
37 |
38 | protected override void OnUpdate(EventArgs e)
39 | {
40 | if (!ComponentExtension.IsInDesignMode(this))
41 | {
42 | this.Checked = (TargetListView != null &&
43 | TargetListView.View == ListViewStyle);
44 | }
45 | base.OnUpdate(e);
46 | }
47 |
48 | private void InitializeComponent()
49 | {
50 | //
51 | // ListAction
52 | //
53 | this.CheckOnClick = true;
54 |
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ListAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/PasteAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | [StandardAction]
8 | public class PasteAction: TextBoxBaseAction
9 | {
10 | public PasteAction()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private void InitializeComponent()
16 | {
17 | //
18 | // PasteAction
19 | //
20 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.Paste;
21 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
22 | this.Text = "&Paste";
23 | this.ToolTipText = "Paste";
24 |
25 | }
26 |
27 | protected override void OnExecute(EventArgs e)
28 | {
29 | if (!ComponentExtension.IsInDesignMode(this) && ActiveTextBox != null)
30 | {
31 | ActiveTextBox.Paste();
32 | }
33 | base.OnExecute(e);
34 | }
35 |
36 | protected override void OnUpdate(EventArgs e)
37 | {
38 | base.OnUpdate(e);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/PasteAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | &Paste
122 |
123 |
124 | Paste
125 |
126 |
127 |
128 | Ctrl+V
129 |
130 |
131 | False
132 |
133 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Crad.Windows.Forms.Actions")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Crad.Windows.Forms.Actions")]
13 | [assembly: AssemblyCopyright("Copyright © 2006")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("348ead85-3796-4ae6-aaea-dedf694060d9")]
24 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.17379
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Crad.Windows.Forms.Actions.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Crad.Windows.Forms.Actions.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | internal static System.Drawing.Bitmap AlignCenter {
64 | get {
65 | object obj = ResourceManager.GetObject("AlignCenter", resourceCulture);
66 | return ((System.Drawing.Bitmap)(obj));
67 | }
68 | }
69 |
70 | internal static System.Drawing.Bitmap AlignJustified {
71 | get {
72 | object obj = ResourceManager.GetObject("AlignJustified", resourceCulture);
73 | return ((System.Drawing.Bitmap)(obj));
74 | }
75 | }
76 |
77 | internal static System.Drawing.Bitmap AlignLeft {
78 | get {
79 | object obj = ResourceManager.GetObject("AlignLeft", resourceCulture);
80 | return ((System.Drawing.Bitmap)(obj));
81 | }
82 | }
83 |
84 | internal static System.Drawing.Bitmap AlignRight {
85 | get {
86 | object obj = ResourceManager.GetObject("AlignRight", resourceCulture);
87 | return ((System.Drawing.Bitmap)(obj));
88 | }
89 | }
90 |
91 | internal static System.Drawing.Bitmap BulletedList {
92 | get {
93 | object obj = ResourceManager.GetObject("BulletedList", resourceCulture);
94 | return ((System.Drawing.Bitmap)(obj));
95 | }
96 | }
97 |
98 | internal static System.Drawing.Bitmap Copy {
99 | get {
100 | object obj = ResourceManager.GetObject("Copy", resourceCulture);
101 | return ((System.Drawing.Bitmap)(obj));
102 | }
103 | }
104 |
105 | internal static System.Drawing.Bitmap Cut {
106 | get {
107 | object obj = ResourceManager.GetObject("Cut", resourceCulture);
108 | return ((System.Drawing.Bitmap)(obj));
109 | }
110 | }
111 |
112 | internal static System.Drawing.Bitmap delete {
113 | get {
114 | object obj = ResourceManager.GetObject("delete", resourceCulture);
115 | return ((System.Drawing.Bitmap)(obj));
116 | }
117 | }
118 |
119 | internal static System.Drawing.Bitmap Paste {
120 | get {
121 | object obj = ResourceManager.GetObject("Paste", resourceCulture);
122 | return ((System.Drawing.Bitmap)(obj));
123 | }
124 | }
125 |
126 | internal static System.Drawing.Bitmap Redo {
127 | get {
128 | object obj = ResourceManager.GetObject("Redo", resourceCulture);
129 | return ((System.Drawing.Bitmap)(obj));
130 | }
131 | }
132 |
133 | internal static System.Drawing.Bitmap StyleBold {
134 | get {
135 | object obj = ResourceManager.GetObject("StyleBold", resourceCulture);
136 | return ((System.Drawing.Bitmap)(obj));
137 | }
138 | }
139 |
140 | internal static System.Drawing.Bitmap StyleItalic {
141 | get {
142 | object obj = ResourceManager.GetObject("StyleItalic", resourceCulture);
143 | return ((System.Drawing.Bitmap)(obj));
144 | }
145 | }
146 |
147 | internal static System.Drawing.Bitmap StyleUnderline {
148 | get {
149 | object obj = ResourceManager.GetObject("StyleUnderline", resourceCulture);
150 | return ((System.Drawing.Bitmap)(obj));
151 | }
152 | }
153 |
154 | internal static System.Drawing.Bitmap Undo {
155 | get {
156 | object obj = ResourceManager.GetObject("Undo", resourceCulture);
157 | return ((System.Drawing.Bitmap)(obj));
158 | }
159 | }
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/RedoAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class RedoAction: RichTextAction
8 | {
9 | public RedoAction()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | protected override void OnExecute(EventArgs e)
15 | {
16 | if (!ComponentExtension.IsInDesignMode(this) && ActiveRichTextBox != null)
17 | {
18 | this.ActiveRichTextBox.Redo();
19 | }
20 | base.OnExecute(e);
21 | }
22 | protected override void OnUpdate(EventArgs e)
23 | {
24 | if (!ComponentExtension.IsInDesignMode(this))
25 | {
26 | this.Enabled = (ActiveRichTextBox != null && ActiveRichTextBox.CanRedo);
27 | }
28 |
29 | base.OnUpdate(e);
30 | }
31 |
32 | private void InitializeComponent()
33 | {
34 | //
35 | // RedoAction
36 | //
37 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.Redo;
38 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
39 | this.Text = "&Redo";
40 | this.ToolTipText = "Redo";
41 |
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/RedoAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/AlignCenter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/AlignCenter.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/AlignJustified.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/AlignJustified.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/AlignLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/AlignLeft.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/AlignRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/AlignRight.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/BulletedList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/BulletedList.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/Copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/Copy.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/Cut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/Cut.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/Paste.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/Paste.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/Redo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/Redo.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/StyleBold.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/StyleBold.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/StyleItalic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/StyleItalic.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/StyleUnderline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/StyleUnderline.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/Undo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/Undo.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/Resources/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/Crad.Windows.Forms.Actions/Resources/delete.png
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/RichTextAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Forms;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | public class RichTextAction: Action
8 | {
9 | [Browsable(false)]
10 | protected RichTextBox ActiveRichTextBox
11 | {
12 | get
13 | {
14 | RichTextBox result = null;
15 | if (ActionList != null)
16 | result = ActionList.ActiveControl as RichTextBox;
17 |
18 | return result;
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/SelectAllAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class SelectAllAction: TextBoxBaseAction
8 | {
9 | public SelectAllAction()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | //
17 | // SelectAllAction
18 | //
19 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.NumPad5)));
20 | this.Text = "Select &All";
21 | this.ToolTipText = "Select All";
22 |
23 | }
24 |
25 | protected override void OnExecute(EventArgs e)
26 | {
27 | if (!ComponentExtension.IsInDesignMode(this))
28 | {
29 | if (ActiveTextBox != null && ActiveTextBox.CanSelect)
30 | ActiveTextBox.SelectAll();
31 |
32 | }
33 | base.OnExecute(e);
34 | }
35 | protected override void OnUpdate(EventArgs e)
36 | {
37 | if (!ComponentExtension.IsInDesignMode(this))
38 | {
39 | this.Enabled = (ActiveTextBox != null && ActiveTextBox.CanSelect);
40 | }
41 | base.OnUpdate(e);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/SelectAllAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/StandardActionAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)]
8 | public class StandardActionAttribute: Attribute
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/TextBoxBaseAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Forms;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | public class TextBoxBaseAction: Action
8 | {
9 | [Browsable(false)]
10 | protected TextBoxBase ActiveTextBox
11 | {
12 | get
13 | {
14 | TextBoxBase result = null;
15 | if (this.ActionList != null)
16 | result = this.ActionList.ActiveControl as TextBoxBase;
17 |
18 | return result;
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/UnderlineAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Drawing;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | [StandardAction]
8 | public class UnderlineAction: FontStyleAction
9 | {
10 | public UnderlineAction()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | private void InitializeComponent()
16 | {
17 | //
18 | // UnderlineAction
19 | //
20 | this.CheckOnClick = true;
21 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.StyleUnderline;
22 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U)));
23 | this.Text = "&Underline";
24 | this.ToolTipText = "Underline";
25 |
26 | }
27 |
28 | protected override FontStyle ActionFontStyle
29 | {
30 | get
31 | {
32 | return FontStyle.Underline;
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/UnderlineAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/UndoAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Crad.Windows.Forms.Actions
4 | {
5 | [StandardAction]
6 | public class UndoAction: TextBoxBaseAction
7 | {
8 | public UndoAction()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | private void InitializeComponent()
14 | {
15 | //
16 | // UndoAction
17 | //
18 | this.Image = global::Crad.Windows.Forms.Actions.Properties.Resources.Undo;
19 | this.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
20 | this.Text = "&Undo";
21 | this.ToolTipText = "Undo";
22 | }
23 |
24 | protected override void OnExecute(EventArgs e)
25 | {
26 | if (!ComponentExtension.IsInDesignMode(this) && ActiveTextBox != null)
27 | {
28 | this.ActiveTextBox.Undo();
29 | }
30 | base.OnExecute(e);
31 | }
32 |
33 | protected override void OnUpdate(EventArgs e)
34 | {
35 | if (!ComponentExtension.IsInDesignMode(this))
36 | {
37 | this.Enabled = (ActiveTextBox != null && ActiveTextBox.CanUndo);
38 | }
39 |
40 | base.OnUpdate(e);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/UndoAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/UpdatablePropertyAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace Crad.Windows.Forms.Actions
6 | {
7 | public class UpdatablePropertyAttribute: Attribute
8 | {
9 | }
10 | }
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ViewDetailsAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class ViewDetailsAction: ListAction
8 | {
9 | public ViewDetailsAction()
10 | {
11 | InitializeComponent();
12 | }
13 | private void InitializeComponent()
14 | {
15 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ViewDetailsAction));
16 | //
17 | // ViewDetailsAction
18 | //
19 | this.Image = ((System.Drawing.Image)(resources.GetObject("$this.Image")));
20 | this.Text = "View &details";
21 | this.ToolTipText = "View details";
22 |
23 | }
24 | protected override View ListViewStyle
25 | {
26 | get { return View.Details; }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ViewDetailsAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
124 |
125 |
126 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
127 | YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAC5JREFUOE9jYKAy
128 | +A80DxmDjCfEp9wJ6LaSyqeOC2CmDFwYjLoAEZMjNRYoSssA/71QsFiGjkIAAAAASUVORK5CYII=
129 |
130 |
131 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ViewLargeIconsAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class ViewLargeIconsAction: ListAction
8 | {
9 | public ViewLargeIconsAction()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ViewLargeIconsAction));
17 | //
18 | // ViewLargeIconsAction
19 | //
20 | this.Image = ((System.Drawing.Image)(resources.GetObject("$this.Image")));
21 | this.Text = "View &large icons";
22 | this.ToolTipText = "View large icons";
23 | }
24 |
25 | protected override View ListViewStyle
26 | {
27 | get { return View.LargeIcon; }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ViewListAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class ViewListAction: ListAction
8 | {
9 | public ViewListAction()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ViewListAction));
17 | //
18 | // ViewListAction
19 | //
20 | this.Image = ((System.Drawing.Image)(resources.GetObject("$this.Image")));
21 | this.Text = "View &list";
22 | this.ToolTipText = "View list";
23 |
24 | }
25 |
26 | protected override View ListViewStyle
27 | {
28 | get { return View.List; }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ViewSmallIconsAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace Crad.Windows.Forms.Actions
5 | {
6 | [StandardAction]
7 | public class ViewSmallIconsAction: ListAction
8 | {
9 | public ViewSmallIconsAction()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void InitializeComponent()
15 | {
16 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ViewSmallIconsAction));
17 | //
18 | // ViewSmallIconsAction
19 | //
20 | this.Image = ((System.Drawing.Image)(resources.GetObject("$this.Image")));
21 | this.Text = "View &small icons";
22 | this.ToolTipText = "View small icons";
23 | }
24 |
25 | protected override View ListViewStyle
26 | {
27 | get { return View.SmallIcon; }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Crad.Windows.Forms.Actions/ViewSmallIconsAction.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | False
122 |
123 |
124 |
125 |
126 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
127 | YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAEpJREFUOE9jYKAW
128 | SOi48D+g4cJ/ss1LAGoGAYOEA2BDJkyY8L+goOB/gEcAcYYGVFz475Bx4L9CBMSAYQZGA5jECB0NMBID
129 | DKgcAF/kVT8ruiX9AAAAAElFTkSuQmCC
130 |
131 |
132 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ActionList for Windows Forms/.NET
2 |
3 | [](https://www.nuget.org/packages/ActionListWinForms/)
4 | [](https://www.nuget.org/packages/ActionListWinForms/)
5 |
6 | This project is originally developed by Marco De Sanctis and released under Common Public License 1.0. It hasn't been updated for a while,
7 |
8 | http://www.codeproject.com/Articles/13879/ActionList-for-NET-2-0
9 |
10 | This fork is aiming to provide bug fixes based on its 1.1.1.0 release.
11 |
12 | This project is released under Common Public License 1.0.
13 |
--------------------------------------------------------------------------------
/SharedAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Version information for an assembly consists of the following four values:
6 | //
7 | // Major Version
8 | // Minor Version
9 | // Build Number
10 | // Revision
11 | //
12 | // You can specify all the values or you can default the Revision and Build Numbers
13 | // by using the '*' as shown below:
14 | [assembly: AssemblyVersion("2.0.0.0")]
15 | [assembly: AssemblyFileVersion("2.0.0.0")]
16 |
--------------------------------------------------------------------------------
/all.bat:
--------------------------------------------------------------------------------
1 | CALL clean.bat
2 | CALL release.net40.bat
3 | powershell -File sign.ps1
4 |
--------------------------------------------------------------------------------
/clean.bat:
--------------------------------------------------------------------------------
1 | set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319
2 | call %MSBuildDir%\msbuild Crad.Windows.Forms.Actions.sln /t:clean
3 | call %MSBuildDir%\msbuild Crad.Windows.Forms.Actions.sln /t:clean /p:Configuration=Release
4 | @IF %ERRORLEVEL% NEQ 0 PAUSE
--------------------------------------------------------------------------------
/debug.bat:
--------------------------------------------------------------------------------
1 | set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319
2 | call %MSBuildDir%\msbuild Crad.Windows.Forms.Actions.sln /t:build /p:Configuration="Debug"
3 | @IF %ERRORLEVEL% NEQ 0 PAUSE
--------------------------------------------------------------------------------
/release.net40.bat:
--------------------------------------------------------------------------------
1 | set msBuildDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin
2 | call "%MSBuildDir%\msbuild" Crad.Windows.Forms.Actions.sln /t:build /p:Configuration=Release /p:TargetFrameworkVersion=v4.5 /p:OutputPath=..\bin\net45\
3 | @IF %ERRORLEVEL% NEQ 0 PAUSE
--------------------------------------------------------------------------------
/sign.ps1:
--------------------------------------------------------------------------------
1 | $foundCert = Test-Certificate -Cert Cert:\CurrentUser\my\43eb601ecc35ed5263141d4dc4aff9c77858451c -User
2 | if(!$foundCert)
3 | {
4 | Write-Host "Certificate doesn't exist. Exit."
5 | exit
6 | }
7 |
8 | Write-Host "Certificate found. Sign the assemblies."
9 | $signtool = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x64\signtool.exe"
10 | & $signtool sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a .\bin\net45\Crad.Windows.Forms.Actions.dll | Write-Debug
11 |
12 | Write-Host "Verify digital signature."
13 | & $signtool verify /pa /q .\bin\net45\Crad.Windows.Forms.Actions.dll 2>&1 | Write-Debug
14 | if ($LASTEXITCODE -ne 0)
15 | {
16 | Write-Host "$_.FullName is not signed. Exit."
17 | exit $LASTEXITCODE
18 | }
19 |
20 | Remove-Item -Path .\*.nupkg
21 | $nuget = ".\.nuget\nuget.exe"
22 | & $nuget update /self | Write-Debug
23 | & $nuget pack ActionListwinForms.nuspec
24 |
25 | Write-Host "Sign NuGet packages."
26 | & $nuget sign *.nupkg -CertificateSubjectName "Yang Li" -Timestamper http://timestamp.digicert.com | Write-Debug
27 | & $nuget verify -All *.nupkg | Write-Debug
28 | if ($LASTEXITCODE -ne 0)
29 | {
30 | Write-Host "NuGet package is not signed. Exit."
31 | exit $LASTEXITCODE
32 | }
33 |
34 | Write-Host "Verification finished."
--------------------------------------------------------------------------------
/tools/NDepend.Helpers.FileDirectoryPath.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/tools/NDepend.Helpers.FileDirectoryPath.dll
--------------------------------------------------------------------------------
/tools/Toolbox.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/tools/Toolbox.exe
--------------------------------------------------------------------------------
/tools/gacutil_2.0.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/tools/gacutil_2.0.exe
--------------------------------------------------------------------------------
/tools/gacutil_2.0.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/tools/gacutil_4.0.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lextm/ActionListWinForms/4ac6e298b4410af1d60a31bcbed4ef3c77db3a53/tools/gacutil_4.0.exe
--------------------------------------------------------------------------------
/tools/gacutil_4.0.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------