Changeset 11926
- Timestamp:
- Aug 9, 2011, 6:08:04 PM (13 years ago)
- Location:
- extensions/PiwigoLib/PiwigoWpf
- Files:
-
- 20 added
- 4 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoWpf/DTO/PwgCategoryWPF.cs
r7150 r11926 75 75 PropertyChanged(this, new PropertyChangedEventArgs(info)); 76 76 } 77 78 #region Presentation Members 79 80 #region IsExpanded 81 82 /// <summary> 83 /// Gets/sets whether the TreeViewItem 84 /// associated with this object is expanded. 85 /// </summary> 86 private bool _isExpanded = false; 87 public bool IsExpanded 88 { 89 get { return _isExpanded; } 90 set 91 { 92 if (value != _isExpanded) 93 { 94 _isExpanded = value; 95 this.OnPropertyChanged("IsExpanded"); 96 } 97 98 // Expand all the way up to the root. 99 if (_isExpanded && _parent != null) 100 _parent.IsExpanded = true; 101 } 102 } 103 104 #endregion // IsExpanded 105 106 #region IsSelected 107 108 /// <summary> 109 /// Gets/sets whether the TreeViewItem 110 /// associated with this object is selected. 111 /// </summary> 112 private bool _isSelected = false; 113 public bool IsSelected 114 { 115 get { return _isSelected; } 116 set 117 { 118 if (value != _isSelected) 119 { 120 _isSelected = value; 121 this.OnPropertyChanged("IsSelected"); 122 } 123 } 124 } 125 126 #endregion // IsSelected 127 128 #region Parent 129 private PwgCategoryWPF _parent = null; 130 public PwgCategoryWPF Parent 131 { 132 get { return _parent; } 133 } 134 135 #endregion // Parent 136 137 #endregion // Presentation Members 77 138 } 78 139 } -
extensions/PiwigoLib/PiwigoWpf/DTO/PwgImageWPF.cs
r11922 r11926 12 12 public class PwgImageWPF : INotifyPropertyChanged 13 13 { 14 private String _imgSourceThumb; 15 public String ImgSourceThumb 16 { 17 set { _imgSourceThumb = value; OnPropertyChanged("ImgSourceThumb"); } 18 get 19 { 20 if (_imgSourceThumb == null) 21 { 22 _imgSourceThumb = Com.Piwigo.Wpf.Service.ImageCacheManager.Instance.GetImageFilename(this, "Thumb"); 23 } 24 return _imgSourceThumb; 25 } 26 } 27 14 28 private String _imgSource; 15 29 public String ImgSource … … 20 34 if (_imgSource == null) 21 35 { 22 _imgSource = Com.Piwigo.Wpf.Service.ImageCacheManager.Instance.GetImageFilename(this );36 _imgSource = Com.Piwigo.Wpf.Service.ImageCacheManager.Instance.GetImageFilename(this, "LowRes"); 23 37 } 24 38 return _imgSource; 25 39 } 26 40 } 27 41 42 private bool isSelected = false; 43 public bool IsSelected 44 { 45 get { return isSelected; } 46 set { isSelected = value; OnPropertyChanged("IsSelected"); } 47 } 48 49 28 50 29 51 private Int32 _id; -
extensions/PiwigoLib/PiwigoWpf/DTO/PwgModelManager.cs
r11922 r11926 25 25 } 26 26 27 public class PwgModelManagerBase 27 public class PwgModelManagerBase : INotifyPropertyChanged 28 28 { 29 29 private AsyncObservableCollection<String> _lstMsgInfo = new AsyncObservableCollection<String>(); … … 62 62 } 63 63 64 private PwgImageWPF _imageShown; 65 public PwgImageWPF ImageShown 66 { 67 get { return _imageShown; } 68 set { _imageShown = value; OnPropertyChanged("ImageShown"); } 69 } 70 64 71 public event PropertyChangedEventHandler PropertyChanged; 65 72 internal void OnPropertyChanged(String info) … … 69 76 } 70 77 } 71 72 73 78 } 74 79 } -
extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml
r11922 r11926 14 14 <pwghlp:AdvBooltoVisibilityConverter x:Key="AdvBooltoVisibilityConverter" Collapse="False" Reverse="False" /> 15 15 <pwghlp:AdvBooltoVisibilityConverter x:Key="AdvBooltoVisibilityConverterReversal" Collapse="False" Reverse="True" /> 16 <!-- DATA TEMPLATES -->17 18 <DataTemplate DataType="{x:Type pwgdto:PwgImageWPF}">19 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue"20 DataContext="{Binding}"><!--Source="{Binding UrlElement}"-->21 <Image ToolTip="{Binding File}" >22 <Image.Source>23 <Binding Path="ImgSource" /> <!--Converter="{x:Static pwgsrv:ImageCacheManager.ImageUrlCachedConverter}"-->24 </Image.Source>25 </Image>26 </Border>27 </DataTemplate>28 29 <DataTemplate DataType="{x:Type pwgdto:PwgCategoryWPF}" >30 <Border VerticalAlignment="Center" HorizontalAlignment="Center"31 Padding="4" Margin="1"32 Background="LightBlue"33 DataContext="{Binding}">34 <StackPanel Orientation="Vertical" DataContext="{Binding}" VerticalAlignment="Center" >35 <Image Source="pack://application:,,,/Pictures/folder_images.png"36 Stretch="Uniform"37 MaxHeight="128"38 MaxWidth="128">39 <Image.ToolTip>40 <StackPanel Orientation="Vertical">41 <StackPanel Orientation="Horizontal">42 <TextBlock Text="{Binding Path=ImagesCount}"/>43 <TextBlock Text=" images inside"/>44 </StackPanel>45 <StackPanel Orientation="Horizontal">46 <TextBlock Text="{Binding Path=SubCategoriesCount}"/>47 <TextBlock Text=" categories inside"/>48 </StackPanel>49 </StackPanel>50 </Image.ToolTip>51 </Image>52 <TextBlock Text="{Binding Name}" />53 </StackPanel>54 </Border>55 </DataTemplate>56 57 <Style x:Key="CategoryListStyle" TargetType="{x:Type ListBox}">58 <Setter Property="Template">59 <Setter.Value>60 <ControlTemplate TargetType="{x:Type ListBox}" >61 <Border62 BorderBrush="Gray"63 BorderThickness="1"64 CornerRadius="6"65 Background="LightBlue"66 >67 <!--Background="{DynamicResource ListBoxGradient}"-->68 <ScrollViewer69 VerticalScrollBarVisibility="Auto"70 HorizontalScrollBarVisibility="Disabled">71 <StackPanel72 IsItemsHost="True"73 Orientation="Vertical"74 HorizontalAlignment="Center"75 VerticalAlignment="Top"/>76 </ScrollViewer>77 </Border>78 </ControlTemplate>79 </Setter.Value>80 </Setter>81 </Style>82 83 <Style x:Key="CategoryListItem" TargetType="{x:Type ListBoxItem}">84 <Setter Property="MaxHeight" Value="128" />85 <Setter Property="MinHeight" Value="128" />86 <Setter Property="Opacity" Value=".75" />87 <Style.Triggers>88 <EventTrigger RoutedEvent="Mouse.MouseEnter">89 <EventTrigger.Actions>90 <BeginStoryboard>91 <Storyboard>92 <DoubleAnimation93 Duration="0:0:0.2"94 Storyboard.TargetProperty="MaxHeight"95 To="220" />96 <DoubleAnimation97 Duration="0:0:0.2"98 Storyboard.TargetProperty="Opacity"99 To="1.0" />100 </Storyboard>101 </BeginStoryboard>102 </EventTrigger.Actions>103 </EventTrigger>104 105 <EventTrigger RoutedEvent="Mouse.MouseLeave">106 <EventTrigger.Actions>107 <BeginStoryboard>108 <Storyboard>109 <DoubleAnimation110 Duration="0:0:1"111 Storyboard.TargetProperty="MaxHeight" />112 <DoubleAnimation113 Duration="0:0:0.2"114 Storyboard.TargetProperty="Opacity" />115 </Storyboard>116 </BeginStoryboard>117 </EventTrigger.Actions>118 </EventTrigger>119 </Style.Triggers>120 </Style>121 <!-- PHOTOLIST TEMPLATE -->122 123 <Style x:Key="PhotoListStyle" TargetType="{x:Type ListBox}">124 <Setter Property="Template">125 <Setter.Value>126 <ControlTemplate TargetType="{x:Type ListBox}" >127 <Border128 BorderBrush="Gray"129 BorderThickness="1"130 CornerRadius="6"131 Background="LightBlue"132 >133 <!--Background="{DynamicResource ListBoxGradient}"-->134 <ScrollViewer135 VerticalScrollBarVisibility="Disabled"136 HorizontalScrollBarVisibility="Auto">137 <StackPanel138 IsItemsHost="True"139 Orientation="Horizontal"140 HorizontalAlignment="Left" />141 </ScrollViewer>142 </Border>143 </ControlTemplate>144 </Setter.Value>145 </Setter>146 </Style>147 148 <!-- PHOTOLIST STORYBOARDS -->149 150 <Style x:Key="PhotoListItem" TargetType="{x:Type ListBoxItem}">151 <Setter Property="MaxHeight" Value="75" />152 <Setter Property="MinHeight" Value="75" />153 <Setter Property="Opacity" Value=".75" />154 <Style.Triggers>155 <EventTrigger RoutedEvent="Mouse.MouseEnter">156 <EventTrigger.Actions>157 <BeginStoryboard>158 <Storyboard>159 <DoubleAnimation160 Duration="0:0:0.2"161 Storyboard.TargetProperty="MaxHeight"162 To="85" />163 <DoubleAnimation164 Duration="0:0:0.2"165 Storyboard.TargetProperty="Opacity"166 To="1.0" />167 </Storyboard>168 </BeginStoryboard>169 </EventTrigger.Actions>170 </EventTrigger>171 172 <EventTrigger RoutedEvent="Mouse.MouseLeave">173 <EventTrigger.Actions>174 <BeginStoryboard>175 <Storyboard>176 <DoubleAnimation177 Duration="0:0:1"178 Storyboard.TargetProperty="MaxHeight" />179 <DoubleAnimation180 Duration="0:0:0.2"181 Storyboard.TargetProperty="Opacity" />182 </Storyboard>183 </BeginStoryboard>184 </EventTrigger.Actions>185 </EventTrigger>186 </Style.Triggers>187 </Style>188 189 <!--<Style TargetType="{x:Type pwg:MainWindow}">190 <Setter Property="Background" Value="{DynamicResource WindowGradient}" />191 </Style>-->192 193 16 </Window.Resources> 194 <DockPanel Name="mainDockPanel" Margin="5"> 195 <StackPanel Name="headerStackPanel" DockPanel.Dock="Top" Orientation="Vertical"> 17 <Grid> 18 <Grid.ColumnDefinitions > 19 <ColumnDefinition Width="*"/> 20 <ColumnDefinition Width="Auto"/> 21 <ColumnDefinition Width="*" MinWidth="600"/> 22 </Grid.ColumnDefinitions> 23 <Grid.RowDefinitions> 24 <RowDefinition Height="Auto" /> 25 <RowDefinition Height="*" /> 26 <RowDefinition Height="Auto" /> 27 <RowDefinition Height="*" /> 28 <RowDefinition Height="Auto" /> 29 </Grid.RowDefinitions> 30 <StackPanel Name="headerStackPanel" 31 Grid.Column="0" 32 Grid.ColumnSpan="3" 33 Grid.Row="0" 34 Orientation="Vertical"> 196 35 <StackPanel Name="headerStackPanelLogo" Orientation="Horizontal" > 197 <Image Name="ImgPiwigoLogo" MinHeight="50" MinWidth="50" 36 <Image Name="ImgPiwigoLogo" MinHeight="50" MinWidth="50" Margin="5" 198 37 Source="pack://application:,,,/Pictures/PiwigoLogo.png" 199 38 ToolTip="www.piwigo.org" Stretch="None" HorizontalAlignment="Left" /> 200 <Image Name="ImgGlobe" 201 Visibility="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=booCmdRunning, Converter={StaticResource AdvBooltoVisibilityConverter Reversal}}"202 Source="pack://application:,,,/Pictures/ Globe.png"39 <Image Name="ImgGlobe" Margin="2" 40 Visibility="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=booCmdRunning, Converter={StaticResource AdvBooltoVisibilityConverter}}" 41 Source="pack://application:,,,/Pictures/128x128/Globe.png" 203 42 ToolTip="www.piwigo.org" Stretch="None" HorizontalAlignment="Right"/> 43 <UniformGrid Name="SessInfo" Margin="10" DataContext="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=Session}" Columns="2" Rows="5"> 44 <Label Content="Status"/> 45 <Label Content="{Binding Path=Status}"/> 46 <Label Content="Template"/> 47 <Label Content="{Binding Path=Template}"/> 48 <Label Content="Theme"/> 49 <Label Content="{Binding Path=Theme}"/> 50 <Label Content="Language"/> 51 <Label Content="{Binding Path=Language}"/> 52 <Label Content="CharSet"/> 53 <Label Content="{Binding Path=CharSet}"/> 54 </UniformGrid> 204 55 </StackPanel> 205 56 <StackPanel Name="connectStackPanel" Orientation="Horizontal" VerticalAlignment="Center" Margin="5" … … 213 64 <TextBox Height="23" Name="TbUrl" Width="300" Text="{Binding Path=ServeurName, Mode=TwoWay}"/> 214 65 <CheckBox Margin="2" VerticalAlignment="Center" IsChecked="{Binding Path=SaveSetting, Mode=TwoWay}">Save settings</CheckBox> 215 <Button Margin="2" Command="{x:Static pwgcmd:PwgCmdProvider.PwgCmdConnect}" Visibility="{Binding Path=IsConnected, Converter={StaticResource AdvBooltoVisibilityConverterReversal}}">Con ect</Button>216 <Button Margin="2" Command="{x:Static pwgcmd:PwgCmdProvider.PwgCmdDisconnect}" Visibility="{Binding Path=IsConnected, Converter={StaticResource AdvBooltoVisibilityConverter}}">Discon ect</Button>66 <Button Margin="2" Command="{x:Static pwgcmd:PwgCmdProvider.PwgCmdConnect}" Visibility="{Binding Path=IsConnected, Converter={StaticResource AdvBooltoVisibilityConverterReversal}}">Connect</Button> 67 <Button Margin="2" Command="{x:Static pwgcmd:PwgCmdProvider.PwgCmdDisconnect}" Visibility="{Binding Path=IsConnected, Converter={StaticResource AdvBooltoVisibilityConverter}}">Disconnect</Button> 217 68 </StackPanel> 218 69 </StackPanel> 219 <ListView Name="listViewLogUiInfo" DockPanel.Dock="Bottom" 220 DataContext="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=lstMsgInfo}" 221 ItemsSource="{Binding }" /> 70 <TreeView Name="listViewCategory" 71 Grid.Column="0" 72 Grid.Row="1" 73 Grid.RowSpan="3" 74 MinWidth="100" 75 DataContext="{Binding Source={StaticResource Categories}}" 76 ItemsSource="{Binding }" MouseDoubleClick="listViewCategory_MouseDoubleClick"> 77 <TreeView.ItemContainerStyle> 78 <!-- 79 This Style binds a TreeViewItem to a TreeViewItemViewModel. 80 --> 81 <Style TargetType="{x:Type TreeViewItem}"> 82 <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> 83 <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> 84 <Setter Property="FontWeight" Value="Normal" /> 85 <Setter Property="Opacity" Value=".75" /> 86 <Style.Triggers> 87 <EventTrigger RoutedEvent="Mouse.MouseEnter"> 88 <EventTrigger.Actions> 89 <BeginStoryboard> 90 <Storyboard> 91 <DoubleAnimation 92 Duration="0:0:0.2" 93 Storyboard.TargetProperty="Opacity" 94 To="1.0" /> 95 </Storyboard> 96 </BeginStoryboard> 97 </EventTrigger.Actions> 98 </EventTrigger> 99 <EventTrigger RoutedEvent="Mouse.MouseLeave"> 100 <EventTrigger.Actions> 101 <BeginStoryboard> 102 <Storyboard> 103 <DoubleAnimation 104 Duration="0:0:0.2" 105 Storyboard.TargetProperty="Opacity" /> 106 </Storyboard> 107 </BeginStoryboard> 108 </EventTrigger.Actions> 109 </EventTrigger> 110 <Trigger Property="IsSelected" Value="True"> 111 <Setter Property="FontWeight" Value="Bold" /> 112 </Trigger> 113 </Style.Triggers> 114 </Style> 115 </TreeView.ItemContainerStyle> 116 <TreeView.Resources> 117 <HierarchicalDataTemplate 118 DataType="{x:Type pwgdto:PwgCategoryWPF}" 119 ItemsSource="{Binding Children}" 120 > 121 <StackPanel Orientation="Horizontal" DataContext="{Binding}" 122 VerticalAlignment="Center" HorizontalAlignment="Center"> 123 <Image Source="pack://application:,,,/Pictures/22x22/folder_images.png" Margin="5" 124 Stretch="None"> 125 <Image.ToolTip> 126 <StackPanel Orientation="Vertical"> 127 <StackPanel Orientation="Horizontal"> 128 <TextBlock Text="{Binding Path=ImagesCount}"/> 129 <TextBlock Text=" images inside"/> 130 </StackPanel> 131 <StackPanel Orientation="Horizontal"> 132 <TextBlock Text="{Binding Path=SubCategoriesCount}"/> 133 <TextBlock Text=" categories inside"/> 134 </StackPanel> 135 </StackPanel> 136 </Image.ToolTip> 137 </Image> 138 <TextBlock Text="{Binding Name}" /> 139 </StackPanel> 140 </HierarchicalDataTemplate> 141 </TreeView.Resources> 142 </TreeView> 143 <GridSplitter ResizeDirection="Columns" 144 Grid.Column="1" 145 Grid.Row="1" 146 Grid.RowSpan="3" 147 Width="10" Background="Azure" ShowsPreview="True" ResizeBehavior="PreviousAndNext"></GridSplitter> 148 <ListView Name="listViewImage" 149 Grid.Column="3" 150 Grid.Row="1" 151 MinWidth="500" 152 DataContext="{Binding Source={StaticResource Images}}" 153 ItemsSource="{Binding }" SelectionMode="Single" IsSynchronizedWithCurrentItem="True" SelectionChanged="listViewImage_SelectionChanged"> 154 <ListView.ItemsPanel> 155 <ItemsPanelTemplate> 156 <UniformGrid/> 157 </ItemsPanelTemplate> 158 </ListView.ItemsPanel> 159 <ListView.ItemContainerStyle> 160 <Style TargetType="{x:Type ListViewItem}"> 161 <Setter Property="FontWeight" Value="Normal" /> 162 <Setter Property="MaxHeight" Value="75" /> 163 <Setter Property="MinHeight" Value="75" /> 164 <Setter Property="Opacity" Value=".75" /> 165 <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> 166 <Style.Triggers> 167 <EventTrigger RoutedEvent="Mouse.MouseEnter"> 168 <EventTrigger.Actions> 169 <BeginStoryboard> 170 <Storyboard> 171 <DoubleAnimation 172 Duration="0:0:0.2" 173 Storyboard.TargetProperty="Opacity" 174 To="1.0" /> 175 </Storyboard> 176 </BeginStoryboard> 177 </EventTrigger.Actions> 178 </EventTrigger> 179 <EventTrigger RoutedEvent="Mouse.MouseLeave"> 180 <EventTrigger.Actions> 181 <BeginStoryboard> 182 <Storyboard> 183 <DoubleAnimation 184 Duration="0:0:0.2" 185 Storyboard.TargetProperty="Opacity" /> 186 </Storyboard> 187 </BeginStoryboard> 188 </EventTrigger.Actions> 189 </EventTrigger> 190 <Trigger Property="IsSelected" Value="True"> 191 <Setter Property="FontWeight" Value="Bold" /> 192 </Trigger> 193 </Style.Triggers> 194 </Style> 195 </ListView.ItemContainerStyle> 196 <ListView.Resources> 197 <DataTemplate DataType="{x:Type pwgdto:PwgImageWPF}"> 198 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue" 199 DataContext="{Binding}"> 200 <!--Source="{Binding UrlElement}"--> 201 <Image ToolTip="{Binding File}" > 202 <Image.Source> 203 <Binding Path="ImgSourceThumb" /> 204 <!--Converter="{x:Static pwgsrv:ImageCacheManager.ImageUrlCachedConverter}"--> 205 </Image.Source> 206 </Image> 207 </Border> 208 </DataTemplate> 209 </ListView.Resources> 210 </ListView> 211 <GridSplitter ResizeDirection="Rows" 212 Grid.Column="3" 213 Grid.Row="2" 214 Height="3" Background="Azure" ShowsPreview="True" ResizeBehavior="PreviousAndNext"></GridSplitter> 215 <StackPanel Grid.Column="3" 216 Grid.Row="3" 217 MinHeight="150" MinWidth="200" DataContext="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=ImageShown}"> 218 <Image ToolTip="{Binding Path=File}" > 219 <Image.Source> 220 <Binding Path="ImgSource" /> 221 </Image.Source> 222 </Image> 223 </StackPanel> 224 <Expander 225 Grid.Column="0" 226 Grid.ColumnSpan="3" 227 Grid.Row="4" > 228 <Expander.Header> 229 <Button Height="18" Name="btnDeleteLog" Width="18" 230 ToolTip="Delete activity trace" 231 Command="{x:Static pwgcmd:PwgCmdDeleteTrace.Command}"> 232 <Button.Content> 233 <Image Source="/PiwigoWpf;component/Pictures/16x16/14_layer_deletelayer.png" Stretch="None" /> 234 </Button.Content> 235 </Button> 236 </Expander.Header> 237 <ListView Name="listViewLogUiInfo" 238 DataContext="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=lstMsgInfo}" 239 ItemsSource="{Binding }" /> 240 </Expander> 241 </Grid> 222 242 223 <ListView Name="listViewCategory" DockPanel.Dock="Left" MinWidth="100"224 Style="{DynamicResource CategoryListStyle}"225 ItemContainerStyle="{DynamicResource CategoryListItem}"226 DataContext="{Binding Source={StaticResource Categories}}"227 ItemsSource="{Binding }" MouseDoubleClick="listViewCategory_MouseDoubleClick" />228 229 <ListView Name="listViewImage" DockPanel.Dock="Right" MinWidth="500"230 Style="{DynamicResource PhotoListStyle}"231 ItemContainerStyle="{DynamicResource PhotoListItem}"232 DataContext="{Binding Source={StaticResource Images}}"233 ItemsSource="{Binding }" />234 </DockPanel>235 236 243 </Window> -
extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml.cs
r11922 r11926 28 28 PwgCmdEvents.CmdSendUiInfo += new PwgCmdEvents.CmdSendUiInfoHandler(PwgCmdEventsConsumer.PwgCmdEvents_CmdSendUiInfo); 29 29 } 30 30 31 31 private void listViewCategory_MouseDoubleClick(object sender, MouseButtonEventArgs e) 32 32 { 33 33 AppHelper.ExecuteCommand<PwgCmdGetImageforCategory>(listViewCategory.SelectedValue); 34 34 } 35 36 private void listViewImage_SelectionChanged(object sender, SelectionChangedEventArgs e) 37 { 38 if (PwgCmdSelectImageInCategory.Command.CanExecute(sender)) 39 { 40 PwgCmdSelectImageInCategory.Command.Execute(sender); 41 } 42 } 43 44 35 45 } 36 46 } -
extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj
r11922 r11926 77 77 <SubType>Designer</SubType> 78 78 </ApplicationDefinition> 79 <Compile Include="Command\PwgCmdSelectImageInCategory.cs" /> 80 <Compile Include="Command\DelegateCommand.cs" /> 81 <Compile Include="Command\PwgCmdDeleteTrace.cs" /> 79 82 <Compile Include="Command\PwgCmdDisconnect.cs" /> 80 83 <Compile Include="Command\PwgCmdEventsConsumer.cs" /> … … 184 187 </ItemGroup> 185 188 <ItemGroup> 186 <Resource Include="Pictures\Globe.png" /> 187 </ItemGroup> 188 <ItemGroup> 189 <Resource Include="Pictures\folder_images.png" /> 189 <Resource Include="Pictures\128x128\folder_images.png" /> 190 <Resource Include="Pictures\128x128\Globe.png" /> 191 <Resource Include="Pictures\128x128\load.gif" /> 192 <Resource Include="Pictures\16x16\14_layer_deletelayer.png" /> 193 <Resource Include="Pictures\16x16\14_layer_lowerlayer.png" /> 194 <Resource Include="Pictures\64x64\folder_images.png" /> 195 <Resource Include="Pictures\64x64\html.png" /> 196 <Resource Include="Pictures\64x64\images.png" /> 197 <Resource Include="Pictures\64x64\load.gif" /> 198 </ItemGroup> 199 <ItemGroup> 200 <Resource Include="Pictures\22x22\folder_html.png" /> 201 <Resource Include="Pictures\22x22\folder_images.png" /> 190 202 </ItemGroup> 191 203 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
extensions/PiwigoLib/PiwigoWpf/Services/ImageCacheManager.cs
r11922 r11926 27 27 public static String GetDefaultImage() 28 28 { 29 return ("pack://application:,,,/Pictures/Globe.png"); 29 return ("pack://application:,,,/Pictures/64x64/images.png"); 30 } 31 32 public static String GetLoadImage() 33 { 34 return ("pack://application:,,,/Pictures/64x64/html.png"); 30 35 } 31 36 … … 213 218 } 214 219 215 public String GetImageFilename(PwgImageWPF aImageWPF )216 { 217 String retImgSrc = String.Empty;220 public String GetImageFilename(PwgImageWPF aImageWPF, String strImageType) 221 { 222 String retImgSrc = GetDefaultImage(); 218 223 if (aImageWPF == null) 219 224 { … … 223 228 if (_currentCategory != null) 224 229 { 225 String localFile = Path.Combine(_currentCategory.BasePath.FullName, String.Format("{0}-{1}", aImageWPF.Id, aImageWPF.File)); 230 String localDir = Path.Combine(_currentCategory.BasePath.FullName, strImageType); 231 if (!Directory.Exists(localDir)) 232 { 233 Directory.CreateDirectory(localDir); 234 } 235 236 String localFile = Path.Combine(localDir, String.Format("{0}-{1}", aImageWPF.Id, aImageWPF.File)); 226 237 227 238 if (!File.Exists(localFile)) 228 239 { 229 retImgSrc = Get DefaultImage();240 retImgSrc = GetLoadImage(); 230 241 231 242 ThreadPool.QueueUserWorkItem((WaitCallback)delegate … … 246 257 image.Save(localFile); 247 258 248 aImageWPF.ImgSource = localFile; 259 switch (strImageType) 260 { 261 case "Thumb" : 262 aImageWPF.ImgSourceThumb = localFile; 263 break; 264 case "LowRes": 265 aImageWPF.ImgSource = localFile; 266 break; 267 } 268 249 269 }); 250 270 }
Note: See TracChangeset
for help on using the changeset viewer.