forked from stricq/UPKManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added PDF Document for UPK format.
- Loading branch information
Showing
14 changed files
with
302 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.ComponentModel.Composition; | ||
|
||
using STR.Common.Messages; | ||
using STR.MvvmCommon.Contracts; | ||
|
||
|
||
namespace UpkManager.Domain.Controllers { | ||
|
||
[Export(typeof(IController))] | ||
public class FileTreeController : IController { | ||
|
||
#region Private Fields | ||
|
||
private readonly IMessenger messenger; | ||
|
||
#endregion Private Fields | ||
|
||
#region Constructor | ||
|
||
[ImportingConstructor] | ||
public FileTreeController(IMessenger Messenger) { | ||
messenger = Messenger; | ||
|
||
registerMessages(); | ||
} | ||
|
||
#endregion Constructor | ||
|
||
#region Messages | ||
|
||
private void registerMessages() { | ||
messenger.Register<ApplicationLoadedMessage>(this, onApplicationLoaded); | ||
} | ||
|
||
private void onApplicationLoaded(ApplicationLoadedMessage message) { | ||
|
||
} | ||
|
||
#endregion Messages | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections.ObjectModel; | ||
using System.ComponentModel.Composition; | ||
|
||
using STR.MvvmCommon; | ||
|
||
|
||
namespace UpkManager.Domain.ViewModels { | ||
|
||
[Export] | ||
[ViewModel("FileTreeViewModel")] | ||
public class FileTreeViewModel : ObservableObject { | ||
|
||
#region Private Fields | ||
|
||
private ObservableCollection<UpkFileInfo> files; | ||
|
||
#endregion Private Fields | ||
|
||
#region Properties | ||
|
||
public ObservableCollection<UpkFileInfo> Files { | ||
get { return files; } | ||
set { SetField(ref files, value, () => Files); } | ||
} | ||
|
||
#endregion Properties | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System.Collections.ObjectModel; | ||
using System.ComponentModel.Composition; | ||
|
||
using STR.Common.Contracts; | ||
using STR.MvvmCommon; | ||
|
||
|
||
namespace UpkManager.Domain.ViewModels { | ||
|
||
[Export] | ||
[PartCreationPolicy(CreationPolicy.NonShared)] | ||
public class UpkFileInfo : ObservableObject, ITraversable<UpkFileInfo> { | ||
|
||
#region Private Fields | ||
|
||
private bool isChecked; | ||
|
||
private int fileSize; | ||
|
||
private string filename; | ||
private string hasTextures; | ||
|
||
private ObservableCollection<UpkFileInfo> children; | ||
|
||
#endregion Private Fields | ||
|
||
#region Properties | ||
|
||
public bool IsChecked { | ||
get { return isChecked; } | ||
set { SetField(ref isChecked, value, () => IsChecked); } | ||
} | ||
|
||
public int FileSize { | ||
get { return fileSize; } | ||
set { SetField(ref fileSize, value, () => FileSize); } | ||
} | ||
|
||
public string Filename { | ||
get { return filename; } | ||
set { SetField(ref filename, value, () => Filename); } | ||
} | ||
|
||
public string HasTextures { | ||
get { return hasTextures; } | ||
set { SetField(ref hasTextures, value, () => HasTextures); } | ||
} | ||
|
||
public ObservableCollection<UpkFileInfo> Children { | ||
get { return children; } | ||
set { SetField(ref children, value, () => Children); } | ||
} | ||
|
||
#endregion Properties | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:tv="http://schemas.stricq.com/treelistview/"> | ||
|
||
<Style x:Key="TreeListViewItemStyle" TargetType="{x:Type TreeViewItem}"> | ||
<Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" /> | ||
<Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type TreeViewItem}"> | ||
<StackPanel> | ||
<Border Name="Border" CornerRadius="3" Background="{StaticResource ListItemTransparent}"> | ||
<GridViewRowPresenter Name="Presenter" Content="{TemplateBinding Header}" Columns="{Binding Columns, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=tv:TreeListView}}" TextBlock.FontWeight="Bold" /> | ||
</Border> | ||
|
||
<ItemsPresenter Name="ItemsPresenter" Visibility="Collapsed" /> | ||
</StackPanel> | ||
|
||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsExpanded" Value="True"> | ||
<Setter TargetName="ItemsPresenter" Property="Visibility" Value="Visible" /> | ||
</Trigger> | ||
|
||
<DataTrigger Binding="{Binding Path=UnreadItems}" Value="0"> | ||
<Setter TargetName="Presenter" Property="TextBlock.FontWeight" Value="Normal" /> | ||
</DataTrigger> | ||
|
||
<DataTrigger Binding="{Binding Path=IsContextMenuOpen}" Value="True"> | ||
<Setter TargetName="Border" Property="Background" Value="LightGreen" /> | ||
<Setter Property="Foreground" Value="Black" /> | ||
</DataTrigger> | ||
|
||
<Trigger Property="IsSelected" Value="True"> | ||
<Setter TargetName="Border" Property="Background" Value="{StaticResource ListItemSelectedColor}" /> | ||
<Setter Property="Foreground" Value="{StaticResource ListItemSelectedForeColor}" /> | ||
</Trigger> | ||
|
||
<DataTrigger Binding="{Binding Path=IsInError}" Value="True"> | ||
<Setter TargetName="Border" Property="Background" Value="{StaticResource ListItemErrorColor}" /> | ||
<Setter Property="Foreground" Value="{StaticResource ListItemErrorForeColor}" /> | ||
</DataTrigger> | ||
|
||
<MultiDataTrigger> | ||
<MultiDataTrigger.Conditions> | ||
<Condition Binding="{Binding Path=IsSelected}" Value="True" /> | ||
<Condition Binding="{Binding Path=IsInError}" Value="True" /> | ||
</MultiDataTrigger.Conditions> | ||
<Setter TargetName="Border" Property="Background" Value="{StaticResource ListItemSelectedErrorColor}" /> | ||
<Setter Property="Foreground" Value="{StaticResource ListItemSelectedErrorForeColor}" /> | ||
</MultiDataTrigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<UserControl x:Class="UpkManager.Wpf.Views.FileTreeView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:tv="http://schemas.stricq.com/treelistview/" | ||
xmlns:mvvm="http://schemas.stricq.com/mvvmcommon/" | ||
mvvm:ViewModelLocator.ComposedViewModel="FileTreeViewModel" | ||
mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="300"> | ||
|
||
<Grid Margin="-2"> | ||
|
||
<tv:TreeListView ItemsSource="{Binding Path=Files}" BorderThickness="0" BorderBrush="{StaticResource ContentControlBorderColor}" Background="{StaticResource BackgroundColor}" FontFamily="Tahoma" FontSize="12"> | ||
<tv:TreeListView.Resources> | ||
<Style TargetType="TreeViewItem" BasedOn="{StaticResource TreeListViewItemStyle}" /> | ||
</tv:TreeListView.Resources> | ||
|
||
<tv:TreeListView.ItemTemplate> | ||
<HierarchicalDataTemplate ItemsSource="{Binding Path=Children}" /> | ||
</tv:TreeListView.ItemTemplate> | ||
|
||
<tv:TreeListView.Columns> | ||
|
||
<GridViewColumn Header="File Name"> | ||
<GridViewColumn.CellTemplate> | ||
<DataTemplate> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<tv:TreeListViewExpander Grid.Column="0" Focusable="False" /> | ||
|
||
<CheckBox Grid.Column="1" Content="{x:Null}" IsChecked="{Binding Path=IsChecked}" Focusable="False" /> | ||
<TextBlock Grid.Column="2" Text="{Binding Path=Filename}" HorizontalAlignment="Left" VerticalAlignment="Center" /> | ||
|
||
</Grid> | ||
</DataTemplate> | ||
</GridViewColumn.CellTemplate> | ||
</GridViewColumn> | ||
|
||
<GridViewColumn Header="Textures"> | ||
<GridViewColumn.CellTemplate> | ||
<DataTemplate> | ||
<TextBlock Text="{Binding Path=HasTextures}" HorizontalAlignment="Center" VerticalAlignment="Center" /> | ||
</DataTemplate> | ||
</GridViewColumn.CellTemplate> | ||
</GridViewColumn> | ||
|
||
<GridViewColumn Header="File Size"> | ||
<GridViewColumn.CellTemplate> | ||
<DataTemplate> | ||
<TextBlock Text="{Binding Path=FileSize, StringFormat={}{0:N0}}" HorizontalAlignment="Right" VerticalAlignment="Center" /> | ||
</DataTemplate> | ||
</GridViewColumn.CellTemplate> | ||
</GridViewColumn> | ||
|
||
</tv:TreeListView.Columns> | ||
|
||
</tv:TreeListView> | ||
|
||
</Grid> | ||
|
||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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 UpkManager.Wpf.Views { | ||
/// <summary> | ||
/// Interaction logic for FileTreeView.xaml | ||
/// </summary> | ||
public partial class FileTreeView : UserControl { | ||
public FileTreeView() { | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters