整理控件库

This commit is contained in:
GG Z
2025-05-05 17:04:06 +08:00
parent 74532b77be
commit 3eaad7566e
283 changed files with 2156 additions and 17846 deletions

View File

@@ -1,4 +1,4 @@
<AduSkin:AduWindow
<Window
x:Class="ShrlAlgo.Addin.Test.ActionWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -43,36 +43,33 @@
<DataGridTextColumn Binding="{Binding City}" Header="城市" />
</AduSkin:AduDataGrid.Columns>
</AduSkin:AduDataGrid>-->
<AduSkin:MetroTextBox
<TextBox
Margin="5"
VerticalAlignment="Center"
InputHint="前缀"
Text="{Binding Prex, UpdateSourceTrigger=PropertyChanged}" />
<AduSkin:MetroTextBox
<TextBox
Margin="5"
VerticalAlignment="Center"
InputHint="中间0的数量"
Text="{Binding Count, UpdateSourceTrigger=PropertyChanged}" />
<AduSkin:MetroTextBox
<TextBox
Margin="5"
VerticalAlignment="Center"
InputHint="当前序号"
Text="{Binding Code, UpdateSourceTrigger=PropertyChanged}" />
<AduSkin:MetroButton
<Button
Margin="5"
VerticalAlignment="Center"
Click="Button_Click"
Content="添加" />
<AduSkin:MetroButton
<Button
Margin="5"
VerticalAlignment="Center"
Command="{Binding BrowserExcelFileCommand}"
Content="一键赋予" />
<AduSkin:MetroButton
<Button
Margin="5"
VerticalAlignment="Center"
Command="{Binding ExportExcelFileCommand}"
Content="导出" />
</UniformGrid>
</Grid>
</AduSkin:AduWindow>
</Window>

View File

@@ -7,7 +7,6 @@ using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Bogus;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@@ -29,7 +28,7 @@ namespace ShrlAlgo.Addin.Test;
[ObservableObject]
public partial class ActionWindow
{
public List<Customer> Customers => GetCustomers().ToList();
// public List<Customer> Customers => GetCustomers().ToList();
public ActionWindow()
{
@@ -37,27 +36,27 @@ public partial class ActionWindow
DataContext = this;
}
public IEnumerable<Customer> GetCustomers()
{
Randomizer.Seed = new Random(123456);
var ordergenerator = new Faker<Order>()
.RuleFor(o => o.Id, Guid.NewGuid)
.RuleFor(o => o.Date, f => f.Date.Past(3))
.RuleFor(o => o.OrderValue, f => f.Finance.Amount(0, 10000))
.RuleFor(o => o.Shipped, f => f.Random.Bool(0.9f));
var customerGenerator = new Faker<Customer>()
.RuleFor(c => c.Id, Guid.NewGuid())
.RuleFor(c => c.Name, f => f.Company.CompanyName())
.RuleFor(c => c.Address, f => f.Address.FullAddress())
.RuleFor(c => c.City, f => f.Address.City())
.RuleFor(c => c.Country, f => f.Address.Country())
.RuleFor(c => c.ZipCode, f => f.Address.ZipCode())
.RuleFor(c => c.Phone, f => f.Phone.PhoneNumber())
.RuleFor(c => c.Email, f => f.Internet.Email())
.RuleFor(c => c.ContactName, (f, c) => f.Name.FullName())
.RuleFor(c => c.Orders, f => ordergenerator.Generate(f.Random.Number(10)).ToList());
return customerGenerator.Generate(100);
}
// public IEnumerable<Customer> GetCustomers()
// {
// Randomizer.Seed = new Random(123456);
// var ordergenerator = new Faker<Order>()
// .RuleFor(o => o.Id, Guid.NewGuid)
// .RuleFor(o => o.Date, f => f.Date.Past(3))
// .RuleFor(o => o.OrderValue, f => f.Finance.Amount(0, 10000))
// .RuleFor(o => o.Shipped, f => f.Random.Bool(0.9f));
// var customerGenerator = new Faker<Customer>()
// .RuleFor(c => c.Id, Guid.NewGuid())
// .RuleFor(c => c.Name, f => f.Company.CompanyName())
// .RuleFor(c => c.Address, f => f.Address.FullAddress())
// .RuleFor(c => c.City, f => f.Address.City())
// .RuleFor(c => c.Country, f => f.Address.Country())
// .RuleFor(c => c.ZipCode, f => f.Address.ZipCode())
// .RuleFor(c => c.Phone, f => f.Phone.PhoneNumber())
// .RuleFor(c => c.Email, f => f.Internet.Email())
// .RuleFor(c => c.ContactName, (f, c) => f.Name.FullName())
// .RuleFor(c => c.Orders, f => ordergenerator.Generate(f.Random.Number(10)).ToList());
// return customerGenerator.Generate(100);
// }
[ObservableProperty]
private string code;

View File

@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Text;
using System.Windows;
@@ -113,7 +114,27 @@ internal class FluentAddin : ExternalCommand
}
public override void Execute()
{
var fm = Document.FamilyManager;
var current = fm.CurrentType;
var count = fm.Types.Size;
Document.Invoke(
ts =>
{
foreach (FamilyType item in fm.Types)
{
var b = string.IsNullOrWhiteSpace(item.Name);
//MessageBox.Show(item.Name);
if (b)
{
fm.CurrentType = item;
fm.DeleteCurrentType();
}
}
//fm.NewType("NewType");
});
return;
var ids = Document.ActiveView.OfCollector().WhereElementIsNotElementType().Where(e => e.GetLevelId() == ElementId.InvalidElementId).Select(e => e.Id).ToList();
UiDocument.Selection.SetElementIds(ids);
return;

View File

@@ -13,24 +13,24 @@ public partial class FluentWindow
public FluentWindow()
{
InitializeComponent();
//ApplicationThemeManager.Apply(this);
//ApplicationThemeManager.Changed -= ApplicationThemeManager_Changed;
//ApplicationThemeManager.Changed += ApplicationThemeManager_Changed;
//ThemeManager.ChangeAppTheme(this);
//ThemeManager.Changed -= ApplicationThemeManager_Changed;
//ThemeManager.Changed += ApplicationThemeManager_Changed;
}
private void ApplicationThemeManager_Changed(ApplicationTheme currentApplicationTheme, Color systemAccent)
private void ApplicationThemeManager_Changed(ThemeType currentApplicationTheme, Color systemAccent)
{
//ApplicationThemeManager.Apply(this);
//ThemeManager.ChangeAppTheme(this);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
//if (ApplicationThemeManager.GetAppTheme() == ApplicationTheme.Light)
//if (ThemeManager.GetAppTheme() == ThemeType.Light)
//{
// ApplicationThemeManager.Apply(ApplicationTheme.Dark);
// ThemeManager.ChangeAppTheme(ThemeType.Dark);
//}
//else
//{
// ApplicationThemeManager.Apply(ApplicationTheme.Light);
// ThemeManager.ChangeAppTheme(ThemeType.Light);
//}
}
}

View File

@@ -55,7 +55,8 @@ public class MonitorPickObject : IExternalCommand
SendMessage(finish, WM_CLICK, IntPtr.Zero, 0);
}
}
internal static bool FindChildClassHwnd(IntPtr hwndParent, IntPtr lParam)
private static bool FindChildClassHwnd(IntPtr hwndParent, IntPtr lParam)
{
var childProc = new EnumWindowProc(FindChildClassHwnd);
var hwnd = FindWindowEx(hwndParent, IntPtr.Zero, "Button", "完成");

View File

@@ -25,7 +25,6 @@
<ItemGroup>
<Reference Include="eTransmitForRevitDB" HintPath="..\libs\2018\eTransmitForRevitDB.dll" />
<PackageReference Include="ACadSharp" Version="1.0.2" />
<PackageReference Include="Bogus" Version="35.6.1" />
<PackageReference Include="EleCho.WpfSuite" Version="0.9.1.2" />
<PackageReference Include="LiteDB" Version="5.0.21" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
@@ -38,7 +37,6 @@
<PackageReference Include="CommunityToolkit.Diagnostics" Version="8.3.2" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
<PackageReference Include="EPPlus.Core.Extensions" Version="2.4.0" />
<PackageReference Include="JerryShaw.AduSkin" Version="1.1.1.11" />
<PackageReference Include="Nice3point.Revit.Toolkit" Version="2019.*" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>