Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Framework
Commits
ae58418e
Commit
ae58418e
authored
Jan 06, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
框架调整
parent
c06569ec
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
55 deletions
+53
-55
VIZ.Framework.Common.Resource/Style/GridSplitter/GridSplitter_None.xaml
+16
-0
VIZ.Framework.Common.Resource/VIZ.Framework.Common.Resource.csproj
+4
-0
VIZ.Framework.Common/VideoControl/Stream/NDI/NDIStreamInfo.cs
+5
-0
VIZ.Framework.Common/VideoControl/Stream/NDI/Task/NDIStreamFindStreamTask.cs
+2
-0
VIZ.Framework.Common/Widgets/NavigationControl/NavigationConfig.cs
+2
-16
VIZ.Framework.Common/Widgets/NavigationControl/NavigationControl.xaml
+0
-1
VIZ.Framework.Common/Widgets/NavigationControl/NavigationItemControl.cs
+3
-38
VIZ.Framework.Core/Core/Net/NetHelper.cs
+21
-0
No files found.
VIZ.Framework.Common.Resource/Style/GridSplitter/GridSplitter_None.xaml
0 → 100644
View file @
ae58418e
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="GridSplitter_None" TargetType="GridSplitter">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border Background="Transparent"></Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
VIZ.Framework.Common.Resource/VIZ.Framework.Common.Resource.csproj
View file @
ae58418e
...
@@ -90,6 +90,10 @@
...
@@ -90,6 +90,10 @@
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<SubType>Designer</SubType>
</Page>
</Page>
<Page Include="Style\GridSplitter\GridSplitter_None.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Style\ListBox\ListBox_None.xaml">
<Page Include="Style\ListBox\ListBox_None.xaml">
<Generator>MSBuild:Compile</Generator>
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<SubType>Designer</SubType>
...
...
VIZ.Framework.Common/VideoControl/Stream/NDI/NDIStreamInfo.cs
View file @
ae58418e
...
@@ -28,6 +28,11 @@ namespace VIZ.Framework.Common
...
@@ -28,6 +28,11 @@ namespace VIZ.Framework.Common
public
string
FullName
{
get
;
set
;
}
public
string
FullName
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 地址
/// </summary>
public
string
Address
{
get
;
set
;
}
/// <summary>
/// NDI流信息
/// NDI流信息
/// </summary>
/// </summary>
public
NDIlib
.
source_t
Source
{
get
;
set
;
}
public
NDIlib
.
source_t
Source
{
get
;
set
;
}
...
...
VIZ.Framework.Common/VideoControl/Stream/NDI/Task/NDIStreamFindStreamTask.cs
View file @
ae58418e
...
@@ -70,12 +70,14 @@ namespace VIZ.Framework.Common
...
@@ -70,12 +70,14 @@ namespace VIZ.Framework.Common
// NDI流名称
// NDI流名称
string
ndiName
=
UTF
.
Utf8ToString
(
src
.
p_ndi_name
);
string
ndiName
=
UTF
.
Utf8ToString
(
src
.
p_ndi_name
);
string
address
=
UTF
.
Utf8ToString
(
src
.
p_url_address
);
// 添加NDI流信息
// 添加NDI流信息
NDIStreamInfo
info
=
new
NDIStreamInfo
();
NDIStreamInfo
info
=
new
NDIStreamInfo
();
info
.
FullName
=
ndiName
;
info
.
FullName
=
ndiName
;
info
.
Machine
=
ndiName
.
Split
(
new
char
[]
{
' '
},
2
)[
0
];
info
.
Machine
=
ndiName
.
Split
(
new
char
[]
{
' '
},
2
)[
0
];
info
.
Name
=
ndiName
.
Substring
(
ndiName
.
IndexOf
(
' '
)
+
1
);
info
.
Name
=
ndiName
.
Substring
(
ndiName
.
IndexOf
(
' '
)
+
1
);
info
.
Address
=
address
;
info
.
Source
=
src
;
info
.
Source
=
src
;
lock
(
this
.
Stream
.
StreamInfos
)
lock
(
this
.
Stream
.
StreamInfos
)
...
...
VIZ.Framework.Common/Widgets/NavigationControl/NavigationConfig.cs
View file @
ae58418e
...
@@ -41,28 +41,14 @@ namespace VIZ.Framework.Common
...
@@ -41,28 +41,14 @@ namespace VIZ.Framework.Common
#
endregion
#
endregion
#
region
ViewModelType
--
视图模型类型
private
Type
viewModelType
;
/// <summary>
/// 视图模型类型
/// </summary>
public
Type
ViewModelType
{
get
{
return
viewModelType
;
}
set
{
viewModelType
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ViewModelType
));
}
}
#
endregion
/// <summary>
/// <summary>
/// 视图
/// 视图
/// </summary>
/// </summary>
public
WeakReference
<
object
>
View
{
get
;
set
;
}
public
WeakReference
<
object
>
View
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 视图
模型
/// 视图
创建后触发 参数: 导航配置, 视图
/// </summary>
/// </summary>
public
WeakReference
<
object
>
ViewModel
{
get
;
set
;
}
public
Action
<
NavigationConfig
,
object
>
ViewCreated
{
get
;
set
;
}
}
}
}
}
VIZ.Framework.Common/Widgets/NavigationControl/NavigationControl.xaml
View file @
ae58418e
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="Visibility" Value="{Binding Path=IsSelected,RelativeSource={RelativeSource Mode=Self},Converter={StaticResource Bool2VisibilityConverter}}"></Setter>
<Setter Property="Visibility" Value="{Binding Path=IsSelected,RelativeSource={RelativeSource Mode=Self},Converter={StaticResource Bool2VisibilityConverter}}"></Setter>
<Setter Property="ViewType" Value="{Binding Path=ViewType,Mode=OneWay}"></Setter>
<Setter Property="ViewType" Value="{Binding Path=ViewType,Mode=OneWay}"></Setter>
<Setter Property="ViewModelType" Value="{Binding Path=ViewModelType,Mode=OneWay}"></Setter>
<Setter Property="Template">
<Setter Property="Template">
<Setter.Value>
<Setter.Value>
<ControlTemplate TargetType="local:NavigationItemControl">
<ControlTemplate TargetType="local:NavigationItemControl">
...
...
VIZ.Framework.Common/Widgets/NavigationControl/NavigationItemControl.cs
View file @
ae58418e
...
@@ -69,25 +69,6 @@ namespace VIZ.Framework.Common
...
@@ -69,25 +69,6 @@ namespace VIZ.Framework.Common
#
endregion
#
endregion
#
region
ViewModelType
--
视图模型类型
/// <summary>
/// 视图模型类型
/// </summary>
public
Type
ViewModelType
{
get
{
return
(
Type
)
GetValue
(
ViewModelTypeProperty
);
}
set
{
SetValue
(
ViewModelTypeProperty
,
value
);
}
}
/// <summary>
/// Using a DependencyProperty as the backing store for ViewModelType. This enables animation, styling, binding, etc...
/// </summary>
public
static
readonly
DependencyProperty
ViewModelTypeProperty
=
DependencyProperty
.
Register
(
"ViewModelType"
,
typeof
(
Type
),
typeof
(
NavigationItemControl
),
new
PropertyMetadata
(
null
));
#
endregion
/// <summary>
/// <summary>
/// 可见性改变时触发
/// 可见性改变时触发
/// </summary>
/// </summary>
...
@@ -104,28 +85,12 @@ namespace VIZ.Framework.Common
...
@@ -104,28 +85,12 @@ namespace VIZ.Framework.Common
if
(
this
.
ViewType
!=
null
)
if
(
this
.
ViewType
!=
null
)
{
{
this
.
Content
=
this
.
ViewType
.
Assembly
.
CreateInstance
(
this
.
ViewType
.
FullName
);
this
.
Content
=
this
.
ViewType
.
Assembly
.
CreateInstance
(
this
.
ViewType
.
FullName
);
config
.
View
=
new
WeakReference
<
object
>(
this
.
Content
);
}
}
if
(
this
.
ViewModelType
!=
null
)
if
(
config
!=
null
)
{
{
FrameworkElement
view
=
this
.
Content
as
FrameworkElement
;
config
.
View
=
new
WeakReference
<
object
>(
this
.
Content
);
if
(
view
!=
null
)
config
.
ViewCreated
?.
Invoke
(
config
,
this
.
Content
);
{
object
obj
=
this
.
ViewModelType
.
Assembly
.
CreateInstance
(
this
.
ViewModelType
.
FullName
);
config
.
ViewModel
=
new
WeakReference
<
object
>(
obj
);
ViewModelBase
vm
=
obj
as
ViewModelBase
;
if
(
vm
==
null
)
{
view
.
DataContext
=
obj
;
}
else
{
WPFHelper
.
BindingViewModel
(
view
,
vm
);
}
}
}
}
}
}
}
}
...
...
VIZ.Framework.Core/Core/Net/NetHelper.cs
View file @
ae58418e
...
@@ -6,6 +6,7 @@ using System.Linq;
...
@@ -6,6 +6,7 @@ using System.Linq;
using
System.Management
;
using
System.Management
;
using
System.Net
;
using
System.Net
;
using
System.Net.NetworkInformation
;
using
System.Net.NetworkInformation
;
using
System.Net.Sockets
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.CompilerServices
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
...
@@ -118,5 +119,25 @@ namespace VIZ.Framework.Core
...
@@ -118,5 +119,25 @@ namespace VIZ.Framework.Core
return
0
;
return
0
;
}
}
/// <summary>
/// 获取本机第一个IPv4地址
/// </summary>
/// <returns>第一个IPv4地址</returns>
public
static
string
GetLocalFirstIPv4Address
()
{
if
(!
NetworkInterface
.
GetIsNetworkAvailable
())
{
return
string
.
Empty
;
}
IPHostEntry
host
=
Dns
.
GetHostEntry
(
Dns
.
GetHostName
());
var
ippaddress
=
host
.
AddressList
.
FirstOrDefault
(
ip
=>
ip
.
AddressFamily
==
AddressFamily
.
InterNetwork
);
return
ippaddress
.
ToString
();
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment