Commit 64adaac7 by liulongfei

节目单开发

parent 72e51754
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 应用程序常量
/// </summary>
public static class ApplicationConstants
{
/// <summary>
/// 项目文件后缀
/// </summary>
public const string PROJECT_FILE_SUFFIX = ".viz_tvp";
}
}
...@@ -34,8 +34,6 @@ namespace VIZ.TVP.Domain ...@@ -34,8 +34,6 @@ namespace VIZ.TVP.Domain
/// </summary> /// </summary>
public static TVPConnectionManager TVPConnectionManager { get; private set; } = new TVPConnectionManager(); public static TVPConnectionManager TVPConnectionManager { get; private set; } = new TVPConnectionManager();
/// <summary> /// <summary>
/// 当前项目领域 /// 当前项目领域
/// </summary> /// </summary>
......
...@@ -37,13 +37,18 @@ namespace VIZ.TVP.Domain ...@@ -37,13 +37,18 @@ namespace VIZ.TVP.Domain
public const string MEDIA_RESOURCE = "MEDIA_RESOURCE"; public const string MEDIA_RESOURCE = "MEDIA_RESOURCE";
/// <summary> /// <summary>
/// 节目模板 /// 节目
/// </summary> /// </summary>
public const string PROGRAM_TEMPLATE = "PROGRAM_TEMPLATE"; public const string PROGRAM_LIST = "PROGRAM_LIST";
/// <summary> /// <summary>
/// 节目单 /// Control List
/// </summary> /// </summary>
public const string PROGRAM_LIST = "PROGRAM_LIST"; public const string CONTROL_LIST = "CONTROL_LIST";
/// <summary>
/// 插件面板
/// </summary>
public const string PLUGIN_PANEL = "PLUGIN_PANEL";
} }
} }
...@@ -30,5 +30,10 @@ namespace VIZ.TVP.Domain ...@@ -30,5 +30,10 @@ namespace VIZ.TVP.Domain
/// 本地资源服务 /// 本地资源服务
/// </summary> /// </summary>
public const string LOCAL_RESOURCE_SERVICE = "LOCAL_RESOURCE_SERVICE"; public const string LOCAL_RESOURCE_SERVICE = "LOCAL_RESOURCE_SERVICE";
/// <summary>
/// 节目单视图服务
/// </summary>
public const string PROGRAM_LIST_VIEW_SERVICE = "PROGRAM_LIST_VIEW_SERVICE";
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 项目改变消息
/// </summary>
public class ProjectChangedMessage
{
/// <summary>
/// 老项目
/// </summary>
public ProjectDomain OldProjectDomain { get; set; }
/// <summary>
/// 新项目
/// </summary>
public ProjectDomain NewProjectDomain { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 项目保存消息
/// </summary>
public class ProjectSaveMessage
{
/// <summary>
/// 项目领域
/// </summary>
public ProjectDomain ProjectDomain { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Storage;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 节目单项模型
/// </summary>
public class ProgramListItemModel : ModelBase
{
/// <summary>
/// 节目单项模型
/// </summary>
/// <param name="entity">节目单项实体</param>
public ProgramListItemModel(ProgramListItemEntity entity)
{
this.Entity = entity;
}
/// <summary>
/// 实体
/// </summary>
public ProgramListItemEntity Entity { get; private set; }
#region TemplateID -- 模板ID
private string templateID;
/// <summary>
/// 模板ID
/// </summary>
public string TemplateID
{
get { return templateID; }
set { templateID = value; this.RaisePropertyChanged(nameof(TemplateID)); }
}
#endregion
#region ProgramListModel -- 节目单模型
private ProgramListModel programListModel;
/// <summary>
/// 节目单模型
/// </summary>
public ProgramListModel ProgramListModel
{
get { return programListModel; }
set { programListModel = value; this.RaisePropertyChanged(nameof(ProgramListModel)); }
}
#endregion
#region TemplateType -- 模板类型
private ProgramTemplateType templateType;
/// <summary>
/// 模板类型
/// </summary>
public ProgramTemplateType TemplateType
{
get { return templateType; }
set { templateType = value; this.RaisePropertyChanged(nameof(TemplateType)); }
}
#endregion
#region SceneName -- 场景名
private string sceneName;
/// <summary>
/// 场景名
/// </summary>
public string SceneName
{
get { return sceneName; }
set { sceneName = value; this.RaisePropertyChanged(nameof(SceneName)); }
}
#endregion
#region Remark -- 备注
private string remark;
/// <summary>
/// 备注
/// </summary>
public string Remark
{
get { return remark; }
set { remark = value; this.RaisePropertyChanged(nameof(Remark)); }
}
#endregion
#region Layer --
private string layer;
/// <summary>
/// 层
/// </summary>
public string Layer
{
get { return layer; }
set { layer = value; this.RaisePropertyChanged(nameof(Layer)); }
}
#endregion
#region EngineType -- 引擎类型
private TVPEngineType engineType;
/// <summary>
/// 引擎类型
/// </summary>
public TVPEngineType EngineType
{
get { return engineType; }
set { engineType = value; this.RaisePropertyChanged(nameof(EngineType)); }
}
#endregion
#region PluginID -- 插件ID
private string pluginID;
/// <summary>
/// 插件ID
/// </summary>
public string PluginID
{
get { return pluginID; }
set { pluginID = value; this.RaisePropertyChanged(nameof(PluginID)); }
}
#endregion
#region PluginName -- 插件名
private string pluginName;
/// <summary>
/// 插件名
/// </summary>
public string PluginName
{
get { return pluginName; }
set { pluginName = value; this.RaisePropertyChanged(nameof(PluginName)); }
}
#endregion
#region Thumbnail -- 缩略图
private string thumbnail;
/// <summary>
/// 缩略图
/// </summary>
public string Thumbnail
{
get { return thumbnail; }
set { thumbnail = value; this.RaisePropertyChanged(nameof(Thumbnail)); }
}
#endregion
// ---------------------------------------------------------------------
// 扩展属性
#region ThumbnailBitmap -- 缩略图图片
private Bitmap thumbnailBitmap;
/// <summary>
/// 缩略图图片
/// </summary>
public Bitmap ThumbnailBitmap
{
get { return thumbnailBitmap; }
set { thumbnailBitmap = value; this.RaisePropertyChanged(nameof(ThumbnailBitmap)); }
}
#endregion
/// <summary>
/// 从模板中获取数据
/// </summary>
/// <param name="template">模板</param>
public void FromProgramTemplateModel(ProgramTemplateModel template)
{
this.TemplateID = template.TemplateID;
this.TemplateType = template.TemplateType;
this.SceneName = template.SceneName;
this.Remark = template.Remark;
this.Layer = template.Layer;
this.EngineType = template.EngineType;
this.Thumbnail = template.Thumbnail;
this.ThumbnailBitmap = template.ThumbnailBitmap;
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Storage;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 节目单模型
/// </summary>
public class ProgramListModel : ModelBase
{
/// <summary>
/// 节目单模型
/// </summary>
/// <param name="entity">节目单实体</param>
public ProgramListModel(ProgramListEntity entity)
{
this.Entity = entity;
}
/// <summary>
/// 实体
/// </summary>
public ProgramListEntity Entity { get; private set; }
#region ListID -- 节目单ID
private string listID;
/// <summary>
/// 节目单ID
/// </summary>
public string ListID
{
get { return listID; }
set { listID = value; this.RaisePropertyChanged(nameof(ListID)); }
}
#endregion
#region Name -- 名称
private string name;
/// <summary>
/// 名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region Items -- 子项集合
private ObservableCollection<ProgramListItemModel> items = new ObservableCollection<ProgramListItemModel>();
/// <summary>
/// 子项集合
/// </summary>
public ObservableCollection<ProgramListItemModel> Items
{
get { return items; }
set { items = value; this.RaisePropertyChanged(nameof(Items)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Storage;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 节目模板模型
/// </summary>
public class ProgramTemplateModel : ModelBase
{
/// <summary>
/// 节目模板模型
/// </summary>
/// <param name="entity">界面模板实体</param>
public ProgramTemplateModel(ProgramTemplateEntity entity)
{
this.Entity = entity;
}
/// <summary>
/// 实体
/// </summary>
public ProgramTemplateEntity Entity { get; private set; }
#region TemplateID -- 模板ID
private string templateID;
/// <summary>
/// 模板ID
/// </summary>
public string TemplateID
{
get { return templateID; }
set { templateID = value; this.RaisePropertyChanged(nameof(TemplateID)); }
}
#endregion
#region TemplateType -- 模板类型
private ProgramTemplateType templateType;
/// <summary>
/// 模板类型
/// </summary>
public ProgramTemplateType TemplateType
{
get { return templateType; }
set { templateType = value; this.RaisePropertyChanged(nameof(TemplateType)); }
}
#endregion
#region SceneName -- 场景名
private string sceneName;
/// <summary>
/// 场景名
/// </summary>
public string SceneName
{
get { return sceneName; }
set { sceneName = value; this.RaisePropertyChanged(nameof(SceneName)); }
}
#endregion
#region Thumbnail -- 缩略图
private string thumbnail;
/// <summary>
/// 缩略图
/// </summary>
public string Thumbnail
{
get { return thumbnail; }
set { thumbnail = value; this.RaisePropertyChanged(nameof(Thumbnail)); }
}
#endregion
#region Remark -- 备注
private string remark;
/// <summary>
/// 备注
/// </summary>
public string Remark
{
get { return remark; }
set { remark = value; this.RaisePropertyChanged(nameof(Remark)); }
}
#endregion
#region Layer --
private string layer;
/// <summary>
/// 层
/// </summary>
public string Layer
{
get { return layer; }
set { layer = value; this.RaisePropertyChanged(nameof(Layer)); }
}
#endregion
#region EngineType -- 引擎类型
private TVPEngineType engineType;
/// <summary>
/// 引擎类型
/// </summary>
public TVPEngineType EngineType
{
get { return engineType; }
set { engineType = value; this.RaisePropertyChanged(nameof(EngineType)); }
}
#endregion
// ---------------------------------------------------------------------
// 扩展属性
#region ThumbnailBitmap -- 缩略图图片
private Bitmap thumbnailBitmap;
/// <summary>
/// 缩略图图片
/// </summary>
public Bitmap ThumbnailBitmap
{
get { return thumbnailBitmap; }
set { thumbnailBitmap = value; this.RaisePropertyChanged(nameof(ThumbnailBitmap)); }
}
#endregion
}
}
...@@ -78,7 +78,7 @@ namespace VIZ.TVP.Domain ...@@ -78,7 +78,7 @@ namespace VIZ.TVP.Domain
#endregion #endregion
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// 扩展属性 // 方法
/// <summary> /// <summary>
/// 销毁 /// 销毁
......
...@@ -4,6 +4,7 @@ using System.Linq; ...@@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.TVP.Storage;
namespace VIZ.TVP.Domain namespace VIZ.TVP.Domain
{ {
...@@ -23,6 +24,11 @@ namespace VIZ.TVP.Domain ...@@ -23,6 +24,11 @@ namespace VIZ.TVP.Domain
public string ProjectFilePath { get; set; } public string ProjectFilePath { get; set; }
/// <summary> /// <summary>
/// 项目上下文
/// </summary>
public ProjectContext ProjectContext { get; set; }
/// <summary>
/// 销毁 /// 销毁
/// </summary> /// </summary>
public void Dispose() public void Dispose()
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ApplicationConstants.cs" />
<Compile Include="ApplicationDomainEx.cs" /> <Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Enum\PluginIDs.cs" /> <Compile Include="Enum\PluginIDs.cs" />
<Compile Include="Enum\ServiceKeys.cs" /> <Compile Include="Enum\ServiceKeys.cs" />
...@@ -77,6 +78,11 @@ ...@@ -77,6 +78,11 @@
<Compile Include="Manager\PluginManager.cs" /> <Compile Include="Manager\PluginManager.cs" />
<Compile Include="Manager\TVPConnectionManager.cs" /> <Compile Include="Manager\TVPConnectionManager.cs" />
<Compile Include="Manager\WindowManager.cs" /> <Compile Include="Manager\WindowManager.cs" />
<Compile Include="Message\Project\ProjectChangedMessage.cs" />
<Compile Include="Message\Project\ProjectSaveMessage.cs" />
<Compile Include="Model\Project\Program\ProgramListItemModel.cs" />
<Compile Include="Model\Project\Program\ProgramListModel.cs" />
<Compile Include="Model\Project\Program\ProgramTemplateModel.cs" />
<Compile Include="Model\TVPConnection\ITVPEndpointManager.cs" /> <Compile Include="Model\TVPConnection\ITVPEndpointManager.cs" />
<Compile Include="Model\TVPConnection\TVPConnectionGroupModel.cs" /> <Compile Include="Model\TVPConnection\TVPConnectionGroupModel.cs" />
<Compile Include="Model\TVPConnection\TVPConnectionModel.cs" /> <Compile Include="Model\TVPConnection\TVPConnectionModel.cs" />
......
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace VIZ.TVP.Module.Resource
{
/// <summary>
/// 行号转化器
/// </summary>
public class RowHandleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
DevExpress.Xpf.Data.RowHandle rowHandle = value as DevExpress.Xpf.Data.RowHandle;
if (rowHandle == null)
return null;
return rowHandle.Value + 1;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// 此代码由工具生成。 // 此代码由工具生成。
// 运行时版本: 4.0.30319.42000 // 运行时版本:4.0.30319.42000
// //
// 对此文件的更改可能导致不正确的行为,如果 // 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,则所做更改将丢失。 // 重新生成代码,这些更改将会丢失。
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace VIZ.TVP.Module.Resource.Properties { namespace VIZ.TVP.Module.Resource.Properties {
using System;
/// <summary> /// <summary>
/// 强类型资源类,用于查找本地化字符串等。 /// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary> /// </summary>
// 此类是由 StronglyTypedResourceBuilder // 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。 // (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { public class Resources {
private static global::System.Resources.ResourceManager resourceMan; private static global::System.Resources.ResourceManager resourceMan;
...@@ -32,12 +33,12 @@ namespace VIZ.TVP.Module.Resource.Properties { ...@@ -32,12 +33,12 @@ namespace VIZ.TVP.Module.Resource.Properties {
} }
/// <summary> /// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。 /// 返回此类使用的缓存 ResourceManager 实例。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager { public static global::System.Resources.ResourceManager ResourceManager {
get { get {
if ((resourceMan == null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.TVP.Module.Resource.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.TVP.Module.Resource.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
...@@ -50,7 +51,7 @@ namespace VIZ.TVP.Module.Resource.Properties { ...@@ -50,7 +51,7 @@ namespace VIZ.TVP.Module.Resource.Properties {
/// 使用此强类型资源类的所有资源查找执行重写。 /// 使用此强类型资源类的所有资源查找执行重写。
/// </summary> /// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture { public static global::System.Globalization.CultureInfo Culture {
get { get {
return resourceCulture; return resourceCulture;
} }
...@@ -58,5 +59,15 @@ namespace VIZ.TVP.Module.Resource.Properties { ...@@ -58,5 +59,15 @@ namespace VIZ.TVP.Module.Resource.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
public static System.Drawing.Bitmap cmd_template {
get {
object obj = ResourceManager.GetObject("cmd_template", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
...@@ -68,9 +69,10 @@ ...@@ -68,9 +69,10 @@
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
...@@ -85,9 +87,10 @@ ...@@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
...@@ -109,9 +112,13 @@ ...@@ -109,9 +112,13 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="cmd_template" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\cmd_template.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>
\ No newline at end of file
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
<Reference Include="DevExpress.Xpf.Grid.v22.1.Extensions, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Grid.v22.1.Extensions, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
...@@ -85,6 +86,7 @@ ...@@ -85,6 +86,7 @@
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Converter\RowHandleConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
...@@ -99,7 +101,7 @@ ...@@ -99,7 +101,7 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile> </Compile>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
...@@ -116,5 +118,8 @@ ...@@ -116,5 +118,8 @@
<ItemGroup> <ItemGroup>
<Folder Include="Style\" /> <Folder Include="Style\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\cmd_template.jpg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
<UserControl x:Class="VIZ.TVP.Module.TextInputView"
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:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:local="clr-namespace:VIZ.TVP.Module"
mc:Ignorable="d"
d:DesignHeight="150" d:DesignWidth="600">
<UserControl.Resources>
<fcore:StringNotNull2BoolConverter x:Key="StringNotNull2BoolConverter"></fcore:StringNotNull2BoolConverter>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Path=Label,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:TextInputView}}}"
VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<TextBox Grid.Column="1" Height="30" VerticalAlignment="Center" Margin="0,0,10,0"
TextWrapping="NoWrap" AcceptsReturn="False" Padding="3" VerticalContentAlignment="Center"
Text="{Binding Path=Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:TextInputView}},Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
<Button Content="确定" Width="80" Height="30" Margin="10" x:Name="btEnter" Click="btEnter_Click"
IsEnabled="{Binding Path=Text,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type local:TextInputView}},Converter={StaticResource StringNotNull2BoolConverter},Mode=OneWay}"></Button>
<Button Content="取消" Width="80" Height="30" Margin="10" x:Name="btCancel" Click="btCancel_Click"></Button>
</StackPanel>
</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;
namespace VIZ.TVP.Module
{
/// <summary>
/// TextInputView.xaml 的交互逻辑
/// </summary>
public partial class TextInputView : UserControl
{
public TextInputView()
{
InitializeComponent();
}
#region Label -- 标签
/// <summary>
/// 标签
/// </summary>
public string Label
{
get { return (string)GetValue(LabelProperty); }
set { SetValue(LabelProperty, value); }
}
/// <summary>
/// Using a DependencyProperty as the backing store for Label. This enables animation, styling, binding, etc...
/// </summary>
public static readonly DependencyProperty LabelProperty =
DependencyProperty.Register("Label", typeof(string), typeof(TextInputView), new PropertyMetadata(null));
#endregion
#region Text -- 输入文本
/// <summary>
/// 输入文本
/// </summary>
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
/// <summary>
/// Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc...
/// </summary>
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register("Text", typeof(string), typeof(TextInputView), new PropertyMetadata(null));
#endregion
/// <summary>
/// 是否确定
/// </summary>
public bool IsEnter { get; set; }
/// <summary>
/// 确定
/// </summary>
private void btEnter_Click(object sender, RoutedEventArgs e)
{
this.IsEnter = true;
Window window = Window.GetWindow(this);
window.DialogResult = true;
window.Close();
}
/// <summary>
/// 取消
/// </summary>
private void btCancel_Click(object sender, RoutedEventArgs e)
{
this.IsEnter = false;
Window window = Window.GetWindow(this);
window.DialogResult = false;
window.Close();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Plugin;
using VIZ.TVP.Domain;
using VIZ.TVP.Plugin;
namespace VIZ.TVP.Module
{
/// <summary>
/// Control List 插件生命周期
/// </summary>
public class ControlListPluginLifeCycle : IPluginLifeCycle
{
/// <summary>
/// 插件ID
/// </summary>
/// <remarks>
/// 插件ID不能包含点号
/// </remarks>
public const string PLUGIN_ID = PluginIDs.CONTROL_LIST;
/// <summary>
/// 插件显示名称
/// </summary>
public const string PLUGIN_DISPLAY_NAME = "Control List";
/// <summary>
/// 注册
/// </summary>
/// <returns>插件信息</returns>
public PluginInfo Register()
{
PluginInfo info = new PluginInfo();
info.ID = PLUGIN_ID;
info.DisplayName = PLUGIN_DISPLAY_NAME;
info.HasView = true;
info.HasSettingView = false;
info.ViewInfo = new PluginViewInfo(typeof(ControlListView), typeof(ControlListViewModel));
return info;
}
/// <summary>
/// 初始化
/// </summary>
public void Initialize()
{
}
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
{
}
}
}
<UserControl x:Class="VIZ.TVP.Module.ProgramListView" <UserControl x:Class="VIZ.TVP.Module.ControlListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>
<TextBlock Text="节目单" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="36" Foreground="Red"></TextBlock> <TextBlock Text="Control列表" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="36" Foreground="Red"></TextBlock>
</Grid> </Grid>
</UserControl> </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;
namespace VIZ.TVP.Module
{
/// <summary>
/// ControlListView.xaml 的交互逻辑
/// </summary>
public partial class ControlListView : UserControl
{
public ControlListView()
{
InitializeComponent();
}
}
}
...@@ -8,9 +8,9 @@ using VIZ.Framework.Plugin; ...@@ -8,9 +8,9 @@ using VIZ.Framework.Plugin;
namespace VIZ.TVP.Module namespace VIZ.TVP.Module
{ {
/// <summary> /// <summary>
/// 节目单视图模型 /// Control List视图模型
/// </summary> /// </summary>
public class ProgramListViewModel : PluginViewModelBase public class ControlListViewModel : PluginViewModelBase
{ {
/// <summary> /// <summary>
/// 销毁 /// 销毁
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace VIZ.TVP.Module
{
/// <summary>
/// 项目支持
/// </summary>
public interface IProjectSupport
{
/// <summary>
/// 获取窗口
/// </summary>
/// <returns>窗口</returns>
Window GetWindow();
/// <summary>
/// 更新命令状态
/// </summary>
void UpdateCommandStatus();
}
}
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using VIZ.TVP.Domain;
namespace VIZ.TVP.Module
{
/// <summary>
/// 项目控制器
/// </summary>
public class ProjectController
{
/// <summary>
/// 项目控制器
/// </summary>
/// <param name="support">支持</param>
public ProjectController(IProjectSupport support)
{
this.Support = support;
}
/// <summary>
/// 支持
/// </summary>
public IProjectSupport Support { get; private set; }
/// <summary>
/// 创建项目
/// </summary>
public void CreateProject()
{
if (ApplicationDomainEx.CurrentProjectDomain != null)
{
var result = DXMessageBox.Show("是否保存当前项目", "提示", System.Windows.MessageBoxButton.YesNo);
if (result == System.Windows.MessageBoxResult.Yes)
{
this.SaveProject();
}
}
CreateProjectWindow window = new CreateProjectWindow();
window.Owner = this.Support.GetWindow();
window.ShowDialog();
CreateProjectViewModel vm = window.createProjectView.DataContext as CreateProjectViewModel;
if (vm == null || !vm.IsEnter)
return;
if (!System.IO.Directory.Exists(vm.ProjectPath))
{
System.IO.Directory.CreateDirectory(vm.ProjectPath);
}
string path = System.IO.Path.Combine(vm.ProjectPath, $"{vm.ProjectName}{ApplicationConstants.PROJECT_FILE_SUFFIX}");
ProjectDomain domain = new ProjectDomain();
domain.ProjectContext = new Storage.ProjectContext(path);
ProjectChangedMessage msg = new ProjectChangedMessage();
msg.OldProjectDomain = ApplicationDomainEx.CurrentProjectDomain;
msg.NewProjectDomain = domain;
ApplicationDomainEx.CurrentProjectDomain = domain;
// 发送项目创建消息
ApplicationDomainEx.MessageManager.Send(msg);
// 更新命令状态
this.Support.UpdateCommandStatus();
}
/// <summary>
/// 打开项目
/// </summary>
public void OpenProject()
{
// 关闭当前项目
this.CloseProject();
System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
ofd.Filter = "播控项目文件|*.viz_tvp";
ofd.Multiselect = false;
ofd.InitialDirectory = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "projects");
if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
ProjectDomain domain = new ProjectDomain();
domain.ProjectContext = new Storage.ProjectContext(ofd.FileName);
ProjectChangedMessage msg = new ProjectChangedMessage();
msg.OldProjectDomain = ApplicationDomainEx.CurrentProjectDomain;
msg.NewProjectDomain = domain;
ApplicationDomainEx.CurrentProjectDomain = domain;
// 发送项目创建消息
ApplicationDomainEx.MessageManager.Send(msg);
// 更新命令状态
this.Support.UpdateCommandStatus();
}
/// <summary>
/// 保存项目
/// </summary>
public void SaveProject()
{
if (ApplicationDomainEx.CurrentProjectDomain == null)
return;
ProjectSaveMessage msg = new ProjectSaveMessage();
msg.ProjectDomain = ApplicationDomainEx.CurrentProjectDomain;
ApplicationDomainEx.MessageManager.Send(msg);
// 更新命令状态
this.Support.UpdateCommandStatus();
}
/// <summary>
/// 另存为
/// </summary>
public void SaveAsProject()
{
if (ApplicationDomainEx.CurrentProjectDomain == null)
return;
System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
sfd.Filter = "播控项目文件|*.viz_tvp";
ProjectDomain domain = new ProjectDomain();
domain.ProjectContext = new Storage.ProjectContext(sfd.FileName);
ApplicationDomainEx.CurrentProjectDomain = domain;
ProjectSaveMessage msg = new ProjectSaveMessage();
msg.ProjectDomain = ApplicationDomainEx.CurrentProjectDomain;
ApplicationDomainEx.MessageManager.Send(msg);
// 更新命令状态
this.Support.UpdateCommandStatus();
}
/// <summary>
/// 关闭项目
/// </summary>
public void CloseProject()
{
if (ApplicationDomainEx.CurrentProjectDomain == null)
return;
if (DXMessageBox.Show("是否保存项目", "提示", System.Windows.MessageBoxButton.YesNo) == System.Windows.MessageBoxResult.Yes)
{
this.SaveProject();
}
ProjectChangedMessage msg = new ProjectChangedMessage();
msg.OldProjectDomain = ApplicationDomainEx.CurrentProjectDomain;
msg.NewProjectDomain = null;
ApplicationDomainEx.MessageManager.Send(msg);
ApplicationDomainEx.CurrentProjectDomain = null;
// 更新命令状态
this.Support.UpdateCommandStatus();
}
}
}
<UserControl x:Class="VIZ.TVP.Module.CreateProjectView"
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:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
d:DataContext="{d:DesignInstance Type=local:CreateProjectViewModel}"
d:Background="White"
xmlns:local="clr-namespace:VIZ.TVP.Module"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="600">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Loaded" Command="{Binding Path=LoadedCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="项目名:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<TextBox Text="{Binding Path=ProjectName}" Grid.Column="1" VerticalAlignment="Center" VerticalContentAlignment="Center"
AcceptsReturn="False" TextWrapping="NoWrap" Height="30" Margin="10,0,10,0"></TextBox>
<TextBlock Text="项目保存路径:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" Grid.Row="1"></TextBlock>
<TextBox Text="{Binding Path=ProjectPath}" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" VerticalContentAlignment="Center"
AcceptsReturn="False" TextWrapping="NoWrap" Height="30" Margin="10,0,10,0"></TextBox>
<Button Grid.Column="2" Grid.Row="1" Width="60" Height="30" Content="..." Command="{Binding Path=SelectFolderCommand}"></Button>
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Content="确定" Width="80" Height="30" Margin="10" Command="{Binding EnterCommand}"></Button>
<Button Content="取消" Width="80" Height="30" Margin="10" Command="{Binding CancelCommand}"></Button>
</StackPanel>
</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.TVP.Module
{
/// <summary>
/// CreateProjectView.xaml 的交互逻辑
/// </summary>
public partial class CreateProjectView : UserControl
{
public CreateProjectView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new CreateProjectViewModel());
}
}
}
<dx:ThemedWindow x:Class="VIZ.TVP.Module.CreateProjectWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:module="clr-namespace:VIZ.TVP.Module"
Title="创建项目" Height="240" Width="640" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Grid>
<module:CreateProjectView x:Name="createProjectView"></module:CreateProjectView>
</Grid>
</dx:ThemedWindow>
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Shapes;
namespace VIZ.TVP.Module
{
/// <summary>
/// Interaction logic for CreateProjectWindow.xaml
/// </summary>
public partial class CreateProjectWindow : ThemedWindow
{
public CreateProjectWindow()
{
InitializeComponent();
}
}
}
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking" xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:fplugin="clr-namespace:VIZ.Framework.Plugin;assembly=VIZ.Framework.Plugin" xmlns:fplugin="clr-namespace:VIZ.Framework.Plugin;assembly=VIZ.Framework.Plugin"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common" xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}" d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
......
...@@ -26,6 +26,13 @@ namespace VIZ.TVP.Module ...@@ -26,6 +26,13 @@ namespace VIZ.TVP.Module
InitializeComponent(); InitializeComponent();
WPFHelper.BindingViewModel(this, new MainViewModel()); WPFHelper.BindingViewModel(this, new MainViewModel());
this.Loaded += MainView_Loaded;
}
private void MainView_Loaded(object sender, RoutedEventArgs e)
{
(this.DataContext as MainViewModel).LoadLayout();
} }
} }
} }
<UserControl x:Class="VIZ.TVP.Module.MainViewToolbar"
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:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
d:DataContext="{d:DesignInstance Type=local:MainViewToolbarViewModel}"
xmlns:local="clr-namespace:VIZ.TVP.Module"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<StackPanel Orientation="Horizontal">
<dxb:MainMenuControl Caption="MainMenu" VerticalAlignment="Center">
<dxb:BarSubItem Content="项目" Alignment="Far">
<dxb:BarButtonItem Content="新建" Command="{Binding Path=CreateProjectCommand}" />
<dxb:BarButtonItem Content="打开" Command="{Binding Path=OpenProjectCommand}" />
<dxb:BarButtonItem Content="保存" Command="{Binding Path=SaveProjectCommand}" />
<dxb:BarButtonItem Content="另存为" Command="{Binding Path=SaveAsProjectCommand}" />
<dxb:BarButtonItem Content="关闭" Command="{Binding Path=CloseProjectCommand}" />
</dxb:BarSubItem>
<dxb:BarSubItem Content="设置" Alignment="Far">
</dxb:BarSubItem>
<dxb:BarSubItem Content="帮助" Alignment="Far">
<dxb:BarButtonItem Content="关于" />
</dxb:BarSubItem>
</dxb:MainMenuControl>
<Border Background="Yellow" VerticalAlignment="Center" Padding="10,3,10,3">
<TextBlock Foreground="Red" Text="123123" VerticalAlignment="Center"></TextBlock>
</Border>
</StackPanel>
</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.TVP.Module
{
/// <summary>
/// MainViewToolbar.xaml 的交互逻辑
/// </summary>
public partial class MainViewToolbar : UserControl
{
public MainViewToolbar()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new MainViewToolbarViewModel());
}
}
}
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Module
{
/// <summary>
/// 创建项目视图模型
/// </summary>
public class CreateProjectViewModel : ViewModelBase
{
public CreateProjectViewModel()
{
// 初始化命令
this.initCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void initCommand()
{
this.LoadedCommand = new VCommand(this.Loaded);
this.EnterCommand = new VCommand(this.Enter);
this.CancelCommand = new VCommand(this.Cancel);
this.SelectFolderCommand = new VCommand(this.SelectFolder);
}
// ----------------------------------------------------------------------
// Property
// ----------------------------------------------------------------------
#region IsEnter -- 是否确定
private bool isEnter;
/// <summary>
/// 是否确定
/// </summary>
public bool IsEnter
{
get { return isEnter; }
set { isEnter = value; this.RaisePropertyChanged(nameof(IsEnter)); }
}
#endregion
#region ProjectName -- 项目名
private string projectName;
/// <summary>
/// 项目名
/// </summary>
public string ProjectName
{
get { return projectName; }
set { projectName = value; this.RaisePropertyChanged(nameof(ProjectName)); }
}
#endregion
#region ProjectPath -- 项目路径
private string projectPath;
/// <summary>
/// 项目路径
/// </summary>
public string ProjectPath
{
get { return projectPath; }
set { projectPath = value; this.RaisePropertyChanged(nameof(ProjectPath)); }
}
#endregion
// ----------------------------------------------------------------------
// Command
// ----------------------------------------------------------------------
#region LoadedCommand -- 加载命令
/// <summary>
/// 加载命令
/// </summary>
public VCommand LoadedCommand { get; set; }
/// <summary>
/// 加载
/// </summary>
private void Loaded()
{
this.ProjectPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "projects");
}
#endregion
#region EnterCommand -- 确定命令
/// <summary>
/// 确定命令
/// </summary>
public VCommand EnterCommand { get; set; }
/// <summary>
/// 确定
/// </summary>
private void Enter()
{
if (string.IsNullOrWhiteSpace(this.ProjectName))
{
DXMessageBox.Show("请输入项目名");
return;
}
if (string.IsNullOrWhiteSpace(this.ProjectPath))
{
DXMessageBox.Show("请选择项目所在文件夹");
return;
}
string path = System.IO.Path.Combine(this.ProjectPath, this.ProjectName);
if (System.IO.File.Exists(path))
{
DXMessageBox.Show("项目已经存在");
return;
}
this.IsEnter = true;
this.GetWindow()?.Close();
}
#endregion
#region CancelCommand -- 取消命令
/// <summary>
/// 取消命令
/// </summary>
public VCommand CancelCommand { get; set; }
/// <summary>
/// 取消
/// </summary>
private void Cancel()
{
this.IsEnter = false;
this.GetWindow()?.Close();
}
#endregion
#region SelectFolderCommand -- 选择文件夹命令
/// <summary>
/// 选择文件夹命令
/// </summary>
public VCommand SelectFolderCommand { get; set; }
/// <summary>
/// 选择文件夹
/// </summary>
private void SelectFolder()
{
System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog();
if (fbd.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
this.ProjectPath = fbd.SelectedPath;
}
#endregion
}
}
using DevExpress.Mvvm;
using DevExpress.Mvvm.Xpf;
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Domain;
namespace VIZ.TVP.Module
{
/// <summary>
/// 主视图工具栏视图模型
/// </summary>
public class MainViewToolbarViewModel : VIZ.Framework.Core.ViewModelBase, IProjectSupport
{
public MainViewToolbarViewModel()
{
// 初始化命令
this.initCommand();
// 初始化控制器
this.initController();
}
/// <summary>
/// 初始化命令
/// </summary>
private void initCommand()
{
this.CreateProjectCommand = new VCommand(this.CreateProject);
this.OpenProjectCommand = new VCommand(this.OpenProject);
this.SaveProjectCommand = new VCommand(this.SaveProject, this.CanSaveProject);
this.SaveAsProjectCommand = new VCommand(this.SaveAsProject, this.CanSaveProject);
this.CloseProjectCommand = new VCommand(this.CloseProject, this.CanSaveProject);
this.SettingCommand = new VCommand(this.Setting);
}
/// <summary>
/// 初始化控制器
/// </summary>
private void initController()
{
this.projectController = new ProjectController(this);
}
/// <summary>
/// 项目控制器
/// </summary>
private ProjectController projectController;
#region CreateProjectCommand -- 创建项目命令
/// <summary>
/// 创建项目命令
/// </summary>
public VCommand CreateProjectCommand { get; set; }
/// <summary>
/// 创建项目
/// </summary>
private void CreateProject()
{
this.projectController.CreateProject();
}
#endregion
#region OpenProjectCommand -- 打开项目命令
/// <summary>
/// 打开项目命令
/// </summary>
public VCommand OpenProjectCommand { get; set; }
/// <summary>
/// 打开项目
/// </summary>
private void OpenProject()
{
this.projectController.OpenProject();
}
#endregion
#region SaveProjectCommand -- 保存项目命令
/// <summary>
/// 保存项目命令
/// </summary>
public VCommand SaveProjectCommand { get; set; }
/// <summary>
/// 是否可以执行保存项目命令
/// </summary>
/// <returns>是否可以执行保存项目命令</returns>
private bool CanSaveProject()
{
return ApplicationDomainEx.CurrentProjectDomain != null;
}
/// <summary>
/// 保存项目
/// </summary>
private void SaveProject()
{
this.projectController.SaveProject();
}
#endregion
#region SaveAsProjectCommand -- 另存为命令
/// <summary>
/// 另存为命令
/// </summary>
public VCommand SaveAsProjectCommand { get; set; }
/// <summary>
/// 另存为
/// </summary>
private void SaveAsProject()
{
this.projectController.SaveAsProject();
}
#endregion
#region CloseProjectCommand -- 关闭项目命令
/// <summary>
/// 关闭项目命令
/// </summary>
public VCommand CloseProjectCommand { get; set; }
/// <summary>
/// 关闭项目
/// </summary>
private void CloseProject()
{
this.projectController.CloseProject();
}
#endregion
#region SettingCommand -- 设置命令
/// <summary>
/// 设置命令
/// </summary>
public VCommand SettingCommand { get; set; }
/// <summary>
/// 设置
/// </summary>
private void Setting()
{
}
#endregion
/// <summary>
/// 更新命令状态
/// </summary>
public void UpdateCommandStatus()
{
this.SaveProjectCommand.RaiseCanExecute();
this.SaveAsProjectCommand.RaiseCanExecute();
this.CloseProjectCommand.RaiseCanExecute();
}
}
}
...@@ -3,15 +3,17 @@ using System.Collections.Generic; ...@@ -3,15 +3,17 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Plugin; using VIZ.Framework.Plugin;
using VIZ.TVP.Domain; using VIZ.TVP.Domain;
using VIZ.TVP.Plugin;
namespace VIZ.TVP.Module namespace VIZ.TVP.Module
{ {
/// <summary> /// <summary>
/// 节目模板插件生命周期 /// 插件生命周期
/// </summary> /// </summary>
public class ProgramTemplatePluginLifeCycle : IPluginLifeCycle public class PluginPanelPluginLifeCycle : IPluginLifeCycle
{ {
/// <summary> /// <summary>
/// 插件ID /// 插件ID
...@@ -19,12 +21,12 @@ namespace VIZ.TVP.Module ...@@ -19,12 +21,12 @@ namespace VIZ.TVP.Module
/// <remarks> /// <remarks>
/// 插件ID不能包含点号 /// 插件ID不能包含点号
/// </remarks> /// </remarks>
public const string PLUGIN_ID = PluginIDs.PROGRAM_TEMPLATE; public const string PLUGIN_ID = PluginIDs.PLUGIN_PANEL;
/// <summary> /// <summary>
/// 插件显示名称 /// 插件显示名称
/// </summary> /// </summary>
public const string PLUGIN_DISPLAY_NAME = "节目模板"; public const string PLUGIN_DISPLAY_NAME = "插件";
/// <summary> /// <summary>
/// 注册 /// 注册
...@@ -37,7 +39,7 @@ namespace VIZ.TVP.Module ...@@ -37,7 +39,7 @@ namespace VIZ.TVP.Module
info.DisplayName = PLUGIN_DISPLAY_NAME; info.DisplayName = PLUGIN_DISPLAY_NAME;
info.HasView = true; info.HasView = true;
info.HasSettingView = false; info.HasSettingView = false;
info.ViewInfo = new PluginViewInfo(typeof(ProgramTemplateView), typeof(ProgramTemplateViewModel)); info.ViewInfo = new PluginViewInfo(typeof(PluginPanelView), typeof(PluginPanelViewModel));
return info; return info;
} }
...@@ -57,5 +59,6 @@ namespace VIZ.TVP.Module ...@@ -57,5 +59,6 @@ namespace VIZ.TVP.Module
{ {
} }
} }
} }
<UserControl x:Class="VIZ.TVP.Module.ProgramTemplateView" <UserControl x:Class="VIZ.TVP.Module.PluginPanelView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>
<TextBlock Text="节目模板" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="36" Foreground="Red"></TextBlock> <TextBlock Text="插件面板" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Red" FontSize="36"></TextBlock>
</Grid> </Grid>
</UserControl> </UserControl>
...@@ -16,11 +16,11 @@ using System.Windows.Shapes; ...@@ -16,11 +16,11 @@ using System.Windows.Shapes;
namespace VIZ.TVP.Module namespace VIZ.TVP.Module
{ {
/// <summary> /// <summary>
/// ProgramTemplateView.xaml 的交互逻辑 /// PluginPanelView.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class ProgramTemplateView : UserControl public partial class PluginPanelView : UserControl
{ {
public ProgramTemplateView() public PluginPanelView()
{ {
InitializeComponent(); InitializeComponent();
} }
......
...@@ -8,9 +8,9 @@ using VIZ.Framework.Plugin; ...@@ -8,9 +8,9 @@ using VIZ.Framework.Plugin;
namespace VIZ.TVP.Module namespace VIZ.TVP.Module
{ {
/// <summary> /// <summary>
/// 节目模板视图模型 /// 插件视图模型基类
/// </summary> /// </summary>
public class ProgramTemplateViewModel : PluginViewModelBase public class PluginPanelViewModel : PluginViewModelBase
{ {
/// <summary> /// <summary>
/// 销毁 /// 销毁
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Domain;
namespace VIZ.TVP.Module
{
/// <summary>
/// 界面单视图服务
/// </summary>
public interface IProgramListViewService : IService
{
/// <summary>
/// 添加场景模板
/// </summary>
/// <param name="fileModel">文件模型</param>
void AddSceneTemplate(GHResourceFileModel fileModel);
}
}
<dx:ThemedWindow x:Class="VIZ.TVP.Module.ProgramListNameWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:module="clr-namespace:VIZ.TVP.Module"
WindowStartupLocation="CenterScreen"
Title="节目单命名" Height="150" Width="600">
<Grid>
<module:TextInputView x:Name="inputView" Label="节目单名称"></module:TextInputView>
</Grid>
</dx:ThemedWindow>
using DevExpress.Xpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Shapes;
namespace VIZ.TVP.Module
{
/// <summary>
/// Interaction logic for ProgramListNameWindow.xaml
/// </summary>
public partial class ProgramListNameWindow : ThemedWindow
{
public ProgramListNameWindow()
{
InitializeComponent();
}
}
}
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<!-- 文件夹等待 --> <!-- 文件夹等待 -->
<dx:WaitIndicator DeferedVisibility="{Binding IsFolderLoading}" Content="Loading..." Margin="0,0,6,0" /> <dx:WaitIndicator DeferedVisibility="{Binding IsFolderLoading}" Content="Loading..." Margin="0,0,6,0" />
<GridSplitter HorizontalAlignment="Right" Width="6"></GridSplitter> <GridSplitter HorizontalAlignment="Right" Width="4"></GridSplitter>
<!-- 资源文件 --> <!-- 资源文件 -->
<dxg:GridControl Grid.Column="1" ShowBorder="False" <dxg:GridControl Grid.Column="1" ShowBorder="False"
...@@ -76,7 +76,13 @@ ...@@ -76,7 +76,13 @@
</dxg:GridControl.Resources> </dxg:GridControl.Resources>
<dxg:GridControl.ContextMenu> <dxg:GridControl.ContextMenu>
<ContextMenu> <ContextMenu>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Opened" Command="{Binding Path=FileContextMenuOpendCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/> <MenuItem Header="刷新" Command="{Binding Path=PlacementTarget.DataContext.RefreshFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator/>
<MenuItem Header="添加至场景模板" Command="{Binding Path=PlacementTarget.DataContext.AddProgramTemplateCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
</ContextMenu> </ContextMenu>
</dxg:GridControl.ContextMenu> </dxg:GridControl.ContextMenu>
<dxg:GridControl.Columns> <dxg:GridControl.Columns>
......
using DevExpress.Mvvm.UI.Native.ViewGenerator; using DevExpress.Mvvm.POCO;
using DevExpress.Mvvm.UI.Native.ViewGenerator;
using DevExpress.Xpf.Core.Native; using DevExpress.Xpf.Core.Native;
using log4net; using log4net;
using System; using System;
...@@ -43,6 +44,9 @@ namespace VIZ.TVP.Module ...@@ -43,6 +44,9 @@ namespace VIZ.TVP.Module
this.RefreshFolderCommand = new VCommand(this.RefreshFolder); this.RefreshFolderCommand = new VCommand(this.RefreshFolder);
this.RefreshFileCommand = new VCommand(this.RefreshFile); this.RefreshFileCommand = new VCommand(this.RefreshFile);
this.FolderExpandCommand = new VCommand<DevExpress.Xpf.Grid.TreeList.NodeDoubleClickEventArgs>(this.FolderExpand); this.FolderExpandCommand = new VCommand<DevExpress.Xpf.Grid.TreeList.NodeDoubleClickEventArgs>(this.FolderExpand);
this.FileContextMenuOpendCommand = new VCommand(this.FileContextMenuOpend);
this.AddProgramTemplateCommand = new VCommand(this.AddProgramTemplate, this.CanAddProgramTemplate);
} }
/// <summary> /// <summary>
...@@ -272,6 +276,56 @@ namespace VIZ.TVP.Module ...@@ -272,6 +276,56 @@ namespace VIZ.TVP.Module
#endregion #endregion
#region FileContextMenuOpendCommand -- 文件右键菜单打开命令
/// <summary>
/// 文件右键菜单打开命令
/// </summary>
public VCommand FileContextMenuOpendCommand { get; set; }
/// <summary>
/// 文件右键菜单打开
/// </summary>
private void FileContextMenuOpend()
{
this.AddProgramTemplateCommand.RaiseCanExecute();
}
#endregion
#region AddProgramTemplateCommand -- 添加节目模板命令
/// <summary>
/// 添加节目模板命令
/// </summary>
public VCommand AddProgramTemplateCommand { get; set; }
/// <summary>
/// 是否可以执行添加节目模板
/// </summary>
/// <returns>是否可以执行添加节目模板</returns>
private bool CanAddProgramTemplate()
{
return this.SelectedFileModel != null && this.SelectedFileModel.FileType == ResourceFileType.SCENE && ApplicationDomainEx.CurrentProjectDomain != null;
}
/// <summary>
/// 添加节目模板
/// </summary>
private void AddProgramTemplate()
{
if (this.SelectedFileModel == null || this.SelectedFileModel.FileType != ResourceFileType.SCENE)
return;
IProgramListViewService service = ApplicationDomainEx.ServiceManager.GetService<IProgramListViewService>(ServiceKeys.PROGRAM_LIST_VIEW_SERVICE);
if (service == null)
return;
service.AddSceneTemplate(this.SelectedFileModel);
}
#endregion
// ================================================================================== // ==================================================================================
// Public Function // Public Function
// ================================================================================== // ==================================================================================
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.Desktop.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Data.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Mvvm.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Printing.v22.1.Core, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Core.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Docking.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> <Reference Include="DevExpress.Xpf.Docking.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
...@@ -86,6 +87,14 @@ ...@@ -86,6 +87,14 @@
<Reference Include="WindowsFormsIntegration" /> <Reference Include="WindowsFormsIntegration" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Control\ControlList\View\ControlListView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainView\View\CreateProjectView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Debug\View\DebugWindow.xaml"> <Page Include="Debug\View\DebugWindow.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -94,11 +103,23 @@ ...@@ -94,11 +103,23 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Program\ProgramList\View\ProgramListView.xaml"> <Page Include="MainView\View\CreateProjectWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainView\View\MainViewToolbar.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PluginPanel\View\PluginPanelView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Program\View\ProgramListNameWindow.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Program\ProgramTemplate\View\ProgramTemplateView.xaml"> <Page Include="Program\View\ProgramListView.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
...@@ -122,6 +143,10 @@ ...@@ -122,6 +143,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Common\View\TextInputView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Generic.xaml"> <Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
...@@ -136,6 +161,17 @@ ...@@ -136,6 +161,17 @@
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Control\ControlList\ViewModel\ControlListViewModel.cs" />
<Compile Include="Control\ControlList\View\ControlListView.xaml.cs">
<DependentUpon>ControlListView.xaml</DependentUpon>
</Compile>
<Compile Include="Control\ControlList\ControlListPluginLifeCycle.cs" />
<Compile Include="MainView\Controller\Project\IProjectSupport.cs" />
<Compile Include="MainView\Controller\Project\ProjectController.cs" />
<Compile Include="MainView\ViewModel\CreateProjectViewModel.cs" />
<Compile Include="MainView\View\CreateProjectView.xaml.cs">
<DependentUpon>CreateProjectView.xaml</DependentUpon>
</Compile>
<Compile Include="Debug\View\DebugWindow.xaml.cs"> <Compile Include="Debug\View\DebugWindow.xaml.cs">
<DependentUpon>DebugWindow.xaml</DependentUpon> <DependentUpon>DebugWindow.xaml</DependentUpon>
</Compile> </Compile>
...@@ -143,15 +179,26 @@ ...@@ -143,15 +179,26 @@
<DependentUpon>DebugView.xaml</DependentUpon> <DependentUpon>DebugView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Debug\ViewModel\DebugViewModel.cs" /> <Compile Include="Debug\ViewModel\DebugViewModel.cs" />
<Compile Include="Program\ProgramList\ProgramListPluginLifeCycle.cs" /> <Compile Include="MainView\ViewModel\MainViewToolbarViewModel.cs" />
<Compile Include="Program\ProgramList\ViewModel\ProgramListViewModel.cs" /> <Compile Include="MainView\View\CreateProjectWindow.xaml.cs">
<Compile Include="Program\ProgramList\View\ProgramListView.xaml.cs"> <DependentUpon>CreateProjectWindow.xaml</DependentUpon>
<DependentUpon>ProgramListView.xaml</DependentUpon> </Compile>
<Compile Include="MainView\View\MainViewToolbar.xaml.cs">
<DependentUpon>MainViewToolbar.xaml</DependentUpon>
</Compile>
<Compile Include="PluginPanel\PluginPanelPluginLifeCycle.cs" />
<Compile Include="PluginPanel\ViewModel\PluginPanelViewModel.cs" />
<Compile Include="PluginPanel\View\PluginPanelView.xaml.cs">
<DependentUpon>PluginPanelView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Program\ProgramTemplate\ProgramTemplatePluginLifeCycle.cs" /> <Compile Include="Program\View\ProgramListNameWindow.xaml.cs">
<Compile Include="Program\ProgramTemplate\ViewModel\ProgramTemplateViewModel.cs" /> <DependentUpon>ProgramListNameWindow.xaml</DependentUpon>
<Compile Include="Program\ProgramTemplate\View\ProgramTemplateView.xaml.cs"> </Compile>
<DependentUpon>ProgramTemplateView.xaml</DependentUpon> <Compile Include="Program\ProgramListPluginLifeCycle.cs" />
<Compile Include="Program\Service\IProgramListViewService.cs" />
<Compile Include="Program\ViewModel\ProgramListViewModel.cs" />
<Compile Include="Program\View\ProgramListView.xaml.cs">
<DependentUpon>ProgramListView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Resource\MediaResource\ViewModel\MediaResourceViewModel.cs" /> <Compile Include="Resource\MediaResource\ViewModel\MediaResourceViewModel.cs" />
<Compile Include="Resource\MediaResource\View\MediaResourceView.xaml.cs"> <Compile Include="Resource\MediaResource\View\MediaResourceView.xaml.cs">
...@@ -196,6 +243,9 @@ ...@@ -196,6 +243,9 @@
</Compile> </Compile>
<Compile Include="Resource\MediaResource\MediaResourcePluginLifeCycle.cs" /> <Compile Include="Resource\MediaResource\MediaResourcePluginLifeCycle.cs" />
<Compile Include="Setup\Provider\Setup\AppSetup_InitLiteDB.cs" /> <Compile Include="Setup\Provider\Setup\AppSetup_InitLiteDB.cs" />
<Compile Include="Common\View\TextInputView.xaml.cs">
<DependentUpon>TextInputView.xaml</DependentUpon>
</Compile>
<Compile Include="VizRender\Controller\VizController\IVizSupport.cs" /> <Compile Include="VizRender\Controller\VizController\IVizSupport.cs" />
<Compile Include="VizRender\Controller\VizController\VizController.cs" /> <Compile Include="VizRender\Controller\VizController\VizController.cs" />
<Compile Include="VizRender\Model\VizConnectionModel.cs" /> <Compile Include="VizRender\Model\VizConnectionModel.cs" />
...@@ -282,9 +332,11 @@ ...@@ -282,9 +332,11 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Common\ViewModel\" />
<Folder Include="Control\ControlList\Controller\" />
<Folder Include="Login\Service\" /> <Folder Include="Login\Service\" />
<Folder Include="Program\ProgramList\Controller\" /> <Folder Include="PluginPanel\Controller\" />
<Folder Include="Program\ProgramTemplate\Controller\" /> <Folder Include="Program\Controller\" />
<Folder Include="Resource\LocalResource\Controller\" /> <Folder Include="Resource\LocalResource\Controller\" />
<Folder Include="Resource\MediaResource\Controller\" /> <Folder Include="Resource\MediaResource\Controller\" />
</ItemGroup> </ItemGroup>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Service
{
/// <summary>
/// 节目服务
/// </summary>
public class ProgramService : IProgramService
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Service
{
/// <summary>
/// 节目服务
/// </summary>
public interface IProgramService
{
}
}
...@@ -69,6 +69,8 @@ ...@@ -69,6 +69,8 @@
<Compile Include="GH\Implementation\GHService.cs" /> <Compile Include="GH\Implementation\GHService.cs" />
<Compile Include="GH\Interface\IGHResourceService.cs" /> <Compile Include="GH\Interface\IGHResourceService.cs" />
<Compile Include="GH\Interface\IGHService.cs" /> <Compile Include="GH\Interface\IGHService.cs" />
<Compile Include="Program\Implementation\ProgramService.cs" />
<Compile Include="Program\Interface\IProgramService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -45,7 +45,7 @@ namespace VIZ.TVP.Storage ...@@ -45,7 +45,7 @@ namespace VIZ.TVP.Storage
public string Path { get; private set; } public string Path { get; private set; }
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
// -- OpenCV -- // -- 包装 --
// ----------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------
/// <summary> /// <summary>
......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Storage
{
/// <summary>
/// 界面模板类型
/// </summary>
public enum ProgramTemplateType
{
/// <summary>
/// 场景模板
/// </summary>
[Description("场景模板")]
Scene,
/// <summary>
/// 命令模板
/// </summary>
[Description("命令模板")]
Command
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Storage
{
/// <summary>
/// 节目单
/// </summary>
public class ProgramListEntity
{
/// <summary>
/// 编号
/// </summary>
[LiteDB.BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 节目单ID
/// </summary>
public string ListID { get; set; } = Guid.NewGuid().ToString();
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Storage
{
/// <summary>
/// 节目单项
/// </summary>
public class ProgramListItemEntity
{
/// <summary>
/// 编号
/// </summary>
[LiteDB.BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 模板ID
/// </summary>
public string TemplateID { get; set; }
/// <summary>
/// 所属节目单ID
/// </summary>
public string ListID { get; set; }
/// <summary>
/// 模板类型
/// </summary>
public ProgramTemplateType TempalteType { get; set; }
/// <summary>
/// 场景名
/// </summary>
public string SceneName { get; set; }
/// <summary>
/// 缩略图
/// </summary>
public string Thumbnail { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 层
/// </summary>
public string Layer { get; set; }
/// <summary>
/// 引擎类型
/// </summary>
public TVPEngineType EngineType { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Storage
{
/// <summary>
/// 界面模板
/// </summary>
public class ProgramTemplateEntity
{
/// <summary>
/// 编号
/// </summary>
[LiteDB.BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 模板ID
/// </summary>
public string TemplateID { get; set; } = Guid.NewGuid().ToString();
/// <summary>
/// 模板类型
/// </summary>
public ProgramTemplateType TempalteType { get; set; }
/// <summary>
/// 场景名
/// </summary>
public string SceneName { get; set; }
/// <summary>
/// 缩略图
/// </summary>
public string Thumbnail { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 层
/// </summary>
public string Layer { get; set; }
/// <summary>
/// 引擎类型
/// </summary>
public TVPEngineType EngineType { get; set; }
}
}
using LiteDB;
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Storage
{
/// <summary>
/// 项目上下文
/// </summary>
public class ProjectContext : IDisposable
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(ProjectContext));
/// <summary>
/// 数据库
/// </summary>
private ILiteDatabase Database;
/// <summary>
/// LiteDB数据库
/// </summary>
/// <param name="path">数据库路径</param>
public ProjectContext(string path)
{
this.Path = path;
this.Database = new LiteDatabase(path);
this.ProgramTemplate = this.Database.GetCollection<ProgramTemplateEntity>();
this.ProgramList = this.Database.GetCollection<ProgramListEntity>();
this.ProgramListItem = this.Database.GetCollection<ProgramListItemEntity>();
}
/// <summary>
/// 数据库文件路径
/// </summary>
public string Path { get; private set; }
/// <summary>
/// 节目模板
/// </summary>
public ILiteCollection<ProgramTemplateEntity> ProgramTemplate { get; private set; }
/// <summary>
/// 节目单
/// </summary>
public ILiteCollection<ProgramListEntity> ProgramList { get; private set; }
/// <summary>
/// 节目单项
/// </summary>
public ILiteCollection<ProgramListItemEntity> ProgramListItem { get; private set; }
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
{
this.Database?.Dispose();
}
}
}
\ No newline at end of file
...@@ -75,6 +75,11 @@ ...@@ -75,6 +75,11 @@
<Compile Include="LiteDB\Application\LiteDbContext.cs" /> <Compile Include="LiteDB\Application\LiteDbContext.cs" />
<Compile Include="LiteDB\Application\TVPConnection\TVPConnectionGroupEntity.cs" /> <Compile Include="LiteDB\Application\TVPConnection\TVPConnectionGroupEntity.cs" />
<Compile Include="LiteDB\Application\TVPConnection\TVPEngineConfig.cs" /> <Compile Include="LiteDB\Application\TVPConnection\TVPEngineConfig.cs" />
<Compile Include="LiteDB\Project\Program\Enum\ProgramTempalteType.cs" />
<Compile Include="LiteDB\Project\Program\ProgramListItemEntity.cs" />
<Compile Include="LiteDB\Project\Program\ProgramListEntity.cs" />
<Compile Include="LiteDB\Project\Program\ProgramTemplateEntity.cs" />
<Compile Include="LiteDB\Project\ProjectContext.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XML\GH\Enum\GH_Category_Term_Enums.cs" /> <Compile Include="XML\GH\Enum\GH_Category_Term_Enums.cs" />
<Compile Include="XML\GH\Enum\GH_Content_Type_Enums.cs" /> <Compile Include="XML\GH\Enum\GH_Content_Type_Enums.cs" />
......
...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:module="clr-namespace:VIZ.TVP.Module;assembly=VIZ.TVP.Module" xmlns:module="clr-namespace:VIZ.TVP.Module;assembly=VIZ.TVP.Module"
Title="会智云播控系统" Height="800" Width="1000" WindowStartupLocation="CenterScreen" WindowState="Maximized"> Height="800" Width="1000" WindowStartupLocation="CenterScreen" WindowState="Maximized">
<dx:ThemedWindow.ToolbarItems>
<module:MainViewToolbar></module:MainViewToolbar>
</dx:ThemedWindow.ToolbarItems>
<Grid> <Grid>
<module:MainView></module:MainView> <module:MainView></module:MainView>
</Grid> </Grid>
......
...@@ -203,6 +203,9 @@ ...@@ -203,6 +203,9 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="projects\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>echo ========================================================== <PostBuildEvent>echo ==========================================================
......
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