Commit b94a6ea3 by liulongfei

GH库数据获取

parent 35b26a88
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
<id>tag:localhost:19398,2022-12-08:/files/2A72E33B-286F-F74A-8B03-B3B18C10135E/</id>
<title>Files</title>
<updated>2022-12-08T06:59:41Z</updated>
<author>
<name>Admin</name>
</author>
<entry>
<title>1</title>
<id>urn:uuid:880F3792-3FC5-974B-8B33-7AAAB607890C</id>
<updated>2022-11-03T11:17:17Z</updated>
<published>2022-11-03T05:57:10Z</published>
<category scheme="http://www.vizrt.com/types" term="IMAGE"/>
<category scheme="http://www.vizrt.com/types" term="asset"/>
<link href="http://localhost:19398/folder/2A72E33B-286F-F74A-8B03-B3B18C10135E/" rel="up" type="application/atom+xml;type=entry"/>
<link href="http://localhost:19398/file/880F3792-3FC5-974B-8B33-7AAAB607890C/2A72E33B-286F-F74A-8B03-B3B18C10135E/" rel="self" type="application/atom+xml;type=entry"/>
<link href="http://localhost:19398/metadata/file/880F3792-3FC5-974B-8B33-7AAAB607890C/" rel="describedby" type="application/vnd.vizrt.payload+xml"/>
<link href="http://localhost:19398/histories/880F3792-3FC5-974B-8B33-7AAAB607890C/" rel="history" type="application/atom+xml;type=feed"/>
<link href="http://localhost:19398/addons/880F3792-3FC5-974B-8B33-7AAAB607890C" rel="addon" type="application/atom+xml;type=feed"/>
<bgfx:image xmlns:bgfx="http://www.vizrt.com/2011/bgfx" uuid="&lt;880F3792-3FC5-974B-8B33-7AAAB607890C&gt;"/>
<vosmt:media xmlns:vosmt="http://www.vizrt.com/opensearch/mediatype">image</vosmt:media>
<media:content url="http://localhost:19398/image/880F3792-3FC5-974B-8B33-7AAAB607890C/" type="image/jpeg" height="739" width="600"/>
<content src="http://localhost:19398/image/880F3792-3FC5-974B-8B33-7AAAB607890C/" type="image/jpeg"/>
<media:thumbnail url="http://localhost:19398/thumbnail/880F3792-3FC5-974B-8B33-7AAAB607890C?size=large" height="360" width="640"/>
</entry>
</feed>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 资源文件类型
/// </summary>
public enum ResourceFileType
{
/// <summary>
/// 未知
/// </summary>
Unknow,
/// <summary>
/// 图片
/// </summary>
IMAGE,
/// <summary>
/// 场景
/// </summary>
Scene,
/// <summary>
/// 视频
/// </summary>
Video
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 资源文件夹类型
/// </summary>
public enum ResourceFolderType
{
/// <summary>
/// 项目文件夹
/// </summary>
Project,
/// <summary>
/// 普通文件夹
/// </summary>
Folder
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.TVP.Storage;
namespace VIZ.TVP.Domain
{
/// <summary>
/// GH 资源文件模型
/// </summary>
public class GHResourceFileModel : ResourceFileModelBase
{
/// <summary>
/// GH 节点
/// </summary>
public GH_Entry_Node EntryNode { get; set; }
#region Src --
private string src;
/// <summary>
/// 源
/// </summary>
public string Src
{
get { return src; }
set { src = value; this.RaisePropertyChanged(nameof(Src)); }
}
#endregion
#region MimeType -- 文件格式
private string mimeType;
/// <summary>
/// 文件格式
/// </summary>
public string MimeType
{
get { return mimeType; }
set { mimeType = value; this.RaisePropertyChanged(nameof(MimeType)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.TVP.Storage;
namespace VIZ.TVP.Domain
{
/// <summary>
/// GH 资源文件夹模型
/// </summary>
public class GHResourceFolderModel : ResourceFolderModelBase
{
/// <summary>
/// GH 节点
/// </summary>
public GH_Entry_Node EntryNode { get; set; }
#region Files -- 文件集合
private ObservableCollection<GHResourceFileModel> files;
/// <summary>
/// 文件集合
/// </summary>
public ObservableCollection<GHResourceFileModel> Files
{
get { return files; }
set { files = value; this.RaisePropertyChanged(nameof(Files)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 资源文件模型基类
/// </summary>
public class ResourceFileModelBase : ModelBase
{
#region FileType -- 文件类型
private ResourceFileType fileType;
/// <summary>
/// 文件类型
/// </summary>
public ResourceFileType FileType
{
get { return fileType; }
set { fileType = value; this.RaisePropertyChanged(nameof(FileType)); }
}
#endregion
#region Name -- 名称
private string name;
/// <summary>
/// 名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Domain
{
/// <summary>
/// 资源文件夹模型
/// </summary>
public abstract class ResourceFolderModelBase : ModelBase
{
#region Name -- 名称
private string name;
/// <summary>
/// 名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region FolderType -- 文件夹类型
private ResourceFolderType folderType;
/// <summary>
/// 文件夹类型
/// </summary>
public ResourceFolderType FolderType
{
get { return folderType; }
set { folderType = value; this.RaisePropertyChanged(nameof(FolderType)); }
}
#endregion
#region Parent -- 父节点
private ResourceFolderModelBase parent;
/// <summary>
/// 父节点
/// </summary>
public ResourceFolderModelBase Parent
{
get { return parent; }
set { parent = value; this.RaisePropertyChanged(nameof(Parent)); }
}
#endregion
#region Children -- 子节点集合
private ObservableCollection<ResourceFolderModelBase> children = new ObservableCollection<ResourceFolderModelBase>();
/// <summary>
/// 子节点集合
/// </summary>
public ObservableCollection<ResourceFolderModelBase> Children
{
get { return children; }
set { children = value; this.RaisePropertyChanged(nameof(Children)); }
}
#endregion
#region IsRefreshedFiles -- 是否刷新过文件
private bool isRefreshedFiles;
/// <summary>
/// 是否刷新过文件
/// </summary>
public bool IsRefreshedFiles
{
get { return isRefreshedFiles; }
set { isRefreshedFiles = value; this.RaisePropertyChanged(nameof(IsRefreshedFiles)); }
}
#endregion
}
}
...@@ -55,6 +55,12 @@ ...@@ -55,6 +55,12 @@
<Compile Include="Enum\ServiceKeys.cs" /> <Compile Include="Enum\ServiceKeys.cs" />
<Compile Include="Manager\PluginManager.cs" /> <Compile Include="Manager\PluginManager.cs" />
<Compile Include="Manager\WindowManager.cs" /> <Compile Include="Manager\WindowManager.cs" />
<Compile Include="Model\Resource\Enum\ResourceFileType.cs" />
<Compile Include="Model\Resource\Enum\ResourceFolderType.cs" />
<Compile Include="Model\Resource\GH\GHResourceFileModel.cs" />
<Compile Include="Model\Resource\GH\GHResourceFolderModel.cs" />
<Compile Include="Model\Resource\ResourceFileModelBase.cs" />
<Compile Include="Model\Resource\ResourceFolderModelBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
...@@ -86,8 +92,6 @@ ...@@ -86,8 +92,6 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup />
<Folder Include="Model\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
<ResourceDictionary 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:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys">
<Style x:Key="borderStyle" TargetType="Border">
<Setter Property="Background" Value="{dxi:ThemeResource {dxgt:GridRowThemeKey ResourceKey=BorderNoneBrush}}"/>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="dxg:TableView.IsFocusedRow" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{dxi:ThemeResource {dxgt:GridRowThemeKey ResourceKey=BorderSelectedBrush}}"/>
</MultiTrigger>
<Trigger Property="dxg:TableView.IsFocusedRow" Value="True">
<Setter Property="Background" Value="{dxi:ThemeResource {dxgt:GridRowThemeKey ResourceKey=BorderFocusedBrush}}"/>
</Trigger>
<DataTrigger Binding="{Binding IsSelected}" Value="True">
<Setter Property="Background" Value="{dxi:ThemeResource {dxgt:GridRowThemeKey ResourceKey=BorderFocusedBrush}}"/>
</DataTrigger>
</Style.Triggers>
</Style>
<ControlTemplate x:Key="{dxgt:GridCardThemeKey ResourceKey=ContainerTemplate}" TargetType="{x:Type ContentControl}">
<Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds="False">
<Border x:Name="borderCard" Width="Auto" Height="Auto" Style="{StaticResource borderStyle}">
<ContentPresenter />
</Border>
</Grid>
</ControlTemplate>
<Style TargetType="{x:Type dxg:GridCard}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ContentControl x:Name="card" Template="{DynamicResource {dxgt:GridCardThemeKey ResourceKey=ContainerTemplate}}"
Style="{Binding Path=(dxg:GridControl.ActiveView).CardStyle, RelativeSource={RelativeSource TemplatedParent}}" >
<ContentControl Template="{DynamicResource {dxgt:GridCardThemeKey ResourceKey=DataContentTemplate}}" ClipToBounds="False">
<dxg:GridCardContentPresenter x:Name="presenter" Style="{DynamicResource {dxgt:GridCardThemeKey ResourceKey=ContentPresenterStyle}}" ClipToBounds="False" />
</ContentControl>
</ContentControl>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.TVP.Module.Resource")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.TVP.Module.Resource")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.TVP.Module.Resource.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.TVP.Module.Resource.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: 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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<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:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.TVP.Module.Resource.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VIZ.TVP.Module.Resource">
</ResourceDictionary>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{18AC4721-CEF0-4D91-BE3A-65829313B2C7}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>VIZ.TVP.Module.Resource</RootNamespace>
<AssemblyName>VIZ.TVP.Module.Resource</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<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.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.Xpf.Controls.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.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, 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.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="DevExpreess\GridControl\GridControl_Files.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\folder_24x24.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\project_24x24.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
<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" />
<Reference Include="DevExpress.Xpf.Grid.v22.1, Version=22.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Grid.v22.1.Core, 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="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
...@@ -136,6 +139,7 @@ ...@@ -136,6 +139,7 @@
</Compile> </Compile>
<Compile Include="VizRender\ViewModel\VizRenderViewModel.cs" /> <Compile Include="VizRender\ViewModel\VizRenderViewModel.cs" />
<Compile Include="VizRender\VizRenderPluginLifeCycle.cs" /> <Compile Include="VizRender\VizRenderPluginLifeCycle.cs" />
<Compile Include="VizResource\Core\ResourceFolderNodeImageSelector.cs" />
<Compile Include="VizResource\View\VizResourceView.xaml.cs"> <Compile Include="VizResource\View\VizResourceView.xaml.cs">
<DependentUpon>VizResourceView.xaml</DependentUpon> <DependentUpon>VizResourceView.xaml</DependentUpon>
</Compile> </Compile>
...@@ -196,6 +200,10 @@ ...@@ -196,6 +200,10 @@
<Project>{65425cb5-7465-4e36-86a7-416341c8793c}</Project> <Project>{65425cb5-7465-4e36-86a7-416341c8793c}</Project>
<Name>VIZ.TVP.Domain</Name> <Name>VIZ.TVP.Domain</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Module.Resource\VIZ.TVP.Module.Resource.csproj">
<Project>{18ac4721-cef0-4d91-be3a-65829313b2c7}</Project>
<Name>VIZ.TVP.Module.Resource</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Plugin\VIZ.TVP.Plugin.csproj"> <ProjectReference Include="..\VIZ.TVP.Plugin\VIZ.TVP.Plugin.csproj">
<Project>{75b858df-c0ac-4b56-b109-5c21317af0ce}</Project> <Project>{75b858df-c0ac-4b56-b109-5c21317af0ce}</Project>
<Name>VIZ.TVP.Plugin</Name> <Name>VIZ.TVP.Plugin</Name>
......
using DevExpress.Xpf.Core.Native;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Grid.TreeList;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Globalization;
using System.Windows.Media;
using VIZ.TVP.Domain;
namespace VIZ.TVP.Module
{
/// <summary>
/// 资源文件夹节点图片选择器
/// </summary>
public class ResourceFolderNodeImageSelector : TreeListNodeImageSelector
{
/// <summary>
/// 文件夹图标
/// </summary>
public ImageSource Folder { get; set; }
/// <summary>
/// 项目图标
/// </summary>
public ImageSource Project { get; set; }
/// <summary>
/// 选择图标
/// </summary>
/// <param name="rowData">行数据</param>
/// <returns>图标</returns>
public override ImageSource Select(TreeListRowData rowData)
{
ResourceFolderModelBase model = rowData.Row as ResourceFolderModelBase;
if (model == null)
return null;
if (model.FolderType == ResourceFolderType.Project)
return this.Project;
if (model.FolderType == ResourceFolderType.Folder)
return this.Folder;
return null;
}
}
}
...@@ -3,10 +3,87 @@ ...@@ -3,10 +3,87 @@
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"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal"
xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
xmlns:local="clr-namespace:VIZ.TVP.Module" xmlns:local="clr-namespace:VIZ.TVP.Module"
mc:Ignorable="d" xmlns:domain="clr-namespace:VIZ.TVP.Domain;assembly=VIZ.TVP.Domain"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:VizResourceViewModel}"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.TVP.Module.Resource;component/DevExpreess/GridControl/GridControl_Files.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Loaded" Command="{Binding Path=LoadedCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<Grid> <Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 资源文件夹 -->
<dxg:TreeViewControl ItemsSource="{Binding Path=FolderModels}"
SelectedItem="{Binding Path=SelectedFolderModel,Mode=TwoWay}"
SelectionMode="Row" ShowNodeImages="True" ShowSearchPanel="False"
AllowEditing="False" TreeViewFieldName="Name" ChildNodesPath="Children">
<dxg:TreeViewControl.NodeImageSelector>
<local:ResourceFolderNodeImageSelector Folder="/VIZ.TVP.Module.Resource;component/Icons/folder_24x24.png"
Project="/VIZ.TVP.Module.Resource;component/Icons/project_24x24.png"></local:ResourceFolderNodeImageSelector>
</dxg:TreeViewControl.NodeImageSelector>
</dxg:TreeViewControl>
<!-- 资源文件 -->
<dxg:GridControl Grid.Column="1" ShowBorder="False"
ItemsSource="{Binding Path=FileModels}"
SelectedItem="{Binding Path=SelectedFileModel,Mode=TwoWay}">
<dxg:GridControl.Resources>
<!-- 定义Card模板 -->
<DataTemplate x:Key="CardTemplate">
<Grid Width="160" ClipToBounds="False" UseLayoutRounding="True">
<Grid.RowDefinitions>
<RowDefinition Height="90" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<!--<dxe:ImageEdit RenderOptions.BitmapScalingMode="HighQuality"
SnapsToDevicePixels="True"
ShowMenu="False"
IsReadOnly="True"
EditMode="InplaceInactive"
ShowBorder="False" />-->
<TextBlock Grid.Row="0" TextAlignment="Center" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" HorizontalAlignment="Center"
Text="{Binding Path=Row.Src}" ToolTip="{Binding Path=Row.Src}"/>
<TextBlock Grid.Row="1" TextAlignment="Center" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" HorizontalAlignment="Center"
Text="{Binding Path=Row.Name}" ToolTip="{Binding Path=Row.Name}"/>
</Grid>
</DataTemplate>
</dxg:GridControl.Resources>
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Name" AllowColumnFiltering="False" AllowEditing="False" ReadOnly="True"></dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:CardView IsColumnChooserVisible="False"
SeparatorThickness="0"
CardLayout="Rows"
ShowCardExpandButton="False"
ShowColumnHeaders="False"
ShowFilterPanelMode="Never"
ShowGroupedColumns="False"
ShowGroupPanel="False"
SearchPanelHighlightResults="False"
SearchPanelAllowFilter="True"
ShowSearchPanelMode="Never"
SearchColumns="Name"
NavigationStyle="Row"
CardTemplate="{StaticResource CardTemplate}"/>
</dxg:GridControl.View>
</dxg:GridControl>
</Grid> </Grid>
</UserControl> </UserControl>
using System; using DevExpress.Xpf.Core.Native;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq; 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.Framework.Plugin; using VIZ.Framework.Plugin;
using VIZ.TVP.Domain;
using VIZ.TVP.Service;
using VIZ.TVP.Storage;
namespace VIZ.TVP.Module namespace VIZ.TVP.Module
{ {
...@@ -13,17 +18,128 @@ namespace VIZ.TVP.Module ...@@ -13,17 +18,128 @@ namespace VIZ.TVP.Module
/// </summary> /// </summary>
public class VizResourceViewModel : PluginViewModelBase public class VizResourceViewModel : PluginViewModelBase
{ {
public VizResourceViewModel()
{
// 初始化命令
this.initCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void initCommand()
{
this.LoadedCommand = new VCommand(this.Loaded);
}
// ================================================================================== // ==================================================================================
// Property // Property
// ================================================================================== // ==================================================================================
#region FolderModels -- 文件夹目录集合
private ObservableCollection<GHResourceFolderModel> folderModels;
/// <summary>
/// 文件夹目录集合
/// </summary>
public ObservableCollection<GHResourceFolderModel> FolderModels
{
get { return folderModels; }
set { folderModels = value; this.RaisePropertyChanged(nameof(FolderModels)); }
}
#endregion
#region SelectedFolderModel -- 当前选中的文件夹
private GHResourceFolderModel selectedFolderModel;
/// <summary>
/// 当前选中的文件夹
/// </summary>
public GHResourceFolderModel SelectedFolderModel
{
get { return selectedFolderModel; }
set
{
selectedFolderModel = value;
this.RaisePropertyChanged(nameof(SelectedFolderModel));
// 更新文件模型
this.updateFileModels(value);
}
}
#endregion
#region FileModels -- 文件集合
private ObservableCollection<GHResourceFileModel> fileModels;
/// <summary>
/// 文件集合
/// </summary>
public ObservableCollection<GHResourceFileModel> FileModels
{
get { return fileModels; }
set { fileModels = value; this.RaisePropertyChanged(nameof(FileModels)); }
}
#endregion
#region SelectedFileModel -- 选中的文件模型
private GHResourceFileModel selectedFileModel;
/// <summary>
/// 选中的文件模型
/// </summary>
public GHResourceFileModel SelectedFileModel
{
get { return selectedFileModel; }
set { selectedFileModel = value; this.RaisePropertyChanged(nameof(SelectedFileModel)); }
}
#endregion
// ==================================================================================
// Service & Controller
// ==================================================================================
/// <summary>
/// GH 资源服务
/// </summary>
private IGHResourceService ghResourceService = new GHResourceService();
// ================================================================================== // ==================================================================================
// Command // Command
// ================================================================================== // ==================================================================================
#region LoadedCommand -- 加载命令
/// <summary>
/// 加载命令
/// </summary>
public VCommand LoadedCommand { get; set; }
/// <summary>
/// 加载
/// </summary>
private void Loaded()
{
if (this.IsAlreadyLoaded)
return;
List<GHResourceFolderModel> list = this.ghResourceService.GetGHResourceFolders("http://localhost:19398/folders/");
this.FolderModels = list.FirstOrDefault()?.Children.Select(p => (GHResourceFolderModel)p).ToObservableCollection();
this.IsAlreadyLoaded = true;
}
#endregion
// ==================================================================================
// Public Function
// ==================================================================================
/// <summary> /// <summary>
/// 销毁 /// 销毁
/// </summary> /// </summary>
...@@ -31,5 +147,45 @@ namespace VIZ.TVP.Module ...@@ -31,5 +147,45 @@ namespace VIZ.TVP.Module
{ {
} }
// ==================================================================================
// Private Function
// ==================================================================================
/// <summary>
/// 更新文件模型
/// </summary>
/// <param name="folder">文件夹</param>
private void updateFileModels(GHResourceFolderModel folder)
{
// 文件夹对象不存在
if (folder == null)
{
this.FileModels = null;
this.SelectedFileModel = null;
return;
}
// 已经获取过文件
if (folder.IsRefreshedFiles)
{
this.FileModels = folder.Files;
return;
}
GH_Link_Node link_related = folder.EntryNode.links.FirstOrDefault(p => p.rel == GH_Link_Rel_Enums.related);
if (link_related == null || string.IsNullOrWhiteSpace(link_related.href))
{
folder.IsRefreshedFiles = true;
return;
}
folder.Files = ghResourceService.GetGHResourceFiles(link_related.href).ToObservableCollection();
this.FileModels = folder.Files;
folder.IsRefreshedFiles = true;
return;
}
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Domain;
using VIZ.TVP.Storage;
namespace VIZ.TVP.Service
{
/// <summary>
/// GH 资源服务
/// </summary>
public class GHResourceService : IGHResourceService
{
/// <summary>
/// GH服务
/// </summary>
private IGHService ghService = new GHService();
/// <summary>
/// 获取GH资源文件夹
/// </summary>
/// <param name="url">GH请求地址</param>
/// <returns>GH资源树根节点</returns>
public List<GHResourceFolderModel> GetGHResourceFolders(string url)
{
List<GHResourceFolderModel> list = new List<GHResourceFolderModel>();
GH_Feed_Node feed_node = ghService.GetFeedNode(url);
foreach (GH_Entry_Node entry_node in feed_node.entries)
{
GHResourceFolderModel child = new GHResourceFolderModel();
child.EntryNode = entry_node;
// 名称
child.Name = entry_node.title;
// 类型
if (entry_node.categorys.Any(p => p.term == GH_Category_Term_Enums.Project))
{
child.FolderType = ResourceFolderType.Project;
}
if (entry_node.categorys.Any(p => p.term == GH_Category_Term_Enums.Folder))
{
child.FolderType = ResourceFolderType.Folder;
}
// 子项信息
GH_Link_Node link_down = entry_node.links.FirstOrDefault(p => p.rel == GH_Link_Rel_Enums.down);
if (link_down == null)
continue;
List<GHResourceFolderModel> child_list = this.GetGHResourceFolders(link_down.href);
foreach (GHResourceFolderModel item in child_list)
{
child.Children.Add(item);
item.Parent = child;
}
list.Add(child);
}
return list;
}
/// <summary>
/// 获取GH资源文件
/// </summary>
/// <param name="url">GH请求地址</param>
/// <returns>GH资源文件</returns>
public List<GHResourceFileModel> GetGHResourceFiles(string url)
{
List<GHResourceFileModel> list = new List<GHResourceFileModel>();
GH_Feed_Node feed_node = ghService.GetFeedNode(url);
foreach (GH_Entry_Node entry_node in feed_node.entries)
{
GHResourceFileModel child = new GHResourceFileModel();
child.EntryNode = entry_node;
// 名称
child.Name = entry_node.title;
// 图片类型
if (entry_node.categorys.Any(p => p.term == GH_Category_Term_Enums.IMAGE))
{
child.FileType = ResourceFileType.IMAGE;
child.Src = entry_node.content.src;
child.MimeType = entry_node.content.type;
}
list.Add(child);
}
return list;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.TVP.Domain;
namespace VIZ.TVP.Service
{
/// <summary>
/// GH 资源服务
/// </summary>
public interface IGHResourceService
{
/// <summary>
/// 获取GH资源文件夹
/// </summary>
/// <param name="url">GH请求地址</param>
/// <returns>GH资源树根节点</returns>
List<GHResourceFolderModel> GetGHResourceFolders(string url);
/// <summary>
/// 获取GH资源文件
/// </summary>
/// <param name="url">GH请求地址</param>
/// <returns>GH资源文件</returns>
List<GHResourceFileModel> GetGHResourceFiles(string url);
}
}
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ 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 VIZ.TVP.Storage;
namespace VIZ.TVP.Service namespace VIZ.TVP.Service
{ {
...@@ -11,6 +12,11 @@ namespace VIZ.TVP.Service ...@@ -11,6 +12,11 @@ namespace VIZ.TVP.Service
/// </summary> /// </summary>
public interface IGHService public interface IGHService
{ {
/// <summary>
/// 获取Feed节点
/// </summary>
/// <param name="url">地址</param>
/// <returns>Feed节点</returns>
GH_Feed_Node GetFeedNode(string url);
} }
} }
...@@ -46,7 +46,9 @@ ...@@ -46,7 +46,9 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="GH\Implementation\GHResourceService.cs" />
<Compile Include="GH\Implementation\GHService.cs" /> <Compile Include="GH\Implementation\GHService.cs" />
<Compile Include="GH\Interface\IGHResourceService.cs" />
<Compile Include="GH\Interface\IGHService.cs" /> <Compile Include="GH\Interface\IGHService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
...@@ -58,10 +60,18 @@ ...@@ -58,10 +60,18 @@
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project> <Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name> <Name>VIZ.Framework.Core</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj"> <ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project> <Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name> <Name>VIZ.Framework.Storage</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Domain\VIZ.TVP.Domain.csproj">
<Project>{65425cb5-7465-4e36-86a7-416341c8793c}</Project>
<Name>VIZ.TVP.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Storage\VIZ.TVP.Storage.csproj"> <ProjectReference Include="..\VIZ.TVP.Storage\VIZ.TVP.Storage.csproj">
<Project>{d9e0c48d-d7e7-4207-a999-2fded536d4da}</Project> <Project>{d9e0c48d-d7e7-4207-a999-2fded536d4da}</Project>
<Name>VIZ.TVP.Storage</Name> <Name>VIZ.TVP.Storage</Name>
......
...@@ -51,12 +51,14 @@ ...@@ -51,12 +51,14 @@
<ItemGroup> <ItemGroup>
<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_Link_Rel_Enums.cs" /> <Compile Include="XML\GH\Enum\GH_Link_Rel_Enums.cs" />
<Compile Include="XML\GH\Enum\GH_Link_Type_Enums.cs" /> <Compile Include="XML\GH\Enum\GH_Link_Type_Enums.cs" />
<Compile Include="XML\GH\Enum\GH_Xmlns_Enums.cs" /> <Compile Include="XML\GH\Enum\GH_Xmlns_Enums.cs" />
<Compile Include="XML\GH\GH_NodeHelper.cs" /> <Compile Include="XML\GH\GH_NodeHelper.cs" />
<Compile Include="XML\GH\Node\GH_Author_Node.cs" /> <Compile Include="XML\GH\Node\GH_Author_Node.cs" />
<Compile Include="XML\GH\Node\GH_Category_Node.cs" /> <Compile Include="XML\GH\Node\GH_Category_Node.cs" />
<Compile Include="XML\GH\Node\GH_Content_Node.cs" />
<Compile Include="XML\GH\Node\GH_Entry_Node.cs" /> <Compile Include="XML\GH\Node\GH_Entry_Node.cs" />
<Compile Include="XML\GH\Node\GH_Feed_Node.cs" /> <Compile Include="XML\GH\Node\GH_Feed_Node.cs" />
<Compile Include="XML\GH\Node\GH_Link_Node.cs" /> <Compile Include="XML\GH\Node\GH_Link_Node.cs" />
......
...@@ -20,5 +20,17 @@ namespace VIZ.TVP.Storage ...@@ -20,5 +20,17 @@ namespace VIZ.TVP.Storage
/// 项目 /// 项目
/// </summary> /// </summary>
public const string Project = "Project"; public const string Project = "Project";
/// <summary>
/// 图片
/// </summary>
public const string IMAGE = "IMAGE";
/// <summary>
/// 资源
/// </summary>
public const string asset = "asset";
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Storage
{
/// <summary>
/// 内容类型
/// </summary>
public static class GH_Content_Type_Enums
{
/// <summary>
/// jpeg图片
/// </summary>
public const string image_jpg = "image/jpeg";
}
}
...@@ -20,8 +20,8 @@ namespace VIZ.TVP.Storage ...@@ -20,8 +20,8 @@ namespace VIZ.TVP.Storage
/// <summary> /// <summary>
/// 条款 /// 条款
/// </summary>
/// <see cref="GH_Category_Term_Enums"/> /// <see cref="GH_Category_Term_Enums"/>
/// </summary>
public string term { get; set; } public string term { get; set; }
/// <summary> /// <summary>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using VIZ.Framework.Core;
namespace VIZ.TVP.Storage
{
/// <summary>
/// GH Content 节点
/// </summary>
public class GH_Content_Node : IXmlSerialize
{
/// <summary>
/// 地址
/// </summary>
public string src { get; set; }
/// <summary>
/// 类型
/// <see cref="GH_Content_Type_Enums"/>
/// </summary>
public string type { get; set; }
/// <summary>
/// 从XElement节点获取数据
/// </summary>
/// <param name="element">XElement节点</param>
public void FromXmlElement(XElement element)
{
if (element == null)
return;
this.src = element.GetAttributeValue<string>("src");
this.type = element.GetAttributeValue<string>("type");
}
}
}
...@@ -28,9 +28,9 @@ namespace VIZ.TVP.Storage ...@@ -28,9 +28,9 @@ namespace VIZ.TVP.Storage
public string updated { get; set; } public string updated { get; set; }
/// <summary> /// <summary>
/// 分类 /// 分类集合
/// </summary> /// </summary>
public GH_Category_Node category { get; set; } = new GH_Category_Node(); public List<GH_Category_Node> categorys { get; set; } = new List<GH_Category_Node>();
/// <summary> /// <summary>
/// 连接集合 /// 连接集合
...@@ -38,6 +38,11 @@ namespace VIZ.TVP.Storage ...@@ -38,6 +38,11 @@ namespace VIZ.TVP.Storage
public List<GH_Link_Node> links { get; set; } = new List<GH_Link_Node>(); public List<GH_Link_Node> links { get; set; } = new List<GH_Link_Node>();
/// <summary> /// <summary>
/// 内容
/// </summary>
public GH_Content_Node content { get; set; } = new GH_Content_Node();
/// <summary>
/// 从XElement节点获取数据 /// 从XElement节点获取数据
/// </summary> /// </summary>
/// <param name="element">XElement节点</param> /// <param name="element">XElement节点</param>
...@@ -50,8 +55,16 @@ namespace VIZ.TVP.Storage ...@@ -50,8 +55,16 @@ namespace VIZ.TVP.Storage
this.id = element.Element(XName.Get("id", GH_Xmlns_Enums.xmlns))?.Value; this.id = element.Element(XName.Get("id", GH_Xmlns_Enums.xmlns))?.Value;
this.updated = element.Element(XName.Get("updated_at", GH_Xmlns_Enums.xmlns))?.Value; this.updated = element.Element(XName.Get("updated_at", GH_Xmlns_Enums.xmlns))?.Value;
this.category.FromXmlElement(element.Element(XName.Get("category", GH_Xmlns_Enums.xmlns))); // 分类
foreach (XElement category in element.Elements(XName.Get("category", GH_Xmlns_Enums.xmlns)))
{
GH_Category_Node category_node = new GH_Category_Node();
category_node.FromXmlElement(category);
this.categorys.Add(category_node);
}
// 连接
foreach (XElement link in element.Elements(XName.Get("link", GH_Xmlns_Enums.xmlns))) foreach (XElement link in element.Elements(XName.Get("link", GH_Xmlns_Enums.xmlns)))
{ {
GH_Link_Node link_node = new GH_Link_Node(); GH_Link_Node link_node = new GH_Link_Node();
...@@ -59,6 +72,9 @@ namespace VIZ.TVP.Storage ...@@ -59,6 +72,9 @@ namespace VIZ.TVP.Storage
this.links.Add(link_node); this.links.Add(link_node);
} }
// 内容
this.content.FromXmlElement(element.Element(XName.Get("content", GH_Xmlns_Enums.xmlns)));
} }
} }
} }
...@@ -15,14 +15,14 @@ namespace VIZ.TVP.Storage ...@@ -15,14 +15,14 @@ namespace VIZ.TVP.Storage
{ {
/// <summary> /// <summary>
/// 引用 /// 引用
/// </summary>
/// <see cref="GH_Link_Rel_Enums"/> /// <see cref="GH_Link_Rel_Enums"/>
/// </summary>
public string rel { get; set; } public string rel { get; set; }
/// <summary> /// <summary>
/// 类型 /// 类型
/// </summary>
/// <see cref="GH_Link_Type_Enums"/> /// <see cref="GH_Link_Type_Enums"/>
/// </summary>
public string type { get; set; } public string type { get; set; }
/// <summary> /// <summary>
......
...@@ -11,11 +11,27 @@ namespace VIZ.TVP.UnitTest ...@@ -11,11 +11,27 @@ namespace VIZ.TVP.UnitTest
public class GHTest public class GHTest
{ {
[TestMethod] [TestMethod]
public void TestMethod1() public void GHServiceTest_GetFolder()
{ {
GHService service = new GHService(); GHService service = new GHService();
//var query = service.GetFeedNode("http://localhost:19398/folders/"); //var query = service.GetFeedNode("http://localhost:19398/folders/");
var query = service.GetFeedNode("http://localhost:19398/folders/C7FC16A7-3C53-044C-8D24-29C5BF4AF19D/"); // http://localhost:19398/folder/45295B36-BAA0-A64F-9370-C9D20E006EF8/
var query = service.GetFeedNode("http://localhost:19398/folders/45295B36-BAA0-A64F-9370-C9D20E006EF8/");
}
[TestMethod]
public void GHSeerviceTest_GetFile()
{
//localhost:19398,2022-12-08:/files/2A72E33B-286F-F74A-8B03-B3B18C10135E/
GHService service = new GHService();
var query = service.GetFeedNode("http://localhost:19398/files/2A72E33B-286F-F74A-8B03-B3B18C10135E/");
}
[TestMethod]
public void GHResourceServiceTest_GetFolder()
{
GHResourceService service = new GHResourceService();
var query = service.GetGHResourceFolders("http://localhost:19398/folders/");
} }
} }
} }
...@@ -5,7 +5,8 @@ VisualStudioVersion = 17.3.32825.248 ...@@ -5,7 +5,8 @@ VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00-Doc", "00-Doc", "{751737B7-0297-4966-9978-CF1442765BD0}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00-Doc", "00-Doc", "{751737B7-0297-4966-9978-CF1442765BD0}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
Doc\GH资源接口返回结果.xml = Doc\GH资源接口返回结果.xml Doc\GH资源接口返回结果_文件.xml = Doc\GH资源接口返回结果_文件.xml
Doc\GH资源接口返回结果_文件夹或项目.xml = Doc\GH资源接口返回结果_文件夹或项目.xml
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05-Lib", "05-Lib", "{39CED10E-394F-46A3-8571-948E126F9EC2}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05-Lib", "05-Lib", "{39CED10E-394F-46A3-8571-948E126F9EC2}"
...@@ -66,6 +67,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "55-Service", "55-Service", ...@@ -66,6 +67,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "55-Service", "55-Service",
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Service", "VIZ.TVP.Service\VIZ.TVP.Service.csproj", "{B4FAA424-E356-465B-B0BA-7B915C4F8E2A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Service", "VIZ.TVP.Service\VIZ.TVP.Service.csproj", "{B4FAA424-E356-465B-B0BA-7B915C4F8E2A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Module.Resource", "VIZ.TVP.Module.Resource\VIZ.TVP.Module.Resource.csproj", "{18AC4721-CEF0-4D91-BE3A-65829313B2C7}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -210,6 +213,14 @@ Global ...@@ -210,6 +213,14 @@ Global
{B4FAA424-E356-465B-B0BA-7B915C4F8E2A}.Release|Any CPU.Build.0 = Release|Any CPU {B4FAA424-E356-465B-B0BA-7B915C4F8E2A}.Release|Any CPU.Build.0 = Release|Any CPU
{B4FAA424-E356-465B-B0BA-7B915C4F8E2A}.Release|x64.ActiveCfg = Release|Any CPU {B4FAA424-E356-465B-B0BA-7B915C4F8E2A}.Release|x64.ActiveCfg = Release|Any CPU
{B4FAA424-E356-465B-B0BA-7B915C4F8E2A}.Release|x64.Build.0 = Release|Any CPU {B4FAA424-E356-465B-B0BA-7B915C4F8E2A}.Release|x64.Build.0 = Release|Any CPU
{18AC4721-CEF0-4D91-BE3A-65829313B2C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{18AC4721-CEF0-4D91-BE3A-65829313B2C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{18AC4721-CEF0-4D91-BE3A-65829313B2C7}.Debug|x64.ActiveCfg = Debug|Any CPU
{18AC4721-CEF0-4D91-BE3A-65829313B2C7}.Debug|x64.Build.0 = Debug|Any CPU
{18AC4721-CEF0-4D91-BE3A-65829313B2C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{18AC4721-CEF0-4D91-BE3A-65829313B2C7}.Release|Any CPU.Build.0 = Release|Any CPU
{18AC4721-CEF0-4D91-BE3A-65829313B2C7}.Release|x64.ActiveCfg = Release|Any CPU
{18AC4721-CEF0-4D91-BE3A-65829313B2C7}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
...@@ -232,6 +243,7 @@ Global ...@@ -232,6 +243,7 @@ Global
{75B858DF-C0AC-4B56-B109-5C21317AF0CE} = {72D1C6DE-7B56-4963-89B3-FAE8B2D3F5B5} {75B858DF-C0AC-4B56-B109-5C21317AF0CE} = {72D1C6DE-7B56-4963-89B3-FAE8B2D3F5B5}
{39A3CDBE-2132-4C71-BF2F-F99A9E966109} = {72D1C6DE-7B56-4963-89B3-FAE8B2D3F5B5} {39A3CDBE-2132-4C71-BF2F-F99A9E966109} = {72D1C6DE-7B56-4963-89B3-FAE8B2D3F5B5}
{B4FAA424-E356-465B-B0BA-7B915C4F8E2A} = {D835160C-344B-4EE4-8441-3847686C4AB0} {B4FAA424-E356-465B-B0BA-7B915C4F8E2A} = {D835160C-344B-4EE4-8441-3847686C4AB0}
{18AC4721-CEF0-4D91-BE3A-65829313B2C7} = {68E0F44E-70C5-4D7D-A0BC-0D8A56D8B979}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {25E4D7B8-911F-47E7-8C18-B6F002A07E00} SolutionGuid = {25E4D7B8-911F-47E7-8C18-B6F002A07E00}
......
...@@ -152,6 +152,10 @@ ...@@ -152,6 +152,10 @@
<Project>{65425cb5-7465-4e36-86a7-416341c8793c}</Project> <Project>{65425cb5-7465-4e36-86a7-416341c8793c}</Project>
<Name>VIZ.TVP.Domain</Name> <Name>VIZ.TVP.Domain</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Module.Resource\VIZ.TVP.Module.Resource.csproj">
<Project>{18ac4721-cef0-4d91-be3a-65829313b2c7}</Project>
<Name>VIZ.TVP.Module.Resource</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Module\VIZ.TVP.Module.csproj"> <ProjectReference Include="..\VIZ.TVP.Module\VIZ.TVP.Module.csproj">
<Project>{d5e72447-d86a-443c-b0a4-e76bca89ae8d}</Project> <Project>{d5e72447-d86a-443c-b0a4-e76bca89ae8d}</Project>
<Name>VIZ.TVP.Module</Name> <Name>VIZ.TVP.Module</Name>
......
[Application] [Application]
APPLICATION_IS_DEBUG=true APPLICATION_IS_DEBUG=false
\ No newline at end of file \ No newline at end of file
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