Changeset 7160 for extensions/PiwigoLib/PiwigoWpf
- Timestamp:
- Oct 11, 2010, 8:04:34 PM (14 years ago)
- Location:
- extensions/PiwigoLib/PiwigoWpf
- Files:
-
- 6 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoWpf/App.xaml.cs
r7150 r7160 1 using System; 2 using System.Collections.Generic; 3 using System.Configuration; 4 using System.Data; 5 using System.Linq; 6 using System.Windows; 7 using Com.Piwigo.Lib.Proxy; 1 using System.Windows; 2 using System.Windows.Data; 3 using Com.Piwigo.Lib.IService; 8 4 using Com.Piwigo.Wpf.DTO; 9 using System.Windows.Data;10 5 11 6 namespace Com.Piwigo.Wpf … … 20 15 { 21 16 22 PwgConfigProxy.PwgUserAgent = "Com.Piwigo.Wpf.PiwigoWPF"; 23 PwgConfigProxy.PwgServeurUriBuilder.Path = "phpwebgallery/ws.php"; 24 PwgConfigProxy.PwgServeurUriBuilder.Scheme = "http://"; 17 PwgServiceProvider.Instance.PwgSetupService.Setup( "Com.Piwigo.Wpf.PiwigoWPF", null, null); 25 18 26 PwgSessionWPF sess = (PwgSessionWPF)(this.Resources["Session"] as ObjectDataProvider).Data; 19 PwgModelManager.Instance.Session = (PwgSessionWPF)(this.Resources["Session"] as ObjectDataProvider).Data; 20 PwgModelManager.Instance.CategoryList = (PwgCategoryListWPF)(this.Resources["Categories"] as ObjectDataProvider).Data; 21 PwgModelManager.Instance.ImageList = (PwgImageListWPF)(this.Resources["Images"] as ObjectDataProvider).Data; 27 22 28 sess.ServeurName = global::Com.Piwigo.Wpf.Properties.Settings.Default.ServerNameData;29 sess.UserName = global::Com.Piwigo.Wpf.Properties.Settings.Default.UserNameData;30 sess.Password = global::Com.Piwigo.Wpf.Properties.Settings.Default.PwdData;31 sess.SaveSetting = global::Com.Piwigo.Wpf.Properties.Settings.Default.SaveSettingData;23 PwgModelManager.Instance.Session.ServeurName = global::Com.Piwigo.Wpf.Properties.Settings.Default.ServerNameData; 24 PwgModelManager.Instance.Session.UserName = global::Com.Piwigo.Wpf.Properties.Settings.Default.UserNameData; 25 PwgModelManager.Instance.Session.Password = global::Com.Piwigo.Wpf.Properties.Settings.Default.PwdData; 26 PwgModelManager.Instance.Session.SaveSetting = global::Com.Piwigo.Wpf.Properties.Settings.Default.SaveSettingData; 32 27 33 28 MainWindow mainWindow = new MainWindow(); 34 29 mainWindow.Show(); 35 36 //mainWindow.Photos = (PhotoList)(this.Resources["Photos"] as ObjectDataProvider).Data;37 //mainWindow.Photos.Path = "..\\..\\Photos";38 39 //mainWindow.ShoppingCart = (PrintList)(this.Resources["ShoppingCart"] as ObjectDataProvider).Data;40 41 30 } 42 31 -
extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdConnect.cs
r7150 r7160 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Windows.Input; 3 using Com.Piwigo.Lib.IService; 4 using Com.Piwigo.Wpf.DTO; 5 using Com.Piwigo.Lib.DTO; 6 using Com.Piwigo.Wpf.DTO.Helper; 7 using Com.Piwigo.Wpf.Helper; 6 8 7 9 namespace Com.Piwigo.Wpf.Command … … 11 13 public override bool CanExecute(object parameter) 12 14 { 13 return true; 15 Boolean retVal = false; 16 if ( AppHelper.IsInDesignModeStatic == true) 17 { 18 retVal = false; 19 } 20 else 21 { 22 if ((PwgModelManager.Instance.Session != null) 23 & (PwgModelManager.Instance.Session.ServeurName != null)) 24 { 25 retVal = !String.IsNullOrWhiteSpace(PwgModelManager.Instance.Session.ServeurName); 26 } 27 } 28 return (retVal); 14 29 } 15 30 16 31 public override void Execute(object parameter) 17 32 { 18 throw new NotImplementedException(); 33 try { 34 Uri uriServer = new Uri(PwgModelManager.Instance.Session.ServeurName); 35 36 PwgServiceProvider.Instance.PwgSetupService.Setup(null, null, uriServer); 37 PwgSession sess = PwgServiceProvider.Instance.PwgSessionService.GetPwgSession(); 38 sess = PwgServiceProvider.Instance.PwgSessionService.Login( PwgModelManager.Instance.Session.UserName, 39 PwgModelManager.Instance.Session.Password); 40 41 PwgSessionWPF sesWPF = PwgModelManager.Instance.Session; 42 PwgSessionWPFHelper.AddPwgSessionInfoToPwgSessionWPF(sess, ref sesWPF); 43 44 List<PwgCategory> lstCat = PwgServiceProvider.Instance.PwgCategoriesService.GetListOfCategory(null, false, (PwgModelManager.Instance.Session.Status == PwgSessionStatusEnum.Guest)); 45 PwgCategoryListWPF lstCatWPF = PwgModelManager.Instance.CategoryList; 46 47 PwgCategoryListWPFHelper.ConvertPwgCategoryListToPwgCategoryListWPF(lstCat, ref lstCatWPF); 48 } 49 catch (PwgServiceException ex) 50 { 51 Console.WriteLine("Erreur " + ex.NumeroErr + " " + ex.MessageErr); 52 Console.WriteLine(ex.Message); 53 } 54 19 55 } 20 56 } -
extensions/PiwigoLib/PiwigoWpf/Command/PwgCmdProvider.cs
r7150 r7160 7 7 namespace Com.Piwigo.Wpf.Command 8 8 { 9 public static sealedclass PwgCmdProvider9 public static class PwgCmdProvider 10 10 { 11 11 public static ICommand _pwgCmdConnect; -
extensions/PiwigoLib/PiwigoWpf/DTO/PwgCategoryListWPF.cs
r7150 r7160 7 7 namespace Com.Piwigo.Wpf.DTO 8 8 { 9 class PwgCategoryListWPF : ObservableCollection<PwgCategoryWPF>9 public class PwgCategoryListWPF : ObservableCollection<PwgCategoryWPF> 10 10 { 11 11 } -
extensions/PiwigoLib/PiwigoWpf/DTO/PwgImageListWPF.cs
r7150 r7160 7 7 namespace Com.Piwigo.Wpf.DTO 8 8 { 9 class PwgImageListWPF : ObservableCollection<PwgImageWPF>9 public class PwgImageListWPF : ObservableCollection<PwgImageWPF> 10 10 { 11 11 } -
extensions/PiwigoLib/PiwigoWpf/DTO/PwgTagListWPF.cs
r7150 r7160 7 7 namespace Com.Piwigo.Wpf.DTO 8 8 { 9 class PwgTagListWPF : ObservableCollection<PwgTagWPF>9 public class PwgTagListWPF : ObservableCollection<PwgTagWPF> 10 10 { 11 11 } -
extensions/PiwigoLib/PiwigoWpf/MainWindow.xaml
r7150 r7160 3 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 4 xmlns:pwg="clr-namespace:Com.Piwigo.Wpf" 5 xmlns:pwgdto="clr-namespace:Com.Piwigo.Wpf.DTO" 5 6 xmlns:pwgcmd="clr-namespace:Com.Piwigo.Wpf.Command" 6 7 Title="PiwigoWpf" … … 122 123 <!-- DATA TEMPLATES --> 123 124 124 <!--<DataTemplate DataType="{x:Type pd:ImageFile}"> 125 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="White"> 126 <Image Source="{Binding Image}" /> 125 <DataTemplate DataType="{x:Type pwgdto:PwgImageWPF}"> 126 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue" 127 DataContext="{Binding}"> 128 <Image Source="{Binding UrlElement}" ToolTip="{Binding File}" /> 127 129 </Border> 128 130 </DataTemplate> 129 131 130 <DataTemplate DataType="{x:Type pd:Print}"> 131 <Border Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center" Background="White" Padding="3" BorderBrush="#66000000" BorderThickness="1" MaxWidth="60" MaxHeight="60" > 132 <Image Source="{Binding Photo}" /> 132 <DataTemplate DataType="{x:Type pwgdto:PwgCategoryWPF}"> 133 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Padding="4" Margin="2" Background="Blue" 134 DataContext="{Binding}"> 135 <TextBox ToolTip="{Binding Name}" /> 133 136 </Border> 134 137 </DataTemplate> 135 136 <DataTemplate DataType="{x:Type pd:GreetingCard}">137 <Grid Margin="3" >138 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Background="{DynamicResource GreetingCardGradient}" Width="40" Height="50" BorderBrush="#44000000" BorderThickness="1" >139 <Border.RenderTransform>140 <SkewTransform AngleY="-10" />141 </Border.RenderTransform>142 </Border>143 <Border VerticalAlignment="Center" HorizontalAlignment="Center" Background="White" Width="50" Height="50" BorderBrush="#66000000" BorderThickness="1" >144 <Image Margin="3" Source="{Binding Photo}" />145 </Border>146 </Grid>147 </DataTemplate>148 149 <DataTemplate DataType="{x:Type pd:TShirt}">150 <Grid Margin="3">151 <Path VerticalAlignment="Center" HorizontalAlignment="Center" Fill="White" Stroke="#66000000" Data="M 0 9.6 L 24 0 L 40 0 L 64 9.6 L 62.4 24 L 51.2 24 L 51.2 56 L 12.8 56 L 12.8 24 L 1.6 24 Z "/>152 <Image Source="{Binding Photo}" MaxWidth="32" MaxHeight="36" VerticalAlignment="Center" HorizontalAlignment="Center"/>153 </Grid>154 </DataTemplate>-->155 138 156 139 <!-- PHOTOLIST TEMPLATE --> … … 218 201 </EventTrigger> 219 202 </Style.Triggers> 220 </Style>221 222 <!-- SHOPPING CART TEMPLATE -->223 224 <Style x:Key="ShoppingCartStyle" TargetType="{x:Type ListBox}">225 <Setter Property="Template">226 <Setter.Value>227 <ControlTemplate TargetType="{x:Type ListBox}" >228 <Border229 BorderBrush="Gray"230 BorderThickness="1"231 CornerRadius="6"232 Background="{DynamicResource ShoppingCartGradient}" >233 <ScrollViewer>234 <WrapPanel235 ItemHeight="70"236 ItemWidth="70"237 Margin="0,25,0,0"238 IsItemsHost="True"239 Orientation="Horizontal"240 HorizontalAlignment="Center" />241 </ScrollViewer>242 </Border>243 </ControlTemplate>244 </Setter.Value>245 </Setter>246 </Style>247 248 <!-- SHOPPING CART TRIGGERS -->249 250 <Style x:Key="ShoppingCartItem" TargetType="{x:Type ListBoxItem}">251 <Setter Property="BorderBrush" Value="Transparent" />252 <Setter Property="Template">253 <Setter.Value>254 <ControlTemplate TargetType="{x:Type ListBoxItem}">255 <Border256 x:Name="ContentBorder"257 Opacity="0.85">258 <ContentPresenter />259 </Border>260 <ControlTemplate.Triggers>261 <Trigger Property="IsSelected" Value="True">262 <Setter263 TargetName="ContentBorder"264 Property="Opacity"265 Value="1.0" />266 </Trigger>267 </ControlTemplate.Triggers>268 </ControlTemplate>269 </Setter.Value>270 </Setter>271 203 </Style> 272 204 … … 500 432 <ProgressBar IsIndeterminate="True" /> 501 433 </StackPanel> 502 503 <ListView Name="listViewCategory" DockPanel.Dock="Left" MinWidth="100" />504 <ListView Name="listViewImage" DockPanel.Dock="Right" MinWidth="500"/>434 435 <ListView Name="listViewCategory" Style="PhotoListStyle" DockPanel.Dock="Left" MinWidth="100" ItemsSource="{Binding Source={StaticResource Categories}}" /> 436 <ListView Name="listViewImage" Style="PhotoListStyle" DockPanel.Dock="Right" MinWidth="500" ItemsSource="{Binding Source={StaticResource Images}}" /> 505 437 </DockPanel> 506 438 -
extensions/PiwigoLib/PiwigoWpf/PiwigoWpf.csproj
r7150 r7160 79 79 <Compile Include="Command\PwgCmdConnect.cs" /> 80 80 <Compile Include="Command\PwgCmdBase.cs" /> 81 <Compile Include="DTO\Helper\PwgCategoryWPFHelper.cs" /> 82 <Compile Include="DTO\Helper\PwgCategoryListWPFHelper.cs" /> 83 <Compile Include="DTO\Helper\PwgSessionWPFHelper.cs" /> 84 <Compile Include="DTO\PwgModelManager.cs" /> 85 <Compile Include="Helper\AppHelper.cs" /> 81 86 <Compile Include="Settings.cs" /> 82 87 <Page Include="MainWindow.xaml"> … … 126 131 </ItemGroup> 127 132 <ItemGroup> 128 < Resource Include="Pictures\PiwigoLogo.png" />133 <EmbeddedResource Include="Pictures\PiwigoLogo.png" /> 129 134 </ItemGroup> 130 135 <ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.