<!--
/*
** Job Arranger Manager
** Copyright (C) 2012 FitechForce, Inc. All Rights Reserved.
** Copyright (C) 2013 Daiwa Institute of Research Business Innovation Ltd. All Rights Reserved.
**
**
** Licensed to the Apache Software Foundation (ASF) under one or more 
** contributor license agreements. See the NOTICE file distributed with
** this work for additional information regarding copyright ownership. 
** The ASF licenses this file to you under the Apache License, Version 2.0
** (the "License"); you may not use this file except in compliance with 
** the License. You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
**/
-->
    <src:BaseUserControl x:Class="jp.co.ftf.jobcontroller.JobController.Form.JobManager.JobnetExecControlAllPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:src="clr-namespace:jp.co.ftf.jobcontroller.JobController"                
             xmlns:System="clr-namespace:System;assembly=mscorlib" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="15"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBlock HorizontalAlignment="Left" Text="{x:Static src:Properties.Resources.operation_information_jobnet_label}" Width="Auto" Margin="5,0,0,0" Grid.Row="0" Background="Aquamarine" KeyboardNavigation.IsTabStop="False"/>
        <ListView VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,0,0,0" Name="listView1" 
                  ItemsSource="{Binding JobnetExecList}" Grid.Row="1" SelectionMode="Single" SelectionChanged="ListView_SelectionChanged" KeyboardNavigation.TabNavigation="Once">
            <ListView.ItemContainerStyle>
                <Style TargetType="{x:Type ListViewItem}">
                    <EventSetter Event="MouseDoubleClick" Handler="list_MouseDoubleClick" />
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Style.Resources>
                        <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{x:Static SystemColors.HighlightColor}"/>
                        <SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{x:Static SystemColors.HighlightTextColor}"/>
                    </Style.Resources>
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.ContextMenu>
                <ContextMenu Name="contextMenu" Opened="listView_ContextMenuOpening" >
                    <MenuItem Name="hideContextMenu" Header="{x:Static src:Properties.Resources.hide_context_menu_text}" Command="{x:Static src:JobArrangerCommands.Hide}" IsEnabled="False" 
                        CommandTarget="{Binding Path=PlacementTarget,RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItems}" />
                    <MenuItem Name="stopContextMenu" Header="{x:Static src:Properties.Resources.stop_context_menu_text}"  Command="{x:Static src:JobArrangerCommands.AllStop}" 
                        CommandTarget="{Binding Path=PlacementTarget,RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItems}" />
                    <MenuItem Name="DelayedContextMenu" Header="{x:Static src:Properties.Resources.delayedStart_context_menu_text}"  Command="{x:Static src:JobArrangerCommands.AllDelayed}" 
                        CommandTarget="{Binding Path=PlacementTarget,RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItems}" />
                    <!--  added by YAMA 2014/10/14    実行予定リスト起動時刻変更  -->
                    <!--  
                    <MenuItem Name="updtContextMenu" Header="{x:Static src:Properties.Resources.updt_context_menu_text}" Command="{x:Static src:JobArrangerCommands.Updt}" 
                        CommandTarget="{Binding Path=PlacementTarget,RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItems}" />
                     -->
                    <MenuItem Name="updtContextMenu" Header="{x:Static src:Properties.Resources.updt_context_menu_text}"  Click="ContextUpdateSchedule_Click" />
                    <MenuItem Name="reserveContextMenu" Header="{x:Static src:Properties.Resources.reserve_context_menu_text}" Command="{x:Static src:JobArrangerCommands.Reserve}" 
                        CommandTarget="{Binding Path=PlacementTarget,RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItems}" />
                    <MenuItem Name="releaseContextMenu" Header="{x:Static src:Properties.Resources.release_context_menu_text}" Command="{x:Static src:JobArrangerCommands.Release}" 
                        CommandTarget="{Binding Path=PlacementTarget,RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItems}" />
                </ContextMenu>
            </ListView.ContextMenu>
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="145">
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.management_id_col_head_text}" />
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding inner_jobnet_id}" TextAlignment="Left"/>
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <!--  added by YAMA 2014/09/22 実行中ジョブID表示 -->
                    <!--  GridViewColumn Width="235" -->
                    <GridViewColumn Width="161">
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.jobnet_id_col_head_text}" />
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding jobnet_id}" TextAlignment="Left"/>
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <!--  added by YAMA 2014/09/22 実行中ジョブID表示 -->
                    <!--  GridViewColumn Width="70" -->
                    <GridViewColumn Width="55">
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.status_col_head_text}"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <!-- added by YAMA 2014/07/01
                                    <TextBlock Text="{Binding display_status}" TextAlignment="Center" Background="{Binding status_color}" />
                                    -->
                                    <TextBlock Text="{Binding display_status}" TextAlignment="Left" Background="{Binding status_color}" Foreground="{Binding Foreground_color}"/>
                                    </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <!--  added by YAMA 2014/09/22 実行中ジョブID表示 -->
                    <!--  GridViewColumn Width="290" -->
                    <GridViewColumn Width="188">
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.jobnet_name_col_head_text}"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding jobnet_name}" TextAlignment="Left" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <!--  added by YAMA 2014/09/22 実行中ジョブID表示 ジョブID  ジョブ名 -->
                    <GridViewColumn Width="120">
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.running_job_name_id_col_head_text}"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding running_job_id}" TextAlignment="Left" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="120">
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.running_job_name_col_head_text}"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding running_job_name}" TextAlignment="Left" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="130">
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.schedule_time_col_head_text}"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding scheduled_time}" TextAlignment="Left" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="130">
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.started_time_col_head_text}"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding start_time}" TextAlignment="Left" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="130" >
                        <GridViewColumnHeader Content="{x:Static src:Properties.Resources.ended_time_col_head_text}"/>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding end_time}" TextAlignment="Left" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</src:BaseUserControl>
