├── .gitattributes ├── .gitignore ├── LICENSE ├── Project Sweeper 2021.sln ├── Project Sweeper ├── AssetDefinition.cs ├── BaseStyleDefinition.cs ├── ComboBoxFlatStyle.xaml ├── Constants.cs ├── ExternalApplication - Licensing.cs ├── ExternalApplication.cs ├── FillPatternCleaner │ ├── ExtCommands.cs │ ├── FPC_MainWindow.xaml │ ├── FPC_MainWindow.xaml.cs │ ├── FillPatternDefinition.cs │ ├── ProgressBarWindow.xaml │ ├── ProgressBarWindow.xaml.cs │ ├── SingleElementWindow.xaml │ └── SingleElementWindow.xaml.cs ├── FillPatternViewer │ ├── BitmapSourceConverter.cs │ ├── BitmapToImageSourceConverter.cs │ ├── FillPatternViewerControlWpf.xaml │ └── FillPatternViewerControlWpf.xaml.cs ├── FillRegionTypeCleaner │ ├── ExtCommand.cs │ ├── FRTC_MainWindow.xaml │ ├── FRTC_MainWindow.xaml.cs │ ├── FillRegionTypeDefinition.cs │ ├── SingleElementWindow.xaml │ └── SingleElementWindow.xaml.cs ├── FodyWeavers.xml ├── Help and About ExtCommands.cs ├── LinePatternCleaner │ ├── ExtCommands.cs │ ├── LPC_MainWindow.xaml │ ├── LPC_MainWindow.xaml.cs │ ├── LinePatternDefinition.cs │ ├── SingleElementWindow.xaml │ └── SingleElementWindow.xaml.cs ├── LinePatternViewer │ ├── LinePatternViewerControlWpf.xaml │ └── LinePatternViewerControlWpf.xaml.cs ├── LineStyleCleaner │ ├── ExtCommands.cs │ ├── LSC_MainWindow.xaml │ ├── LSC_MainWindow.xaml.cs │ ├── LineStyleDefinition.cs │ ├── SingleElementWindow.xaml │ ├── SingleElementWindow.xaml.cs │ └── revit internal graphicstyle categories.txt ├── LocalizationProvider.cs ├── Project Sweeper - ML - Locked.addin ├── Project Sweeper - ML - debug.addin ├── Project Sweeper - debug.addin ├── Project Sweeper - secure.addin ├── Project Sweeper.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── Language.Designer.cs │ ├── Language.fr.resx │ ├── Language.resx │ ├── RibbonImages │ │ ├── about.png │ │ ├── about16x16.png │ │ ├── fpc.png │ │ ├── fpc16x16.png │ │ ├── frt.png │ │ ├── frt16x16.png │ │ ├── help.png │ │ ├── help16x16.png │ │ ├── lpc.png │ │ ├── lpc16x16.png │ │ ├── lsc.png │ │ ├── lsc16x16.png │ │ ├── tsc.png │ │ └── tsc16x16.png │ └── pkh logo vertical.jpg ├── TemplateFile.cs ├── TemplateFile.xml ├── TemplateFile.xsd ├── TextStyleCleaner │ ├── ExtCommands.cs │ ├── SingleElementWindow.xaml │ ├── SingleElementWindow.xaml.cs │ ├── TSC_CompareWindow .xaml │ ├── TSC_CompareWindow .xaml.cs │ ├── TSC_MainWindow.xaml │ ├── TSC_MainWindow.xaml.cs │ └── TextStyleDefinition.cs ├── ViewOwnerDefinition.cs ├── Windows │ ├── About Box.xaml │ ├── About Box.xaml.cs │ ├── Input Box.xaml │ ├── Input Box.xaml.cs │ ├── ListUsersWindow.xaml │ ├── ListUsersWindow.xaml.cs │ ├── ListViewsWindow.xaml │ ├── ListViewsWindow.xaml.cs │ ├── ResultWindow.xaml │ ├── ResultWindow.xaml.cs │ ├── TemplateWindow.xaml │ └── TemplateWindow.xaml.cs ├── app.config ├── packages.config └── projectsweeper.log4net.config ├── README.md └── html_help_files.zip /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 kfpopeye 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Project Sweeper 2021.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29806.167 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project Sweeper", "Project Sweeper\Project Sweeper.csproj", "{E4213E54-E339-4502-A0A3-B0B0957E7C2B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | MLTI_Debug|x64 = MLTI_Debug|x64 12 | MLTI_Release|x64 = MLTI_Release|x64 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {E4213E54-E339-4502-A0A3-B0B0957E7C2B}.Debug|x64.ActiveCfg = Debug|x64 17 | {E4213E54-E339-4502-A0A3-B0B0957E7C2B}.Debug|x64.Build.0 = Debug|x64 18 | {E4213E54-E339-4502-A0A3-B0B0957E7C2B}.MLTI_Debug|x64.ActiveCfg = MLTI_Debug|x64 19 | {E4213E54-E339-4502-A0A3-B0B0957E7C2B}.MLTI_Debug|x64.Build.0 = MLTI_Debug|x64 20 | {E4213E54-E339-4502-A0A3-B0B0957E7C2B}.MLTI_Release|x64.ActiveCfg = MLTI_Release|x64 21 | {E4213E54-E339-4502-A0A3-B0B0957E7C2B}.MLTI_Release|x64.Build.0 = MLTI_Release|x64 22 | {E4213E54-E339-4502-A0A3-B0B0957E7C2B}.Release|x64.ActiveCfg = Release|x64 23 | {E4213E54-E339-4502-A0A3-B0B0957E7C2B}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {345EC9D2-C2DE-4ED4-B7BC-0D346A8AC228} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Project Sweeper/AssetDefinition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Autodesk.Revit.DB; 3 | 4 | namespace PKHL.ProjectSweeper 5 | { 6 | 7 | public class AssetDefinition 8 | { 9 | public string Type { get; set; } 10 | public string Name { get; set; } 11 | public int RvtId { get; set; } 12 | 13 | //generic 14 | public AssetDefinition(string type, string name) 15 | { 16 | Type = type; 17 | Name = name; 18 | RvtId = -1; 19 | Debug(); 20 | } 21 | 22 | //used by line pattern cleaner 23 | public AssetDefinition(GraphicsStyle gs) 24 | { 25 | if(gs.GraphicsStyleCategory.Parent != null) 26 | Type = gs.GraphicsStyleCategory.Parent.Name; 27 | else 28 | Type = gs.GraphicsStyleCategory.Name; 29 | Name = gs.Name + " : " + LocalizationProvider.GetLocalizedValue(gs.GraphicsStyleType.ToString()); // cut or projection 30 | RvtId = gs.Id.IntegerValue; 31 | Debug(); 32 | } 33 | 34 | //used by fill pattern cleaner 35 | public AssetDefinition(Material m) 36 | { 37 | Type = "Material"; 38 | Name = m.Name; 39 | RvtId = m.Id.IntegerValue; 40 | Debug(); 41 | } 42 | 43 | //used by fill pattern cleaner 44 | public AssetDefinition(Element el) 45 | { 46 | Type = "Component"; 47 | Name = el.Category.Name + " : " + el.Name; 48 | RvtId = el.Id.IntegerValue; 49 | Debug(); 50 | } 51 | 52 | //used by fill pattern cleaner 53 | public AssetDefinition(FilledRegionType frt) 54 | { 55 | Type = "Region"; 56 | Name = frt.Name; 57 | RvtId = frt.Id.IntegerValue; 58 | Debug(); 59 | } 60 | 61 | //used by fill pattern cleaner 62 | public AssetDefinition(Family fs) 63 | { 64 | Type = "Family"; 65 | Name = fs.FamilyCategory.Name + " : " + fs.Name; 66 | RvtId = fs.Id.IntegerValue; 67 | Debug(); 68 | } 69 | 70 | private void Debug() 71 | { 72 | System.Diagnostics.Debug.WriteLine("\tCreate AssetDefinition for {0} {1}", Type, Name); 73 | } 74 | 75 | // override object.Equals 76 | public override bool Equals(object obj) 77 | { 78 | if (obj == null || GetType() != obj.GetType()) 79 | { 80 | return false; 81 | } 82 | 83 | AssetDefinition rhs = obj as AssetDefinition; 84 | if (this.Type != rhs.Type || 85 | this.Name != rhs.Name || 86 | this.RvtId != rhs.RvtId) 87 | return false; 88 | 89 | return true; 90 | } 91 | 92 | // override object.GetHashCode 93 | public override int GetHashCode() 94 | { 95 | return this.RvtId; 96 | } 97 | } 98 | 99 | //public class AssetDefinition 100 | //{ 101 | // public string Type { get; set; } 102 | // public string Name { get; set; } 103 | 104 | // public AssetDefinition(string t, string n) 105 | // { 106 | // Type = t; 107 | // Name = n; 108 | // } 109 | //} 110 | } 111 | -------------------------------------------------------------------------------- /Project Sweeper/BaseStyleDefinition.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using Autodesk.Revit.DB; 4 | using System.Collections.Generic; 5 | 6 | namespace PKHL.ProjectSweeper 7 | { 8 | public abstract class BaseStyleDefinition : INotifyPropertyChanged 9 | { 10 | public string StyleName { get; set; } 11 | public int ItsId { get; set; } 12 | public abstract int NumberOfUses { get; } 13 | 14 | /// 15 | /// if NewStyle id = -1 16 | /// 17 | public bool DeleteElements 18 | { 19 | get 20 | { 21 | if (_newstyle != null && _newstyle.ItsId == -1) 22 | return true; 23 | else 24 | return false; 25 | } 26 | } 27 | 28 | /// 29 | /// If this.NewStyle is null or its Id = -1 false, otherwise true; 30 | /// 31 | public virtual bool StyleToBeConverted 32 | { 33 | get 34 | { 35 | if (_newstyle == null || _newstyle.ItsId == -1) 36 | return false; 37 | else 38 | return true; 39 | } 40 | } 41 | 42 | protected bool is_deleteable = true; 43 | public virtual bool IsDeleteable 44 | { 45 | get 46 | { 47 | return is_deleteable; 48 | } 49 | set 50 | { 51 | is_deleteable = value; 52 | OnPropertyChanged("IsDeleteable"); 53 | if (is_deleteable) 54 | System.Diagnostics.Debug.WriteLine(StyleName + " is now deletable."); 55 | else 56 | System.Diagnostics.Debug.WriteLine(StyleName + " is no longer deletable."); 57 | } 58 | } 59 | 60 | public abstract bool StyleToBeDeleted { get; set; } 61 | 62 | protected Color _itsColour = null; 63 | public string StyleColour 64 | { 65 | get 66 | { 67 | //BUGFIX: check if valid 68 | if (_itsColour == null || !_itsColour.IsValid) 69 | return string.Empty; 70 | else 71 | return "#" + _itsColour.Red.ToString("X2") + _itsColour.Green.ToString("X2") + _itsColour.Blue.ToString("X2"); 72 | } 73 | } 74 | 75 | protected BaseStyleDefinition _newstyle = null; 76 | /// 77 | /// If new style equals THIS, sets to null 78 | /// Returns THIS if new style is null, returns new style otherwise 79 | /// 80 | public BaseStyleDefinition NewStyle 81 | { 82 | get 83 | { 84 | return _newstyle; 85 | } 86 | set 87 | { 88 | if (_newstyle != null && _newstyle.Equals(value)) 89 | { 90 | System.Diagnostics.Debug.WriteLine(StyleName + " newStyle = value. Did nothing."); 91 | return; 92 | } 93 | if (this.Equals(value) || value == null) 94 | { 95 | _newstyle = null; 96 | System.Diagnostics.Debug.WriteLine(StyleName + " newStyle set to -> null"); 97 | } 98 | else 99 | { 100 | _newstyle = value; 101 | System.Diagnostics.Debug.WriteLine(StyleName + " newStyle set to -> " + _newstyle.StyleName); 102 | } 103 | OnPropertyChanged("NewStyle"); 104 | OnPropertyChanged("StyleToBeConverted"); 105 | } 106 | } 107 | 108 | public BaseStyleDefinition() { } 109 | 110 | protected Color ConvertInt(int rgb) 111 | { 112 | byte[] bArray = BitConverter.GetBytes(rgb); 113 | if (BitConverter.IsLittleEndian) 114 | return new Color(bArray[0], bArray[1], bArray[2]); 115 | else 116 | return new Color(bArray[1], bArray[2], bArray[3]); 117 | } 118 | 119 | public event PropertyChangedEventHandler PropertyChanged; 120 | protected virtual void OnPropertyChanged(string propertyName) 121 | { 122 | PropertyChangedEventHandler handler = PropertyChanged; 123 | if (handler != null) 124 | handler(this, new PropertyChangedEventArgs(propertyName)); 125 | } 126 | 127 | // override object.Equals 128 | public override bool Equals(object obj) 129 | { 130 | if (obj == null || GetType() != obj.GetType()) 131 | return false; 132 | BaseStyleDefinition rsd = obj as BaseStyleDefinition; 133 | if (this.StyleName != rsd.StyleName || 134 | this.ItsId != rsd.ItsId) 135 | return false; 136 | return true; 137 | } 138 | 139 | // override object.GetHashCode 140 | public override int GetHashCode() 141 | { 142 | return ItsId; 143 | } 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /Project Sweeper/ComboBoxFlatStyle.xaml: -------------------------------------------------------------------------------- 1 |  3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /Project Sweeper/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace PKHL.ProjectSweeper 2 | { 3 | class Constants 4 | { 5 | public static string LSC_HELP = @"LineStyleCleaner.htm"; 6 | public static string LPC_HELP = @"LinePatternCleaner.htm"; 7 | public static string TSC_HELP = @"TextStyleCleaner.htm"; 8 | public static string FRT_HELP = @"FillRegionTypeCleaner.htm"; 9 | public static string FPC_HELP = @"FillPatternCleaner.htm"; 10 | 11 | #if MULTILICENSE 12 | public static string PRODUCTID = @"82cd28c4-2c4a-41d0-87cf-99cbf0faa369"; 13 | public static string GROUP_NAME = "Project Sweeper ML"; 14 | #else 15 | public static string GROUP_NAME = "Project Sweeper"; 16 | public static string APP_STORE_ID = @"appstore.exchange.autodesk.com:projectsweeper"; 17 | #endif 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Project Sweeper/ExternalApplication.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Windows.Media.Imaging; 4 | using Autodesk.Revit.UI; 5 | using log4net; 6 | using log4net.Config; 7 | 8 | namespace PKHL.ProjectSweeper 9 | { 10 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 11 | [Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)] 12 | public partial class ProjectSweeper : IExternalApplication 13 | { 14 | internal static ContextualHelp _contextualHelp = null; 15 | private static ILog _log = null; 16 | 17 | private void CreateRibbonPanel(UIControlledApplication application) 18 | { 19 | // This method is used to create the ribbon panel. 20 | // which contains the controlled application. 21 | 22 | string addinPath = Properties.Settings.Default.AddinPath; 23 | string dllPath = addinPath + @"\Project Sweeper.dll"; 24 | RibbonPanel pkhlPanel = application.CreateRibbonPanel(Constants.GROUP_NAME); 25 | 26 | PushButton lscButton = pkhlPanel.AddItem( 27 | new PushButtonData("lscButton", 28 | LocalizationProvider.GetLocalizedValue("LSC_Title_Ribbon"), 29 | dllPath, 30 | "PKHL.ProjectSweeper.LineStyleCleaner.main_command")) as PushButton; 31 | lscButton.Image = NewBitmapImage("lsc16x16.png"); 32 | lscButton.LargeImage = NewBitmapImage("lsc.png"); 33 | lscButton.ToolTip = LocalizationProvider.GetLocalizedValue("LSC_IconTip"); 34 | lscButton.Visible = true; 35 | lscButton.AvailabilityClassName = "PKHL.ProjectSweeper.LineStyleCleaner.command_AvailableCheck"; 36 | lscButton.SetContextualHelp(_contextualHelp); 37 | 38 | PushButton lpcButton = pkhlPanel.AddItem( 39 | new PushButtonData("lpcButton", 40 | LocalizationProvider.GetLocalizedValue("LPC_Title_Ribbon"), 41 | dllPath, 42 | "PKHL.ProjectSweeper.LinePatternCleaner.MainCommand")) as PushButton; 43 | lpcButton.Image = NewBitmapImage("lpc16x16.png"); 44 | lpcButton.LargeImage = NewBitmapImage("lpc.png"); 45 | lpcButton.ToolTip = LocalizationProvider.GetLocalizedValue("LPC_IconTip"); 46 | lpcButton.Visible = true; 47 | lpcButton.AvailabilityClassName = "PKHL.ProjectSweeper.LinePatternCleaner.command_AvailableCheck"; 48 | lpcButton.SetContextualHelp(_contextualHelp); 49 | 50 | PushButton tscButton = pkhlPanel.AddItem( 51 | new PushButtonData("tscButton", 52 | LocalizationProvider.GetLocalizedValue("TSC_Title_Ribbon"), 53 | dllPath, 54 | "PKHL.ProjectSweeper.TextStyleCleaner.main_command")) as PushButton; 55 | tscButton.Image = NewBitmapImage("tsc16x16.png"); 56 | tscButton.LargeImage = NewBitmapImage("tsc.png"); 57 | tscButton.ToolTip = LocalizationProvider.GetLocalizedValue("TSC_IconTip"); //Cleans redundant text styles from a project file. 58 | tscButton.Visible = true; 59 | tscButton.AvailabilityClassName = "PKHL.ProjectSweeper.TextStyleCleaner.command_AvailableCheck"; 60 | tscButton.SetContextualHelp(_contextualHelp); 61 | 62 | PushButton frtcButton = pkhlPanel.AddItem( 63 | new PushButtonData("frtcButton", 64 | LocalizationProvider.GetLocalizedValue("FRTC_Title_Ribbon"), 65 | dllPath, 66 | "PKHL.ProjectSweeper.FillRegionTypeCleaner.main_command")) as PushButton; 67 | frtcButton.Image = NewBitmapImage("frt16x16.png"); 68 | frtcButton.LargeImage = NewBitmapImage("frt.png"); 69 | frtcButton.ToolTip = LocalizationProvider.GetLocalizedValue("FRTC_IconTip"); 70 | frtcButton.Visible = true; 71 | frtcButton.AvailabilityClassName = "PKHL.ProjectSweeper.FillRegionTypeCleaner.command_AvailableCheck"; 72 | frtcButton.SetContextualHelp(_contextualHelp); 73 | 74 | PushButton fpcButton = pkhlPanel.AddItem( 75 | new PushButtonData("fpcButton", 76 | LocalizationProvider.GetLocalizedValue("FPC_Title_Ribbon"), 77 | dllPath, 78 | "PKHL.ProjectSweeper.FillPatternCleaner.MainCommand")) as PushButton; 79 | fpcButton.Image = NewBitmapImage("fpc16x16.png"); 80 | fpcButton.LargeImage = NewBitmapImage("fpc.png"); 81 | fpcButton.ToolTip = LocalizationProvider.GetLocalizedValue("FPC_IconTip"); //Cleans redundant fill patterns from a project file. 82 | fpcButton.Visible = true; 83 | fpcButton.AvailabilityClassName = "PKHL.ProjectSweeper.FillPatternCleaner.CommandAvailableCheck"; 84 | fpcButton.SetContextualHelp(_contextualHelp); 85 | 86 | // Create a slide out 87 | pkhlPanel.AddSlideOut(); 88 | 89 | PushButton aboutButton = pkhlPanel.AddItem( 90 | new PushButtonData("aboutButton", 91 | LocalizationProvider.GetLocalizedValue("ABOUT_Title"), 92 | dllPath, 93 | "PKHL.ProjectSweeper.AboutBoxCommand")) as PushButton; 94 | aboutButton.Image = NewBitmapImage("about16x16.png"); 95 | aboutButton.LargeImage = NewBitmapImage("about.png"); 96 | aboutButton.ToolTip = LocalizationProvider.GetLocalizedValue("ABOUT_IconTip"); 97 | aboutButton.AvailabilityClassName = "PKHL.ProjectSweeper.AlwaysAvailableCheck"; 98 | 99 | PushButton helpButton = pkhlPanel.AddItem( 100 | new PushButtonData("helpButton", 101 | LocalizationProvider.GetLocalizedValue("HelpButton"), 102 | dllPath, 103 | "PKHL.ProjectSweeper.ApplicationHelp")) as PushButton; 104 | helpButton.Image = NewBitmapImage("help16x16.png"); 105 | helpButton.LargeImage = NewBitmapImage("help.png"); 106 | helpButton.ToolTip = LocalizationProvider.GetLocalizedValue("HELP_IconTip"); 107 | helpButton.AvailabilityClassName = "PKHL.ProjectSweeper.AlwaysAvailableCheck"; 108 | 109 | #if MULTILICENSE 110 | PushButton eulaButton = pkhlPanel.AddItem( 111 | new PushButtonData("eulaButton", 112 | LocalizationProvider.GetLocalizedValue("EULA_Title"), 113 | dllPath, 114 | "PKHL.ProjectSweeper.ApplicationEula")) as PushButton; 115 | eulaButton.Image = NewBitmapImage("about16x16.png"); 116 | eulaButton.LargeImage = NewBitmapImage("about.png"); 117 | eulaButton.ToolTip = LocalizationProvider.GetLocalizedValue("EULA_IconTip"); 118 | eulaButton.AvailabilityClassName = "PKHL.ProjectSweeper.AlwaysAvailableCheck"; 119 | #endif 120 | 121 | #if DEBUG 122 | PushButton test_Button = pkhlPanel.AddItem(new PushButtonData("TestButton", "Test Entitlement", dllPath, "PKHL.ProjectSweeper.test_Entitlement")) as PushButton; 123 | test_Button.Image = NewBitmapImage("help16x16.png"); 124 | test_Button.LargeImage = NewBitmapImage("help.png"); 125 | test_Button.ToolTip = "Test the entitlement system. Debug mode only."; 126 | test_Button.Visible = true; 127 | test_Button.AvailabilityClassName = "PKHL.ProjectSweeper.AlwaysAvailableCheck"; 128 | #endif 129 | } 130 | 131 | /// 132 | /// Load a new icon bitmap from embedded resources. 133 | /// For the BitmapImage, make sure you reference WindowsBase and PresentationCore, and import the System.Windows.Media.Imaging namespace. 134 | /// Drag images into Resources folder in solution explorer and set build action to "Embedded Resource" 135 | /// 136 | private BitmapImage NewBitmapImage(string imageName) 137 | { 138 | Stream s = this.GetType().Assembly.GetManifestResourceStream("PKHL.ProjectSweeper.Resources.RibbonImages." + imageName); 139 | BitmapImage img = new BitmapImage(); 140 | 141 | img.BeginInit(); 142 | img.StreamSource = s; 143 | img.EndInit(); 144 | 145 | return img; 146 | } 147 | 148 | #region Event Handlers 149 | public Autodesk.Revit.UI.Result OnShutdown(UIControlledApplication application) 150 | { 151 | return Autodesk.Revit.UI.Result.Succeeded; 152 | } 153 | 154 | public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application) 155 | { 156 | string s = this.GetType().Assembly.Location; 157 | Properties.Settings.Default.AddinPath = System.IO.Path.GetDirectoryName(s); 158 | Properties.Settings.Default.Save(); 159 | System.Diagnostics.Debug.WriteLine("Addin path = " + Properties.Settings.Default.AddinPath); 160 | 161 | string logConfig = Path.Combine(Properties.Settings.Default.AddinPath, "projectsweeper.log4net.config"); 162 | FileInfo configStream = new FileInfo(logConfig); 163 | XmlConfigurator.Configure(configStream); 164 | _log = LogManager.GetLogger(typeof(ProjectSweeper)); 165 | _log.InfoFormat("Running version: {0}", this.GetType().Assembly.GetName().Version.ToString()); 166 | _log.InfoFormat("Found myself at: {0}", Properties.Settings.Default.AddinPath); 167 | 168 | _contextualHelp = new ContextualHelp( 169 | ContextualHelpType.ChmFile, 170 | Path.Combine( 171 | Directory.GetParent(Properties.Settings.Default.AddinPath).ToString(), //contents directory 172 | LocalizationProvider.GetLocalizedValue("HelpFile"))); 173 | 174 | CreateRibbonPanel(application); 175 | 176 | try 177 | { 178 | pkhCommon.StringHelper.RemoveNewLines("This causes the common library to load so the FRTC, LSC and FPC commands don't throw a file not found error."); 179 | } 180 | catch(Exception) 181 | { 182 | } 183 | 184 | return Autodesk.Revit.UI.Result.Succeeded; 185 | } 186 | #endregion 187 | } 188 | } -------------------------------------------------------------------------------- /Project Sweeper/FillPatternCleaner/FillPatternDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System; 3 | using System.Windows; 4 | using Autodesk.Revit.DB; 5 | 6 | namespace PKHL.ProjectSweeper.FillPatternCleaner 7 | { 8 | /// 9 | /// Description of FillPatternDefinition. 10 | /// 11 | public class FillPatternDefinition : BaseStyleDefinition 12 | { 13 | /// 14 | /// Drafting or model 15 | /// 16 | public FillPatternTarget TheTarget; 17 | public FillPattern thePattern { get; set; } 18 | public int MaterialUses { get; set; } 19 | public int ComponentUses { get; set; } 20 | public int RegionUses { get; set; } 21 | private List OwnerAssets = null; 22 | private Units projectUnits = null; 23 | private enum pattType { Complex, Simple_Crosshatch, Simple_Parallel_Lines }; 24 | private pattType _pattType = pattType.Simple_Parallel_Lines; 25 | private string _PatternType = null; 26 | 27 | /// 28 | /// Returns basedefinition.DeleteItems, used for clarity in code. 29 | /// 30 | public bool SetToNone 31 | { 32 | get 33 | { 34 | return base.DeleteElements; 35 | } 36 | } 37 | 38 | private int _familyUses { get; set; } 39 | public int FamilyUses { get { return _familyUses; } } 40 | 41 | /// 42 | /// Return localized version of Model or Drafting 43 | /// 44 | public string ItsType 45 | { 46 | get 47 | { 48 | return LocalizationProvider.GetLocalizedValue(TheTarget.ToString()); 49 | } 50 | } 51 | 52 | /// 53 | /// Complex, Simple Crosshatch or Simple Parallel Lines 54 | /// 55 | public string PatternType 56 | { 57 | get 58 | { 59 | if (thePattern == null) 60 | return null; 61 | if (_PatternType == null) 62 | _PatternType = LocalizationProvider.GetLocalizedValue(_pattType.ToString()); 63 | return _PatternType; 64 | } 65 | } 66 | 67 | public string LineAngle 68 | { 69 | get 70 | { 71 | if (_pattType == pattType.Complex) 72 | return null; 73 | if (thePattern == null) 74 | return null; 75 | 76 | return UnitFormatUtils.Format(projectUnits, UnitType.UT_Angle, thePattern.GetFillGrid(0).Angle, false, false); 77 | } 78 | } 79 | 80 | public string LineSpacing1 81 | { 82 | get 83 | { 84 | if (_pattType == pattType.Complex || projectUnits == null) 85 | return null; 86 | if (thePattern == null) 87 | return null; 88 | 89 | return UnitFormatUtils.Format(projectUnits, UnitType.UT_Length, thePattern.GetFillGrid(0).Offset, false, false); 90 | } 91 | } 92 | 93 | public string LineSpacing2 94 | { 95 | get 96 | { 97 | if (_pattType == pattType.Complex || _pattType == pattType.Simple_Parallel_Lines || projectUnits == null) 98 | return null; 99 | if (thePattern == null) 100 | return null; 101 | 102 | return UnitFormatUtils.Format(projectUnits, UnitType.UT_Length, thePattern.GetFillGrid(1).Offset, false, false); 103 | } 104 | } 105 | 106 | /// 107 | /// Returns false if a family is using this pattern. 108 | /// 109 | public override bool IsDeleteable 110 | { 111 | get 112 | { 113 | if (_familyUses != 0) 114 | return false; 115 | else 116 | return base.IsDeleteable; 117 | } 118 | set 119 | { 120 | base.IsDeleteable = value; 121 | } 122 | } 123 | 124 | private bool itsDeletedStatus = false; 125 | /// 126 | /// Throws exception if setting to true and IsDeleteable is false 127 | /// 128 | public override bool StyleToBeDeleted 129 | { 130 | get { return itsDeletedStatus; } 131 | set 132 | { 133 | if (IsDeleteable) 134 | { 135 | itsDeletedStatus = value; 136 | System.Diagnostics.Debug.WriteLine(StyleName + " : StyleToBeDeleted set to -> " + itsDeletedStatus.ToString()); 137 | } 138 | else 139 | if(value == true) 140 | throw new InvalidOperationException("Cannot delete the style: " + this.StyleName); 141 | } 142 | } 143 | 144 | public void AddAsset(AssetDefinition ad) 145 | { 146 | if (ad.Type == "Family") 147 | { 148 | if (!OwnerAssets.Contains(ad)) 149 | { 150 | OwnerAssets.Add(ad); 151 | _familyUses++; 152 | } 153 | } 154 | else 155 | throw new ArgumentException("AddAsset received an asset that was not a family type"); 156 | } 157 | 158 | public List getAssets() 159 | { 160 | return OwnerAssets; 161 | } 162 | 163 | public override int NumberOfUses 164 | { 165 | get 166 | { 167 | return (MaterialUses + ComponentUses + RegionUses + FamilyUses); 168 | } 169 | } 170 | 171 | public FillPatternDefinition() 172 | { 173 | System.Diagnostics.Debug.WriteLine("FPD ctor : blank"); 174 | } 175 | 176 | /// 177 | /// Does not include owner assets, used for handling user selected elements only 178 | /// 179 | public FillPatternDefinition(FillPatternElement fpe) : base() 180 | { 181 | StyleName = fpe.Name; 182 | System.Diagnostics.Debug.WriteLine("FPD ctor : " + StyleName); 183 | ItsId = fpe.Id.IntegerValue; 184 | thePattern = fpe.GetFillPattern(); 185 | projectUnits = fpe.Document.GetUnits(); 186 | 187 | if (thePattern != null) 188 | { 189 | TheTarget = thePattern.Target; 190 | if (thePattern.GridCount > 2) 191 | _pattType = pattType.Complex; 192 | else if (thePattern.GridCount == 2) 193 | _pattType = pattType.Simple_Crosshatch; 194 | else 195 | _pattType = pattType.Simple_Parallel_Lines; 196 | } 197 | 198 | MaterialUses = 0; 199 | ComponentUses = 0; 200 | RegionUses = 0; 201 | _familyUses = 0; 202 | } 203 | 204 | /// 205 | /// DOES NOT SCAN FAMILIES 206 | /// 207 | /// 208 | /// 209 | /// 210 | /// 211 | public FillPatternDefinition(FillPatternElement fpe, ref IList ComponentLib, ref IList MaterialLib, ref IList RegionLib) 212 | : base() 213 | { 214 | StyleName = fpe.Name; 215 | System.Diagnostics.Debug.WriteLine("FPD ctor : " + StyleName); 216 | ItsId = fpe.Id.IntegerValue; 217 | thePattern = fpe.GetFillPattern(); 218 | if (thePattern != null) 219 | { 220 | TheTarget = thePattern.Target; 221 | if (thePattern.GridCount > 2) 222 | _pattType = pattType.Complex; 223 | else if (thePattern.GridCount == 2) 224 | _pattType = pattType.Simple_Crosshatch; 225 | else 226 | _pattType = pattType.Simple_Parallel_Lines; 227 | } 228 | OwnerAssets = new List(); 229 | projectUnits = fpe.Document.GetUnits(); 230 | 231 | _familyUses = 0; 232 | 233 | MaterialUses = 0; 234 | foreach (Material m in MaterialLib) 235 | { 236 | if (m.CutForegroundPatternId == fpe.Id || 237 | m.CutBackgroundPatternId == fpe.Id || 238 | m.SurfaceForegroundPatternId == fpe.Id || 239 | m.SurfaceBackgroundPatternId == fpe.Id) 240 | { 241 | MaterialUses++; 242 | OwnerAssets.Add(new AssetDefinition(m)); 243 | } 244 | } 245 | ComponentUses = 0; 246 | foreach (Element el in ComponentLib) 247 | { 248 | if (el.get_Parameter(BuiltInParameter.COARSE_SCALE_FILL_PATTERN_ID_PARAM).AsElementId() == fpe.Id) 249 | { 250 | ComponentUses++; 251 | OwnerAssets.Add(new AssetDefinition(el)); 252 | } 253 | } 254 | RegionUses = 0; 255 | foreach (FilledRegionType frt in RegionLib) 256 | { 257 | Parameter p = frt.get_Parameter(BuiltInParameter.FOREGROUND_ANY_PATTERN_ID_PARAM); 258 | if (p == null) 259 | { 260 | p = frt.get_Parameter(BuiltInParameter.FILL_PATTERN_ID_PARAM_NO_NO); 261 | } 262 | if (p != null && p.AsElementId() == fpe.Id) 263 | { 264 | RegionUses++; 265 | OwnerAssets.Add(new AssetDefinition(frt)); 266 | } 267 | else 268 | { 269 | p = frt.get_Parameter(BuiltInParameter.BACKGROUND_DRAFT_PATTERN_ID_PARAM); 270 | if (p != null && p.AsElementId() == fpe.Id) 271 | { 272 | RegionUses++; 273 | OwnerAssets.Add(new AssetDefinition(frt)); 274 | } 275 | } 276 | } 277 | } 278 | 279 | /// 280 | /// Compares ID and style name only 281 | /// 282 | /// 283 | /// 284 | public override bool Equals(object obj) 285 | { 286 | if (obj == null || GetType() != obj.GetType()) 287 | { 288 | return false; 289 | } 290 | 291 | FillPatternDefinition rhs = obj as FillPatternDefinition; 292 | if (this.StyleName != rhs.StyleName || 293 | this.ItsId != rhs.ItsId) 294 | return false; 295 | 296 | return true; 297 | } 298 | 299 | // override object.GetHashCode 300 | public override int GetHashCode() 301 | { 302 | return ItsId; 303 | } 304 | } 305 | } 306 | -------------------------------------------------------------------------------- /Project Sweeper/FillPatternCleaner/ProgressBarWindow.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | 12 |