Commit eda79ee9 by liulongfei

移除命令模板相关页面,修复默认连接bug

parent 464d78be
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Package.Domain;
using VIZ.Package.Plugin;
namespace VIZ.Package.Module
{
/// <summary>
/// 命令插件生命周期
/// </summary>
public class CommandPluginLifeCycle : IPluginLifeCycle
{
/// <summary>
/// 插件分组
/// </summary>
public const string PLUGIN_GROUP = ApplicationConstants.APPLICATION_GROUP_NAME;
/// <summary>
/// 插件ID
/// </summary>
/// <remarks>
/// 插件ID不能包含点号
/// </remarks>
public const string PLUGIN_ID = ModulePluginIds.COMMAND;
/// <summary>
/// 插件名称
/// </summary>
public const string PLUGIN_NAME = "命令";
/// <summary>
/// 注册
/// </summary>
/// <returns>插件信息</returns>
public PluginInfo Register()
{
PluginInfo info = new PluginInfo();
info.Group = PLUGIN_GROUP;
info.ID = PLUGIN_ID;
info.Name = PLUGIN_NAME;
info.ViewType = typeof(CommandView);
return info;
}
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
{
}
}
}
<UserControl x:Class="VIZ.Package.Module.CommandView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.Package.Module"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<TextBlock Text="命令" VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="36" Foreground="Red"></TextBlock>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// CommandView.xaml 的交互逻辑
/// </summary>
public partial class CommandView : UserControl
{
public CommandView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new CommandViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// 命令视图模型
/// </summary>
public class CommandViewModel : ViewModelBase
{
}
}
......@@ -444,6 +444,9 @@ namespace VIZ.Package.Module
page.PluginName = vm.SelectedTemplatePlugin?.Name;
page.PageNum = this.SelectedPageGroupModel.Pages.Count == 0 ? 1 : (this.SelectedPageGroupModel.Pages.Max(p => p.PageNum) + 1);
ConnGroupModel conn = ApplicationDomainEx.ConnGroups?.FirstOrDefault(p => p.IsDefault);
page.ConnGroupID = conn != null ? conn.GroupID : Guid.Empty;
this.SelectedPageGroupModel.Pages.Add(page);
if (page.ThumbnailBitmap == null)
......
......@@ -146,34 +146,6 @@ namespace VIZ.Package.Module
#endregion
#region OtherTemplateModels -- 其他模板模型集合
private ObservableCollection<PageTemplateModel> otherTemplateModels;
/// <summary>
/// 其他模板模型集合
/// </summary>
public ObservableCollection<PageTemplateModel> OtherTemplateModels
{
get { return otherTemplateModels; }
set { otherTemplateModels = value; this.RaisePropertyChanged(nameof(OtherTemplateModels)); }
}
#endregion
#region SelectedOtherTemplateModel -- 当前选中的其他模板模型
private PageTemplateModel selectedOtherTemplateModel;
/// <summary>
/// 当前选中的其他模板模型
/// </summary>
public PageTemplateModel SelectedOtherTemplateModel
{
get { return selectedOtherTemplateModel; }
set { selectedOtherTemplateModel = value; this.RaisePropertyChanged(nameof(SelectedOtherTemplateModel)); }
}
#endregion
// ======================================================================================
// Command
// ======================================================================================
......@@ -317,7 +289,6 @@ namespace VIZ.Package.Module
this.IsEnabled = true;
this.SceneTemplateModels = null;
this.SelectedSceneTemplateModel = null;
this.SelectedOtherTemplateModel = null;
this.IsLoading = true;
ThreadHelper.SafeRun(() =>
......@@ -340,7 +311,6 @@ namespace VIZ.Package.Module
WPFHelper.BeginInvoke(() =>
{
this.SceneTemplateModels = sceneTemplateModels;
this.OtherTemplateModels = otherTemplateModels;
this.IsLoading = false;
});
......@@ -368,7 +338,6 @@ namespace VIZ.Package.Module
this.IsLoading = false;
this.SceneTemplateModels = null;
this.SelectedSceneTemplateModel = null;
this.SelectedOtherTemplateModel = null;
}
/// <summary>
......
......@@ -62,8 +62,15 @@
HorizontalContentAlignment="Left"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="默认分组" Width="80" Binding="{Binding IsDefault,Converter={StaticResource Bool2StringConverter}}"
AllowSorting="False" AllowColumnFiltering="False" ReadOnly="True"></dxg:GridColumn>
<dxg:GridColumn Header="默认分组" Width="80" AllowEditing="False"
AllowSorting="False" AllowColumnFiltering="False" ReadOnly="True">
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="4,0,4,0" VerticalAlignment="Center"
Text="{Binding Row.IsDefault,Converter={StaticResource Bool2StringConverter}}"></TextBlock>
</DataTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
<dxg:GridColumn Header="是否启用" FieldName="IsEnabled" Width="80" AllowSorting="False" AllowColumnFiltering="False">
<dxg:GridColumn.EditSettings>
<dxe:CheckEditSettings></dxe:CheckEditSettings>
......
......@@ -151,11 +151,6 @@
</Compile>
<Compile Include="Setting\Conn\ConnPluginLifeCycle.cs" />
<Compile Include="Setting\Conn\ViewModel\ConnSettingViewModel.cs" />
<Compile Include="ControlObject\Command\CommandPluginLifeCycle.cs" />
<Compile Include="ControlObject\Command\ViewModel\CommandViewModel.cs" />
<Compile Include="ControlObject\Command\View\CommandView.xaml.cs">
<DependentUpon>CommandView.xaml</DependentUpon>
</Compile>
<Compile Include="ControlObject\FieldEdit\Core\FieldEditMode.cs" />
<Compile Include="ControlObject\FieldEdit\Edit\BooleanEdit\BooleanEditPanel.xaml.cs">
<DependentUpon>BooleanEditPanel.xaml</DependentUpon>
......@@ -432,10 +427,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ControlObject\Command\View\CommandView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ControlObject\FieldEdit\Edit\BooleanEdit\BooleanEditPanel.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......
......@@ -29,6 +29,7 @@ namespace VIZ.Package.Service
ConnGroupModel model = new ConnGroupModel();
model.GroupID = entity.GroupID;
model.IsEnabled = entity.IsEnabled;
model.IsDefault = entity.IsDefault;
model.Name = entity.Name;
model.EngineType = entity.EngineType;
......@@ -70,6 +71,7 @@ namespace VIZ.Package.Service
ConnGroupEntity groupEntity = new ConnGroupEntity();
groupEntity.GroupID = group.GroupID;
groupEntity.IsEnabled = group.IsEnabled;
groupEntity.IsDefault = group.IsDefault;
groupEntity.Name = group.Name;
groupEntity.EngineType = group.EngineType;
......
......@@ -37,5 +37,10 @@ namespace VIZ.Package.Storage
/// 是否启用
/// </summary>
public bool IsEnabled { get; set; }
/// <summary>
/// 是否是默认分组
/// </summary>
public bool IsDefault { get; set; }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment