Changeset 12015 for extensions


Ignore:
Timestamp:
Aug 30, 2011, 5:24:52 PM (13 years ago)
Author:
bayral
Message:

retrieve tags list and image for a tag.

Location:
extensions/PiwigoLib
Files:
5 added
13 edited

Legend:

Unmodified
Added
Removed
  • extensions/PiwigoLib/PiwigoLib/Proxy/PwgGenericProxy.cs

    r11872 r12015  
    9898        {
    9999            T ReturnValue = default(T);
     100            //System.Net.ServicePointManager.Expect100Continue = false;
    100101
    101102            HttpWebRequest Request;
  • extensions/PiwigoLib/PiwigoLib/Service/PwgSetupService.cs

    r7160 r12015  
    2727                if (PwgUserAgent != null)
    2828                {
    29                     PwgConfigProxy.PwgUserAgent = PwgUserAgent;
     29                   PwgConfigProxy.PwgUserAgent = PwgUserAgent;
    3030                }
    3131
  • extensions/PiwigoLib/PiwigoWpf/App.xaml

    r11935 r12015  
    99        <ObjectDataProvider x:Name="SessionODP" x:Key="Session" ObjectType="{x:Type piwigo:PwgSessionWPF}" />
    1010        <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"-->
    1113        <!--IsAsynchronous="True"-->
    1214        <ResourceDictionary  x:Key="VisualStyleApp" Source="VisualStyleApp.xaml"/>
  • extensions/PiwigoLib/PiwigoWpf/App.xaml.cs

    r11935 r12015  
    2424            PwgModelManager.Instance.CategoryList = (PwgRootCategoryListWPF)(this.Resources["Categories"] as ObjectDataProvider).Data;
    2525            PwgModelManager.Instance.ImageList = (PwgImageListWPF)(this.Resources["Images"] as ObjectDataProvider).Data;
    26             //PwgCategoryListWPFHelper.InitRootCategory();
     26            PwgModelManager.Instance.TagsList = (PwgTagListWPF)(this.Resources["Tags"] as ObjectDataProvider).Data;
    2727
    2828            PwgModelManager.Instance.Session.ServeurName = global::Com.Piwigo.Wpf.Properties.Settings.Default.ServerNameData;
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs

    r11935 r12015  
    4646                SendUiInfo("Setting up cache data ...");
    4747                ImageCacheManager.Instance.SetCurrentServer(uriServer.AbsoluteUri);
    48            
    4948
     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);
    5053            }
    5154            catch (PwgServiceException ex)
  • extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdProvider.cs

    r11935 r12015  
    2626                case "PwgCmdGetSubCategorieforCategory":
    2727                    objICom = PwgCmdGetSubCategorieforCategory;
     28                    break;
     29                case "PwgCmdGetImageforTag":
     30                    objICom = PwgCmdGetImageforTag;
    2831                    break;
    2932                default:
     
    8689        }
    8790
     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        }
    88103    }
    89104}
  • extensions/PiwigoLib/PiwigoWpf/DTO/Helper/PwgCategoryListWPFHelper.cs

    r11935 r12015  
    7575                PwgModelManager.Instance.CategoryList.Clear();
    7676                PwgRootCategoryWPF aRootCategory = new PwgRootCategoryWPF();
    77                 aRootCategory.Name = "Root";
     77                aRootCategory.Name = "Categories";
    7878                aRootCategory.Childrens = new PwgCategoryListWPF();
    7979                PwgModelManager.Instance.CategoryList.Add(aRootCategory);
  • extensions/PiwigoLib/PiwigoWpf/DTO/PwgModelManager.cs

    r11935 r12015  
    8888                set { _imageShown = value; OnPropertyChanged("ImageShown"); }
    8989            }
    90            
     90
     91            private PwgTagListWPF _tagsList;
     92            public PwgTagListWPF TagsList
     93            {
     94                set { _tagsList = value; OnPropertyChanged("TagsList"); }
     95                get { return _tagsList; }
     96            }
     97
    9198            public event PropertyChangedEventHandler PropertyChanged;
    9299            internal void OnPropertyChanged(String info)
     
    95102                    PropertyChanged(this, new PropertyChangedEventArgs(info));
    96103            }
     104
     105 
    97106        }
    98107    }
  • extensions/PiwigoLib/PiwigoWpf/DTO/PwgTagListWPF.cs

    r7160 r12015  
    77namespace Com.Piwigo.Wpf.DTO
    88{
    9     public class PwgTagListWPF : ObservableCollection<PwgTagWPF>
     9    public class PwgTagListWPF : AsyncObservableCollection<PwgTagWPF>
    1010    {
    1111    }
  • extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml

    r11935 r12015  
    138138            </StackPanel>
    139139        </StackPanel>
    140         <TreeView Name="listViewCategory" Background="{Binding ElementName=this}"
     140        <TabControl Background="{Binding ElementName=this}"
    141141                Grid.Column="0"
    142142                Grid.Row="1" 
    143                 MinWidth="180"
     143                MinWidth="180" >
     144            <TabItem Header="Categories">
     145            <TreeView Name="listViewCategory" 
    144146                DataContext="{Binding Source={StaticResource Categories}}"
    145147                ItemsSource="{Binding}"  MouseDoubleClick="listViewCategory_MouseDoubleClick"
    146148                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                                         <DoubleAnimation
     149                <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
    162164                                                                            Duration="0:0:0.2"
    163165                                                                            Storyboard.TargetProperty="Opacity"
    164166                                                                            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                                         <DoubleAnimation
     167                                        </Storyboard>
     168                                    </BeginStoryboard>
     169                                </EventTrigger.Actions>
     170                            </EventTrigger>
     171                            <EventTrigger RoutedEvent="Mouse.MouseLeave">
     172                                <EventTrigger.Actions>
     173                                    <BeginStoryboard>
     174                                        <Storyboard>
     175                                            <DoubleAnimation
    174176                                                                            Duration="0:0:0.2"
    175177                                                                            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                 <HierarchicalDataTemplate
    188                 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}"
    192194                        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"
    194196                        Stretch="None">
    195                         </Image>
    196                         <TextBlock Text="{Binding Name}" />
    197                     </StackPanel>
    198                 </HierarchicalDataTemplate>
    199                 <HierarchicalDataTemplate
     197                            </Image>
     198                            <TextBlock Text="{Binding Name}" />
     199                        </StackPanel>
     200                    </HierarchicalDataTemplate>
     201                    <HierarchicalDataTemplate
    200202                DataType="{x:Type pwgdto:PwgCategoryWPF}"
    201203                ItemsSource="{Binding Childrens}"
    202204                >
    203                     <StackPanel Orientation="Horizontal" DataContext="{Binding}"
     205                        <StackPanel Orientation="Horizontal" DataContext="{Binding}"
    204206                        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"
    206208                        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>
    211213                                    <TextBlock Text="{Binding Path=ImagesCount}"/>
    212214                                    <TextBlock Text=" images inside"/>
    213215                                    <TextBlock Text="{Binding Path=SubCategoriesCount}"/>
    214216                                    <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>
    221280        <GridSplitter ResizeDirection="Columns"
    222281                    Grid.Column="1"
     
    307366                    DataContext="{Binding Source={x:Static pwgdto:PwgModelManager.Instance}, Path=ImageShown}"
    308367                    >
    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>
    314387            </DockPanel>
    315388        </Grid>
  • extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml.cs

    r11935 r12015  
    6969        }
    7070
     71        private void listViewTag_MouseDoubleClick(object sender, MouseButtonEventArgs e)
     72        {
     73            AppHelper.ExecuteCommand<PwgCmdGetImageforTag>(listViewTag.SelectedValue);
     74        }
     75
    7176
    7277    }
  • extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj

    r11935 r12015  
    7777      <SubType>Designer</SubType>
    7878    </ApplicationDefinition>
     79    <Compile Include="Command\PwgCmdGetImageforTag.cs" />
    7980    <Compile Include="Command\PwgCmdGetSubCategorieforCategory.cs" />
    8081    <Compile Include="Command\PwgCmdSelectImageInCategory.cs" />
     
    8889    <Compile Include="Command\AsyncCommand.cs" />
    8990    <Compile Include="Command\PwgCommandEvents.cs" />
     91    <Compile Include="DTO\Helper\PwgTagListWPFHelper.cs" />
     92    <Compile Include="DTO\Helper\PwgTagWPFHelper.cs" />
    9093    <Compile Include="DTO\Helper\PwgImageListWPFHelper.cs" />
    9194    <Compile Include="DTO\Helper\PwgImageWPFHelper.cs" />
     
    9396    <Compile Include="DTO\Helper\PwgCategoryListWPFHelper.cs" />
    9497    <Compile Include="DTO\Helper\PwgSessionWPFHelper.cs" />
     98    <Compile Include="DTO\LocalPwgCategory.cs" />
    9599    <Compile Include="DTO\PwgModelManager.cs" />
    96100    <Compile Include="Helper\AdvBooltoVisibilityConverter.cs" />
  • extensions/PiwigoLib/PiwigoWpf/app.config

    r7150 r12015  
    11<?xml version="1.0"?>
    22<configuration>
    3 <configSections>
     3  <configSections>
    44    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
    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" />
     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" />
    66    </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>
    2443</configuration>
Note: See TracChangeset for help on using the changeset viewer.