├── .gitignore
├── AddMaterials.sln
├── AddMaterials
├── AddMaterials.addin
├── AddMaterials.csproj
├── Command.cs
├── FillPatternBenchmarkCommand.cs
├── Properties
│ ├── ._AssemblyInfo.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Resources
│ └── delete.png
├── View
│ ├── Commands
│ │ └── RelayCommand.cs
│ ├── Controls
│ │ ├── FillPatternViewerControlWpf.xaml
│ │ └── FillPatternViewerControlWpf.xaml.cs
│ ├── Converters
│ │ ├── BitmapSourceConverter.cs
│ │ ├── BitmapToImageSourceConverter.cs
│ │ ├── InversedStatusToErrorSignVisibilityConverter.cs
│ │ ├── StatusToErrorMessageConverter.cs
│ │ └── StatusToErrorSignVisibilityConverter.cs
│ ├── FillPatternsView.xaml
│ ├── FillPatternsView.xaml.cs
│ ├── MaterialsView.xaml
│ └── MaterialsView.xaml.cs
└── ViewModel
│ ├── Enum
│ └── Status.cs
│ ├── Events
│ └── DialogCloseEventArgs.cs
│ ├── FillPatternViewModel.cs
│ ├── FillPatternsViewModel.cs
│ ├── MaterialBrowserViewModel.cs
│ ├── MaterialViewModel.cs
│ └── ViewModelLocator.cs
├── LICENSE
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2 | [Bb]in/
3 | [Oo]bj/
4 |
5 | # mstest test results
6 | TestResults
7 |
8 | ## Ignore Visual Studio temporary files, build results, and
9 | ## files generated by popular Visual Studio add-ons.
10 |
11 | # User-specific files
12 | *.suo
13 | *.user
14 | *.sln.docstates
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Rr]elease/
19 | x64/
20 | *_i.c
21 | *_p.c
22 | *.ilk
23 | *.meta
24 | *.obj
25 | *.pch
26 | *.pdb
27 | *.pgc
28 | *.pgd
29 | *.rsp
30 | *.sbr
31 | *.tlb
32 | *.tli
33 | *.tlh
34 | *.tmp
35 | *.log
36 | *.vspscc
37 | *.vssscc
38 | .builds
39 |
40 | # Visual C++ cache files
41 | ipch/
42 | *.aps
43 | *.ncb
44 | *.opensdf
45 | *.sdf
46 |
47 | # Visual Studio profiler
48 | *.psess
49 | *.vsp
50 | *.vspx
51 |
52 | # Guidance Automation Toolkit
53 | *.gpState
54 |
55 | # ReSharper is a .NET coding add-in
56 | _ReSharper*
57 |
58 | # NCrunch
59 | *.ncrunch*
60 | .*crunch*.local.xml
61 |
62 | # Installshield output folder
63 | [Ee]xpress
64 |
65 | # DocProject is a documentation generator add-in
66 | DocProject/buildhelp/
67 | DocProject/Help/*.HxT
68 | DocProject/Help/*.HxC
69 | DocProject/Help/*.hhc
70 | DocProject/Help/*.hhk
71 | DocProject/Help/*.hhp
72 | DocProject/Help/Html2
73 | DocProject/Help/html
74 |
75 | # Click-Once directory
76 | publish
77 |
78 | # Publish Web Output
79 | *.Publish.xml
80 |
81 | # NuGet Packages Directory
82 | packages
83 |
84 | # Windows Azure Build Output
85 | csx
86 | *.build.csdef
87 |
88 | # Windows Store app package directory
89 | AppPackages/
90 |
91 | # Others
92 | [Bb]in
93 | [Oo]bj
94 | sql
95 | TestResults
96 | [Tt]est[Rr]esult*
97 | *.Cache
98 | ClientBin
99 | [Ss]tyle[Cc]op.*
100 | ~$*
101 | *.dbmdl
102 | Generated_Code #added for RIA/Silverlight projects
103 |
104 | # Backup & report files from converting an old project file to a newer
105 | # Visual Studio version. Backup files are not needed, because we have git ;-)
106 | _UpgradeReport_Files/
107 | Backup*/
108 | UpgradeLog*.XML
109 |
--------------------------------------------------------------------------------
/AddMaterials.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddMaterials", "AddMaterials\AddMaterials.csproj", "{CC6FB9CE-8D9C-494C-BA77-29961459647B}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {CC6FB9CE-8D9C-494C-BA77-29961459647B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {CC6FB9CE-8D9C-494C-BA77-29961459647B}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {CC6FB9CE-8D9C-494C-BA77-29961459647B}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {CC6FB9CE-8D9C-494C-BA77-29961459647B}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/AddMaterials/AddMaterials.addin:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AddMaterials
5 | Some description for AddMaterials
6 | AddMaterials.dll
7 | AddMaterials.Command
8 | a9ec88c8-33a3-4a4d-bb91-e0cb54623b34
9 | TBC_
10 | The Building Coder, http://thebuildingcoder.typepad.com
11 |
12 |
13 | AddMaterials Fill Pattern benchmark
14 | Some description for AddMaterials
15 | AddMaterials.dll
16 | AddMaterials.FillPatternBenchmarkCommand
17 | ff23fb73-8f11-4c93-b867-9a599a73dd53
18 | TBC_
19 | The Building Coder, http://thebuildingcoder.typepad.com
20 |
21 |
22 |
--------------------------------------------------------------------------------
/AddMaterials/AddMaterials.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | None
6 |
7 |
8 |
9 |
10 | Debug
11 | AnyCPU
12 |
13 |
14 |
15 |
16 | {CC6FB9CE-8D9C-494C-BA77-29961459647B}
17 | Library
18 | Properties
19 | AddMaterials
20 | v4.7
21 | 512
22 |
23 |
24 | true
25 | full
26 | false
27 | bin\Debug\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 | Program
32 | $(ProgramW6432)\Autodesk\Revit 2014\Revit.exe
33 | false
34 |
35 |
36 | pdbonly
37 | true
38 | bin\Release\
39 | TRACE
40 | prompt
41 | 4
42 | Program
43 | $(ProgramW6432)\Autodesk\Revit 2014\Revit.exe
44 | false
45 |
46 |
47 |
48 |
49 | ..\..\..\lib\revit\2020\SDK\Samples\FireRating\VB.NET\Microsoft.Office.Interop.Excel.dll
50 | True
51 |
52 |
53 |
54 |
55 | ..\..\..\..\Program Files\Autodesk\Revit 2020\RevitAPI.dll
56 | False
57 |
58 |
59 | ..\..\..\..\Program Files\Autodesk\Revit 2020\RevitAPIUI.dll
60 | False
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | True
79 | True
80 | Resources.resx
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | FillPatternViewerControlWpf.xaml
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | FillPatternsView.xaml
100 |
101 |
102 | MaterialsView.xaml
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 | PublicResXFileCodeGenerator
112 | Resources.Designer.cs
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 | Designer
121 | MSBuild:Compile
122 |
123 |
124 | Designer
125 | MSBuild:Compile
126 |
127 |
128 | Designer
129 | MSBuild:Compile
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | copy "$(ProjectDir)AddMaterials.addin" "$(AppData)\Autodesk\REVIT\Addins\2016"
139 | copy "$(ProjectDir)bin\debug\AddMaterials.dll" "$(AppData)\Autodesk\REVIT\Addins\2016"
140 |
141 |
--------------------------------------------------------------------------------
/AddMaterials/Command.cs:
--------------------------------------------------------------------------------
1 | #region Namespaces
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using AddMaterials.View;
6 | using AddMaterials.ViewModel;
7 | using AddMaterials.ViewModel.Enum;
8 | using Autodesk.Revit.ApplicationServices;
9 | using Autodesk.Revit.Attributes;
10 | using Autodesk.Revit.DB;
11 | using Autodesk.Revit.UI;
12 | using Excel = Microsoft.Office.Interop.Excel;
13 | #endregion
14 |
15 | namespace AddMaterials
16 | {
17 | [Transaction( TransactionMode.Manual )]
18 | public class Command : IExternalCommand
19 | {
20 | private const string _not_available = "N/A";
21 |
22 | //const string _input_file_name = "C:/RevitAPI/MaterialList.xlsx";
23 | //private const string _input_file_name = "C:/tmp/MaterialList.xlsx";
24 | //const string _input_file_name = "Z:/a/doc/revit/blog/zip/MaterialList.xlsx";
25 |
26 | const string _input_file_name = "Z:/a/doc/revit/tbc/zip/MaterialList.xlsx";
27 |
28 | private static string PluralSuffix( int i )
29 | {
30 | return 1 == i ? "" : "s";
31 | }
32 |
33 | public Result Execute(
34 | ExternalCommandData commandData,
35 | ref string message,
36 | ElementSet elements )
37 | {
38 | UIApplication uiapp = commandData.Application;
39 | UIDocument uidoc = uiapp.ActiveUIDocument;
40 | Document doc = uidoc.Document;
41 |
42 | // Create dictionary of existing
43 | // materials keyed by their name.
44 |
45 | Dictionary materials
46 | = new FilteredElementCollector( doc )
47 | .OfClass( typeof( Material ) )
48 | .Cast()
49 | .ToDictionary(
50 | e => e.Name );
51 |
52 | // Ditto for fill patterns.
53 |
54 | Dictionary fillPatterns
55 | = new FilteredElementCollector( doc )
56 | .OfClass( typeof( FillPatternElement ) )
57 | .Cast()
58 | .ToDictionary(
59 | e => e.Name );
60 |
61 | try
62 | {
63 | var materialsToImport = ReadMaterialsFromXlsx( materials, fillPatterns ).ToList();
64 | var browser = new MaterialBrowserViewModel { Materials = materialsToImport };
65 | var window = new MaterialsView { DataContext = browser };
66 | var res = window.ShowDialog();
67 | if( !res.HasValue || !res.Value )
68 | return Result.Cancelled;
69 |
70 | var materialsToAdd = browser.Materials.Where( x => x.AddToProject ).ToList();
71 | if( !materialsToAdd.Any() )
72 | return Result.Cancelled;
73 |
74 | using( var tx = new Transaction( doc ) )
75 | {
76 | tx.Start( "Add Materials" );
77 | foreach( var materialViewModel in materialsToAdd )
78 | {
79 | var materialCSI = materials[materialViewModel.BaseMaterialClass];
80 | var myMaterial = materialCSI.Duplicate( materialViewModel.Name );
81 | myMaterial.Color = materialViewModel.Color;
82 | myMaterial.Transparency = (int) materialViewModel.Transparency;
83 | if( materialViewModel.SurfacePattern != null )
84 | {
85 | myMaterial.SurfaceForegroundPatternId
86 | = fillPatterns[materialViewModel.SurfacePattern.Name].Id;
87 | }
88 | if( materialViewModel.CutPattern != null )
89 | {
90 | myMaterial.CutForegroundPatternId
91 | = fillPatterns[materialViewModel.CutPattern.Name].Id;
92 | }
93 | }
94 | tx.Commit();
95 | }
96 |
97 | string msg = string.Format(
98 | "{0} row{1} successfully parsed and "
99 | + "{2} material{3} added:",
100 | materialsToImport.Count,
101 | PluralSuffix( materialsToImport.Count ),
102 | materialsToAdd.Count,
103 | PluralSuffix( materialsToAdd.Count ) );
104 |
105 | TaskDialog dlg = new TaskDialog(
106 | "Revit AddMaterials" );
107 |
108 | dlg.MainInstruction = msg;
109 |
110 | dlg.MainContent = string.Join( ", ",
111 | materialsToAdd.Select( x => x.Name ) ) + ".";
112 |
113 | dlg.Show();
114 | }
115 | catch( Exception ex )
116 | {
117 | message
118 | = "Revit AddMaterials Exception:\n" + ex;
119 |
120 | return Result.Failed;
121 | }
122 | return Result.Succeeded;
123 | }
124 |
125 | private IEnumerable ReadMaterialsFromXlsx(
126 | Dictionary materials,
127 | Dictionary fillPatterns )
129 | {
130 | Excel.Application excel
131 | = new Excel.Application();
132 |
133 | excel.Visible = false;
134 |
135 | Excel.Workbook workbook = excel.Workbooks.Open(
136 | _input_file_name, 0, true, 5, "", "", true,
137 | Excel.XlPlatform.xlWindows, "\t", false,
138 | false, 0, true, 1, 0 );
139 |
140 | Excel.Worksheet worksheet = (Excel.Worksheet)
141 | workbook.Worksheets.get_Item( 1 );
142 |
143 | Excel.Range range = worksheet.UsedRange;
144 |
145 | int iRow = 5;
146 |
147 | while( null != range.Cells[iRow, 1].Value2 )
148 | {
149 | string matName = (string) range.Cells[iRow, 1].Value2;
150 | matName += " " + (string) range.Cells[iRow, 2].Value2;
151 | matName += " " + (string) range.Cells[iRow, 3].Value2;
152 | if( !string.IsNullOrEmpty( matName ) )
153 | {
154 | double red = (double) range.Cells[iRow, 4].Value2;
155 | double green = (double) range.Cells[iRow, 5].Value2;
156 | double blue = (double) range.Cells[iRow, 6].Value2;
157 | double transparency = (double) range.Cells[iRow, 8].Value2;
158 | string surPatternName = (string) range.Cells[iRow, 9].Value2;
159 | string cutPatternName = (string) range.Cells[iRow, 10].Value2;
160 | string csi = (string) range.Cells[iRow, 11].Value2;
161 |
162 | FillPatternElement fillPatternElement;
163 | FillPattern surfacePattern = null, cutPattern = null;
164 | if( fillPatterns.TryGetValue( surPatternName, out fillPatternElement ) )
165 | surfacePattern = fillPatternElement.GetFillPattern();
166 |
167 | if( fillPatterns.TryGetValue( cutPatternName, out fillPatternElement ) )
168 | cutPattern = fillPatternElement.GetFillPattern();
169 |
170 | var status = Status.Normal;
171 | if( !materials.ContainsKey( csi ) )
172 | status = Status.BaseMaterialClassNotFound;
173 | if( materials.ContainsKey( matName ) )
174 | status = Status.ProjectAlreadyContainsMaterialWithTheSameName;
175 |
176 | yield return new MaterialViewModel
177 | {
178 | Name = matName,
179 | BaseMaterialClass = csi,
180 | Color = new Color(
181 | Byte.Parse( red.ToString() ),
182 | Byte.Parse( green.ToString() ),
183 | Byte.Parse( blue.ToString() ) ),
184 | Transparency = transparency,
185 | SurfacePattern = surfacePattern,
186 | CutPattern = cutPattern,
187 | Status = status,
188 | AddToProject = status == Status.Normal
189 | };
190 | }
191 | ++iRow;
192 | }
193 | workbook.Close( true, null, null );
194 | excel.Quit();
195 | }
196 | }
197 | }
198 |
199 | // Z:\a\rvt\add_material_csi_03.rvt
200 | // Z:\a\rvt\fill_pattern_viewer.rvt
201 |
202 |
--------------------------------------------------------------------------------
/AddMaterials/FillPatternBenchmarkCommand.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Windows.Input;
3 | using AddMaterials.View;
4 | using AddMaterials.ViewModel;
5 | using Autodesk.Revit.Attributes;
6 | using Autodesk.Revit.DB;
7 | using Autodesk.Revit.UI;
8 |
9 | namespace AddMaterials
10 | {
11 | [Transaction( TransactionMode.ReadOnly )]
12 | public class FillPatternBenchmarkCommand
13 | : IExternalCommand
14 | {
15 | public Result Execute(
16 | ExternalCommandData commandData,
17 | ref string message,
18 | ElementSet elements )
19 | {
20 | var doc = commandData.Application
21 | .ActiveUIDocument.Document;
22 |
23 | var fillPatternElements
24 | = new FilteredElementCollector( doc )
25 | .OfClass( typeof( FillPatternElement ) )
26 | .OfType()
27 | .OrderBy( fp => fp.Name )
28 | .ToList();
29 |
30 | var fillPatterns
31 | = fillPatternElements.Select(
32 | fpe => fpe.GetFillPattern() );
33 |
34 | FillPatternsViewModel fillPatternsViewModel
35 | = new FillPatternsViewModel( fillPatterns
36 | .Select( x => new FillPatternViewModel(
37 | x ) ) );
38 |
39 | FillPatternsView fillPatternsView
40 | = new FillPatternsView()
41 | {
42 | DataContext = fillPatternsViewModel
43 | };
44 |
45 | fillPatternsView.ShowDialog();
46 |
47 | return Result.Succeeded;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/AddMaterials/Properties/._AssemblyInfo.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremytammik/AddMaterials/43533712f759a3cf150d8f895dc2237c3d87be75/AddMaterials/Properties/._AssemblyInfo.cs
--------------------------------------------------------------------------------
/AddMaterials/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( "Revit AddMaterials Add-In" )]
9 | [assembly: AssemblyDescription( "Add materials from Excel spreadsheet to Revit project" )]
10 | [assembly: AssemblyConfiguration( "" )]
11 | [assembly: AssemblyCompany( "Autodesk Inc." )]
12 | [assembly: AssemblyProduct( "Revit AddMaterials Add-In" )]
13 | [assembly: AssemblyCopyright( "Copyright 2014 © Jeremy Tammik Autodesk Inc." )]
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( "321044f7-b0b2-4b1c-af18-e71a19252be0" )]
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 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | // 2014-03-20 2014.0.0.0 migrated from Revit 2011 to Revit 2014
36 | // 2014-03-29 2014.0.0.1 error message and reporting enhancements
37 | // 2014-04-02 2014.0.0.2 usability enhancements by Alexander Ignatovich
38 | // 2014-04-20 2015.0.0.2 migrated to Revit 2015
39 | // 2014-04-20 2015.0.0.3 integrated fill pattern viewer benchmark
40 | // 2015-11-04 2015.0.0.4 updated FillPatternViewerControlWpf.xaml.cs, merged pull request #1 by @kfpopeye
41 | // 2015-11-04 2015.0.0.5 updated FillPatternViewerControlWpf.xaml.cs, merged pull request #3 by @kfpopeye
42 | // 2015-11-04 2016.0.0.0 tested and migrated to Revit 2016
43 | // 2019-06-07 2016.0.0.1 integrated pull request #4 by @ridespirals -- handle 0 or negative DashPatterns
44 | // 2019-06-12 2020.0.0.0 flat migration to Revit 2020
45 | // 2019-06-12 2020.0.0.1 implemented suggestion by Александр Пекшев: Replace FillPattern = "{Binding CutPattern}" with FillPattern = "{Binding CutPattern, IsAsync=True}" and drawing thumbnails can get even faster
46 | //
47 | [assembly: AssemblyVersion( "2020.0.0.1" )]
48 | [assembly: AssemblyFileVersion( "2020.0.0.1" )]
49 |
--------------------------------------------------------------------------------
/AddMaterials/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
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 AddMaterials.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 | public 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 | public 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("AddMaterials.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 | public static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | public static System.Drawing.Bitmap Error {
67 | get {
68 | object obj = ResourceManager.GetObject("Error", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/AddMaterials/Properties/Resources.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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
--------------------------------------------------------------------------------
/AddMaterials/Resources/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jeremytammik/AddMaterials/43533712f759a3cf150d8f895dc2237c3d87be75/AddMaterials/Resources/delete.png
--------------------------------------------------------------------------------
/AddMaterials/View/Commands/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Windows.Input;
4 |
5 |
6 | namespace AddMaterials.View.Commands
7 | {
8 | public class RelayCommand : ICommand
9 | {
10 | private readonly Action