Changeset 12015 for extensions/PiwigoLib
- Timestamp:
- Aug 30, 2011, 5:24:52 PM (13 years ago)
- Location:
- extensions/PiwigoLib
- Files:
-
- 5 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoLib/Proxy/PwgGenericProxy.cs
r11872 r12015 98 98 { 99 99 T ReturnValue = default(T); 100 //System.Net.ServicePointManager.Expect100Continue = false; 100 101 101 102 HttpWebRequest Request; -
extensions/PiwigoLib/PiwigoLib/Service/PwgSetupService.cs
r7160 r12015 27 27 if (PwgUserAgent != null) 28 28 { 29 29 PwgConfigProxy.PwgUserAgent = PwgUserAgent; 30 30 } 31 31 -
extensions/PiwigoLib/PiwigoWpf/App.xaml
r11935 r12015 9 9 <ObjectDataProvider x:Name="SessionODP" x:Key="Session" ObjectType="{x:Type piwigo:PwgSessionWPF}" /> 10 10 <ObjectDataProvider x:Name="CategoriesODP" x:Key="Categories" ObjectType="{x:Type piwigo:PwgRootCategoryListWPF}"/> <!--IsAsynchronous="True"--> 11 <ObjectDataProvider x:Name="TagsODP" x:Key="Tags" ObjectType="{x:Type piwigo:PwgTagListWPF}"/> 12 <!--IsAsynchronous="True"--> 11 13 <!--IsAsynchronous="True"--> 12 14 <ResourceDictionary x:Key="VisualStyleApp" Source="VisualStyleApp.xaml"/> -
extensions/PiwigoLib/PiwigoWpf/App.xaml.cs
r11935 r12015 24 24 PwgModelManager.Instance.CategoryList = (PwgRootCategoryListWPF)(this.Resources["Categories"] as ObjectDataProvider).Data; 25 25 PwgModelManager.Instance.ImageList = (PwgImageListWPF)(this.Resources["Images"] as ObjectDataProvider).Data; 26 //PwgCategoryListWPFHelper.InitRootCategory();26 PwgModelManager.Instance.TagsList = (PwgTagListWPF)(this.Resources["Tags"] as ObjectDataProvider).Data; 27 27 28 28 PwgModelManager.Instance.Session.ServeurName = global::Com.Piwigo.Wpf.Properties.Settings.Default.ServerNameData; -
extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs
r11935 r12015 46 46 SendUiInfo("Setting up cache data ..."); 47 47 ImageCacheManager.Instance.SetCurrentServer(uriServer.AbsoluteUri); 48 49 48 49 SendUiInfo("Retriving list of Tags from server..."); 50 List<PwgTag> lstTag = PwgServiceProvider.Instance.PwgTagsService.GetListOfTag(true); 51 PwgTagListWPF aTagListWPF = PwgModelManager.Instance.TagsList; 52 PwgTagListWPFHelper.ConvertPwgTagListToPwgTagListWPF(lstTag, ref aTagListWPF); 50 53 } 51 54 catch (PwgServiceException ex) -
extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdProvider.cs
r11935 r12015 26 26 case "PwgCmdGetSubCategorieforCategory": 27 27 objICom = PwgCmdGetSubCategorieforCategory; 28 break; 29 case "PwgCmdGetImageforTag": 30 objICom = PwgCmdGetImageforTag; 28 31 break; 29 32 default: … … 86 89 } 87 90 91 public static AsyncCommand _pwgCmdGetImageforTag; 92 public static AsyncCommand PwgCmdGetImageforTag 93 { 94 get 95 { 96 if (_pwgCmdGetImageforTag == null) 97 { 98 _pwgCmdGetImageforTag = new PwgCmdGetImageforTag(); 99 } 100 return _pwgCmdGetImageforTag; 101 } 102 } 88 103 } 89 104 } -
extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgCategoryListWPFHelper.cs
r11935 r12015 75 75 PwgModelManager.Instance.CategoryList.Clear(); 76 76 PwgRootCategoryWPF aRootCategory = new PwgRootCategoryWPF(); 77 aRootCategory.Name = " Root";77 aRootCategory.Name = "Categories"; 78 78 aRootCategory.Childrens = new PwgCategoryListWPF(); 79 79 PwgModelManager.Instance.CategoryList.Add(aRootCategory); -
extensions/PiwigoLib/PiwigoWpf/DTO/PwgModelManager.cs
r11935 r12015 88 88 set { _imageShown = value; OnPropertyChanged("ImageShown"); } 89 89 } 90 90 91 private PwgTagListWPF _tagsList; 92 public PwgTagListWPF TagsList 93 { 94 set { _tagsList = value; OnPropertyChanged("TagsList"); } 95 get { return _tagsList; } 96 } 97 91 98 public event PropertyChangedEventHandler PropertyChanged; 92 99 internal void OnPropertyChanged(String info) … … 95 102 PropertyChanged(this, new PropertyChangedEventArgs(info)); 96 103 } 104 105 97 106 } 98 107 } -
extensions/PiwigoLib/PiwigoWpf/DTO/PwgTagListWPF.cs
r7160 r12015 7 7 namespace Com.Piwigo.Wpf.DTO 8 8 { 9 public class PwgTagListWPF : ObservableCollection<PwgTagWPF>9 public class PwgTagListWPF : AsyncObservableCollection<PwgTagWPF> 10 10 { 11 11 } -
extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml
r11935 r12015 138 138 </StackPanel> 139 139 </StackPanel> 140 <T reeView Name="listViewCategory"Background="{Binding ElementName=this}"140 <TabControl Background="{Binding ElementName=this}" 141 141 Grid.Column="0" 142 142 Grid.Row="1" 143 MinWidth="180" 143 MinWidth="180" > 144 <TabItem Header="Categories"> 145 <TreeView Name="listViewCategory" 144 146 DataContext="{Binding Source={StaticResource Categories}}" 145 147 ItemsSource="{Binding}" MouseDoubleClick="listViewCategory_MouseDoubleClick" 146 148 HorizontalAlignment="Left" PreviewMouseDown="listViewCategory_PreviewMouseDown"> 147 <TreeView.ItemContainerStyle>148 <!--149 This Style binds a TreeViewItem to a TreeViewItemViewModel.150 -->151 <Style TargetType="{x:Type TreeViewItem}">152 <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />153 <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />154 <Setter Property="FontWeight" Value="Normal" />155 <Setter Property="Opacity" Value=".75" />156 <Style.Triggers>157 <EventTrigger RoutedEvent="Mouse.MouseEnter">158 <EventTrigger.Actions>159 <BeginStoryboard>160 <Storyboard>161 <DoubleAnimation149 <TreeView.ItemContainerStyle> 150 <!-- 151 This Style binds a TreeViewItem to a TreeViewItemViewModel. 152 --> 153 <Style TargetType="{x:Type TreeViewItem}"> 154 <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> 155 <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> 156 <Setter Property="FontWeight" Value="Normal" /> 157 <Setter Property="Opacity" Value=".75" /> 158 <Style.Triggers> 159 <EventTrigger RoutedEvent="Mouse.MouseEnter"> 160 <EventTrigger.Actions> 161 <BeginStoryboard> 162 <Storyboard> 163 <DoubleAnimation 162 164 Duration="0:0:0.2" 163 165 Storyboard.TargetProperty="Opacity" 164 166 To="1.0" /> 165 </Storyboard>166 </BeginStoryboard>167 </EventTrigger.Actions>168 </EventTrigger>169 <EventTrigger RoutedEvent="Mouse.MouseLeave">170 <EventTrigger.Actions>171 <BeginStoryboard>172 <Storyboard>173 <DoubleAnimation167 </Storyboard> 168 </BeginStoryboard> 169 </EventTrigger.Actions> 170 </EventTrigger> 171 <EventTrigger RoutedEvent="Mouse.MouseLeave"> 172 <EventTrigger.Actions> 173 <BeginStoryboard> 174 <Storyboard> 175 <DoubleAnimation 174 176 Duration="0:0:0.2" 175 177 Storyboard.TargetProperty="Opacity" /> 176 </Storyboard>177 </BeginStoryboard>178 </EventTrigger.Actions>179 </EventTrigger>180 <Trigger Property="IsSelected" Value="True">181 <Setter Property="FontWeight" Value="Bold" />182 </Trigger>183 </Style.Triggers>184 </Style>185 </TreeView.ItemContainerStyle>186 <TreeView.Resources>187 <HierarchicalDataTemplate188 DataType="{x:Type pwgdto:PwgTreeCategoryWPF}"189 ItemsSource="{Binding Childrens}"190 >191 <StackPanel Orientation="Horizontal" DataContext="{Binding}"178 </Storyboard> 179 </BeginStoryboard> 180 </EventTrigger.Actions> 181 </EventTrigger> 182 <Trigger Property="IsSelected" Value="True"> 183 <Setter Property="FontWeight" Value="Bold" /> 184 </Trigger> 185 </Style.Triggers> 186 </Style> 187 </TreeView.ItemContainerStyle> 188 <TreeView.Resources> 189 <HierarchicalDataTemplate 190 DataType="{x:Type pwgdto:PwgTreeCategoryWPF}" 191 ItemsSource="{Binding Childrens}" 192 > 193 <StackPanel Orientation="Horizontal" DataContext="{Binding}" 192 194 VerticalAlignment="Center" HorizontalAlignment="Center"> 193 <Image Source="pack://application:,,,/Pictures/22x22/folder_html.png" Margin="5"195 <Image Source="pack://application:,,,/Pictures/22x22/folder_html.png" Margin="5" 194 196 Stretch="None"> 195 </Image>196 <TextBlock Text="{Binding Name}" />197 </StackPanel>198 </HierarchicalDataTemplate>199 <HierarchicalDataTemplate197 </Image> 198 <TextBlock Text="{Binding Name}" /> 199 </StackPanel> 200 </HierarchicalDataTemplate> 201 <HierarchicalDataTemplate 200 202 DataType="{x:Type pwgdto:PwgCategoryWPF}" 201 203 ItemsSource="{Binding Childrens}" 202 204 > 203 <StackPanel Orientation="Horizontal" DataContext="{Binding}"205 <StackPanel Orientation="Horizontal" DataContext="{Binding}" 204 206 VerticalAlignment="Center" HorizontalAlignment="Center"> 205 <Image Source="pack://application:,,,/Pictures/22x22/folder_images.png" Margin="5"207 <Image Source="pack://application:,,,/Pictures/22x22/folder_images.png" Margin="5" 206 208 Stretch="None"> 207 </Image>208 <TextBlock Text="{Binding Name}" />209 <StackPanel.ToolTip>210 <UniformGrid>209 </Image> 210 <TextBlock Text="{Binding Name}" /> 211 <StackPanel.ToolTip> 212 <UniformGrid> 211 213 <TextBlock Text="{Binding Path=ImagesCount}"/> 212 214 <TextBlock Text=" images inside"/> 213 215 <TextBlock Text="{Binding Path=SubCategoriesCount}"/> 214 216 <TextBlock Text=" categories inside"/> 215 </UniformGrid> 216 </StackPanel.ToolTip> 217 </StackPanel> 218 </HierarchicalDataTemplate> 219 </TreeView.Resources> 220 </TreeView> 217 </UniformGrid> 218 </StackPanel.ToolTip> 219 </StackPanel> 220 </HierarchicalDataTemplate> 221 </TreeView.Resources> 222 </TreeView> 223 </TabItem> 224 <TabItem Header="Tags"> 225 <ListView Name="listViewTag" 226 DataContext="{Binding Source={StaticResource Tags}}" 227 ItemsSource="{Binding }" SelectionMode="Single" IsSynchronizedWithCurrentItem="True" MouseDoubleClick="listViewTag_MouseDoubleClick"> 228 <ListView.ItemContainerStyle> 229 <Style TargetType="{x:Type ListViewItem}"> 230 <Setter Property="FontWeight" Value="Normal" /> 231 <Setter Property="MaxHeight" Value="75" /> 232 <Setter Property="MinHeight" Value="75" /> 233 <Setter Property="Opacity" Value=".75" /> 234 <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> 235 <Style.Triggers> 236 <EventTrigger RoutedEvent="Mouse.MouseEnter"> 237 <EventTrigger.Actions> 238 <BeginStoryboard> 239 <Storyboard> 240 <DoubleAnimation 241 Duration="0:0:0.2" 242 Storyboard.TargetProperty="Opacity" 243 To="1.0" /> 244 </Storyboard> 245 </BeginStoryboard> 246 </EventTrigger.Actions> 247 </EventTrigger> 248 <EventTrigger RoutedEvent="Mouse.MouseLeave"> 249 <EventTrigger.Actions> 250 <BeginStoryboard> 251 <Storyboard> 252 <DoubleAnimation 253 Duration="0:0:0.2" 254 Storyboard.TargetProperty="Opacity" /> 255 </Storyboard> 256 </BeginStoryboard> 257 </EventTrigger.Actions> 258 </EventTrigger> 259 <Trigger Property="IsSelected" Value="True"> 260 <Setter Property="FontWeight" Value="Bold" /> 261 </Trigger> 262 </Style.Triggers> 263 </Style> 264 </ListView.ItemContainerStyle> 265 <ListView.Resources> 266 <DataTemplate DataType="{x:Type pwgdto:PwgTagWPF}"> 267 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" DataContext="{Binding}"> 268 <StackPanel ToolTip="{Binding Path=UrlTags}" Orientation="Horizontal"> 269 <Label Content="{Binding Path=Name}"/> 270 <Separator /> 271 <Label Content="{Binding Path=Counter}" /> 272 <Label Content="Pictures" /> 273 </StackPanel> 274 </Border> 275 </DataTemplate> 276 </ListView.Resources> 277 </ListView> 278 </TabItem> 279 </TabControl> 221 280 <GridSplitter ResizeDirection="Columns" 222 281 Grid.Column="1" … … 307 366 DataContext="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=ImageShown}" 308 367 > 309 <Image ToolTip="{Binding Path=File}" MaxHeight="360" MaxWidth="480" MinHeight="120" MinWidth="160"> 310 <Image.Source> 311 <Binding Path="ImgSource" /> 312 </Image.Source> 313 </Image> 368 <TabControl> 369 <TabItem Header="Image"> 370 <Image ToolTip="{Binding Path=File}" MaxHeight="360" MaxWidth="480" MinHeight="120" MinWidth="160"> 371 <Image.Source> 372 <Binding Path="ImgSource" /> 373 </Image.Source> 374 </Image> 375 </TabItem> 376 <TabItem Header="Data"> 377 <UniformGrid Columns="2"> 378 <Label Content="Image Name"/> 379 <Label Content="{Binding Path=File}"/> 380 <Label Content="Image heigh"/> 381 <Label Content="{Binding Path=Height}"/> 382 <Label Content="Image Width"/> 383 <Label Content="{Binding Path=Width}"/> 384 </UniformGrid> 385 </TabItem> 386 </TabControl> 314 387 </DockPanel> 315 388 </Grid> -
extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml.cs
r11935 r12015 69 69 } 70 70 71 private void listViewTag_MouseDoubleClick(object sender, MouseButtonEventArgs e) 72 { 73 AppHelper.ExecuteCommand<PwgCmdGetImageforTag>(listViewTag.SelectedValue); 74 } 75 71 76 72 77 } -
extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj
r11935 r12015 77 77 <SubType>Designer</SubType> 78 78 </ApplicationDefinition> 79 <Compile Include="Command\PwgCmdGetImageforTag.cs" /> 79 80 <Compile Include="Command\PwgCmdGetSubCategorieforCategory.cs" /> 80 81 <Compile Include="Command\PwgCmdSelectImageInCategory.cs" /> … … 88 89 <Compile Include="Command\AsyncCommand.cs" /> 89 90 <Compile Include="Command\PwgCommandEvents.cs" /> 91 <Compile Include="DTO\Helper\PwgTagListWPFHelper.cs" /> 92 <Compile Include="DTO\Helper\PwgTagWPFHelper.cs" /> 90 93 <Compile Include="DTO\Helper\PwgImageListWPFHelper.cs" /> 91 94 <Compile Include="DTO\Helper\PwgImageWPFHelper.cs" /> … … 93 96 <Compile Include="DTO\Helper\PwgCategoryListWPFHelper.cs" /> 94 97 <Compile Include="DTO\Helper\PwgSessionWPFHelper.cs" /> 98 <Compile Include="DTO\LocalPwgCategory.cs" /> 95 99 <Compile Include="DTO\PwgModelManager.cs" /> 96 100 <Compile Include="Helper\AdvBooltoVisibilityConverter.cs" /> -
extensions/PiwigoLib/PiwigoWpf/app.config
r7150 r12015 1 1 <?xml version="1.0"?> 2 2 <configuration> 3 <configSections>3 <configSections> 4 4 <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > 5 5 <section name="Com.Piwigo.Wpf.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> 6 6 </sectionGroup> 7 </configSections> 8 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><userSettings> 9 <Com.Piwigo.Wpf.Properties.Settings> 10 <setting name="ServerNameData" serializeAs="String"> 11 <value /> 12 </setting> 13 <setting name="UserNameData" serializeAs="String"> 14 <value /> 15 </setting> 16 <setting name="PwdData" serializeAs="String"> 17 <value /> 18 </setting> 19 <setting name="SaveSettingData" serializeAs="String"> 20 <value>False</value> 21 </setting> 22 </Com.Piwigo.Wpf.Properties.Settings> 23 </userSettings> 7 </configSections> 8 <startup> 9 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 10 </startup> 11 <userSettings> 12 <Com.Piwigo.Wpf.Properties.Settings> 13 <setting name="ServerNameData" serializeAs="String"> 14 <value /> 15 </setting> 16 <setting name="UserNameData" serializeAs="String"> 17 <value /> 18 </setting> 19 <setting name="PwdData" serializeAs="String"> 20 <value /> 21 </setting> 22 <setting name="SaveSettingData" serializeAs="String"> 23 <value>False</value> 24 </setting> 25 </Com.Piwigo.Wpf.Properties.Settings> 26 </userSettings> 27 <system.net> 28 <!-- proxy config if need, but normaly wu used the system setting ie internet explorer setting 29 <defaultProxy> 30 <proxy 31 usesystemdefault = "false" 32 proxyaddress = "http://proxyserver:80" 33 bypassonlocal = "true" 34 /> 35 <bypasslist> 36 <add address="http://[a-z]+\.contoso\.com/" /> 37 </bypasslist> 38 </defaultProxy>--> 39 <settings> 40 <servicePointManager expect100Continue="false"/> <!-- usefull when you obtain a error just like this : The remote server returned an error: (417) Expectation Failed.--> 41 </settings> 42 </system.net> 24 43 </configuration>
Note: See TracChangeset
for help on using the changeset viewer.