Skip to content

Commit c3f376b

Browse files
committed
add module
1 parent 95fd8f8 commit c3f376b

File tree

227 files changed

+47263
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+47263
-0
lines changed

CadLookup/.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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

CadLookup/.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#Ignore thumbnails created by Windows
2+
Thumbs.db
3+
4+
#Ignore files built by Visual Studio
5+
*.obj
6+
*.exe
7+
*.pdb
8+
*.user
9+
*.aps
10+
*.pch
11+
*.vspscc
12+
*_i.c
13+
*_p.c
14+
*.ncb
15+
*.suo
16+
*.tlb
17+
*.tlh
18+
*.bak
19+
*.cache
20+
*.ilk
21+
*.log
22+
*.iref
23+
*.db
24+
*.ide
25+
*.opendb
26+
*.lock
27+
*.ide-shm
28+
*.ide-wal
29+
[Bb]in
30+
[Dd]ebug*/
31+
*.lib
32+
*.sbr
33+
obj/
34+
[Rr]elease*/
35+
_ReSharper*/
36+
[Tt]est[Rr]esult*
37+
.vs/
38+
39+
#Nuget packages folder
40+
packages/
41+
42+

CadLookup/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
5+
</startup>
6+
</configuration>

CadLookup/CADSnoop.csproj

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net48</TargetFramework>
4+
<OutputType>Library</OutputType>
5+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6+
<UseWindowsForms>true</UseWindowsForms>
7+
<UseWPF>true</UseWPF>
8+
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
9+
</PropertyGroup>
10+
<PropertyGroup>
11+
<StartupObject />
12+
</PropertyGroup>
13+
<PropertyGroup>
14+
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
15+
None
16+
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
17+
</PropertyGroup>
18+
<ItemGroup>
19+
<Reference Include="accoremgd">
20+
<HintPath>..\RefrencedAssemblies\accoremgd.dll</HintPath>
21+
</Reference>
22+
<Reference Include="Acdbmgd">
23+
<HintPath>..\RefrencedAssemblies\acdbmgd.dll</HintPath>
24+
</Reference>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<PackageReference Include="Chuongmep.Acad.Api.accoremgd" Version="2023.0.2" />
28+
<PackageReference Include="Chuongmep.Acad.Api.acdbmgd" Version="2023.0.2" />
29+
</ItemGroup>
30+
<ProjectExtensions>
31+
<VisualStudio>
32+
<UserProperties Reactor_Deploy="0" Reactor_Output="" Reactor_Configuration="Debug" Reactor_Project="C:\Users\chuon\3D Objects\ProtectSetting.nrproj" Reactor_Commands="" Reactor_Enabled="0" />
33+
</VisualStudio>
34+
</ProjectExtensions>
35+
</Project>

CadLookup/Documents/SnoopCad.gif

3.55 MB
Loading
112 KB
Loading

CadLookup/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Long
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.

CadLookup/Model/ObjectDetails.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
3+
namespace CADSnoop.Model
4+
{
5+
/// <summary>
6+
/// Information Of Object
7+
/// </summary>
8+
public class ObjectDetails
9+
{
10+
public string GroupName { get; set; }
11+
public string PropName { get; set; }
12+
public string Type { get; set; }
13+
public string Value { get; set; }
14+
public Object LinkObject { get; set; }
15+
}
16+
}

CadLookup/Model/RelayCommand.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System;
2+
using System.Windows.Input;
3+
4+
namespace CADSnoop.Model
5+
{
6+
public class RelayCommand : ICommand
7+
{
8+
readonly Action _execute;
9+
readonly Func<bool> _canExecute;
10+
11+
public RelayCommand(Action execute, Func<bool> canExecute)
12+
{
13+
if (execute == null)
14+
throw new NullReferenceException("execute");
15+
16+
_execute = execute;
17+
_canExecute = canExecute;
18+
}
19+
20+
public RelayCommand(Action execute) : this(execute, null)
21+
{
22+
23+
}
24+
25+
public event EventHandler CanExecuteChanged
26+
{
27+
add => CommandManager.RequerySuggested += value;
28+
remove => CommandManager.RequerySuggested -= value;
29+
}
30+
31+
public bool CanExecute(object parameter)
32+
{
33+
return _canExecute == null ? true : _canExecute();
34+
}
35+
36+
public void Execute(object parameter)
37+
{
38+
_execute.Invoke();
39+
}
40+
}
41+
}

CadLookup/Model/ViewModelBase.cs

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
using System.ComponentModel;
2+
using System.Diagnostics;
3+
using System.Globalization;
4+
using System.Reflection;
5+
using System.Runtime.CompilerServices;
6+
7+
namespace CADSnoop.Model
8+
{
9+
public class ViewModelBase : INotifyPropertyChanged
10+
{
11+
public event PropertyChangedEventHandler PropertyChanged;
12+
13+
public virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
14+
{
15+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
16+
}
17+
18+
// <summary>
19+
/// Called when the specified property has been changed.
20+
/// </summary>
21+
/// <param name="propertyName">Name of the property.</param>
22+
/// <param name="oldValue">The old value.</param>
23+
/// <param name="newValue">The new value.</param>
24+
protected virtual void OnPropertyChanged(string propertyName, object oldValue, object newValue)
25+
{
26+
this.OnPropertyChanged(propertyName);
27+
}
28+
29+
#region Can Optimize
30+
/// <summary>
31+
///
32+
/// </summary>
33+
/// <typeparam name="T"></typeparam>
34+
/// <param name="property"></param>
35+
/// <param name="value"></param>
36+
/// <param name="propertyName"></param>
37+
public void OnPropertyChanged<T>(ref T property, T value, [CallerMemberName] string propertyName = "")
38+
{
39+
property = value;
40+
var handler = PropertyChanged;
41+
if (handler != null)
42+
{
43+
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
44+
}
45+
}
46+
47+
#endregion
48+
49+
/// <summary>
50+
/// Sets the property value.
51+
/// </summary>
52+
/// <typeparam name="T">The type of the property.</typeparam>
53+
/// <param name="field">The field.</param>
54+
/// <param name="value">The value.</param>
55+
/// <param name="propertyName">Name of the property.</param>
56+
/// <returns>
57+
/// True if the property was set.
58+
/// </returns>
59+
/// <remarks>This method uses the CallerMemberNameAttribute to determine the property name.</remarks>
60+
protected bool SetValue<T>(ref T field, T value, [System.Runtime.CompilerServices.CallerMemberName] string propertyName = "")
61+
{
62+
// ReSharper disable once RedundantNameQualifier
63+
if (object.Equals(field, value))
64+
{
65+
return false;
66+
}
67+
this.VerifyProperty(propertyName);
68+
//// this.OnPropertyChanging(propertyName, field, value);
69+
T oldValue = field;
70+
field = value;
71+
this.OnPropertyChanged(propertyName, oldValue, value);
72+
return true;
73+
}
74+
75+
/// <summary>
76+
/// Verifies the property name.
77+
/// </summary>
78+
/// <param name="propertyName">Name of the property.</param>
79+
[Conditional("DEBUG")]
80+
private void VerifyProperty(string propertyName)
81+
{
82+
var type = this.GetType();
83+
84+
// Look for a public property with the specified name.
85+
var propertyInfo = type.GetTypeInfo().GetDeclaredProperty(propertyName);
86+
87+
Debug.Assert(propertyInfo != null, string.Format(CultureInfo.InvariantCulture, "{0} is not a property of {1}", propertyName, type.FullName));
88+
}
89+
}
90+
}

0 commit comments

Comments
 (0)