개정판 a34f58f6
Controls/RowIndexColumn.cs 추가
Change-Id: Id6950e2fb5ec9e44f4f68819a0fc6277ddc51019
ConvertService/ServiceBase/Markus.Mvvm.ToolKit/ViewModelBase.cs | ||
---|---|---|
6 | 6 |
{ |
7 | 7 |
public abstract class ViewModelBase : NotifyExpectation |
8 | 8 |
{ |
9 |
public bool IsDesignMode |
|
10 |
{ |
|
11 |
get |
|
12 |
{ |
|
13 |
return DesignerProperties.GetIsInDesignMode(new DependencyObject()); |
|
14 |
} |
|
15 |
private set { } |
|
16 |
} |
|
17 |
|
|
18 | 9 |
#region ViewModel Base Binding |
19 | 10 |
|
20 | 11 |
ViewModelBase viewModel; |
ConvertService/ServiceBase/Markus.Service.StationController/App.xaml.cs | ||
---|---|---|
14 | 14 |
/// </summary> |
15 | 15 |
public partial class App : Application |
16 | 16 |
{ |
17 |
|
|
18 |
public static bool IsDesignMode |
|
19 |
{ |
|
20 |
get |
|
21 |
{ |
|
22 |
return DesignerProperties.GetIsInDesignMode(new DependencyObject()); |
|
23 |
} |
|
24 |
private set { } |
|
25 |
} |
|
26 |
|
|
17 | 27 |
//private System.Windows.Forms.NotifyIcon _notifyIcon; |
18 | 28 |
//private bool _isExit; |
19 | 29 |
|
ConvertService/ServiceBase/Markus.Service.StationController/Behaviors/AutoSizeBehaviors.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using System.Windows; |
|
7 |
using System.Windows.Controls; |
|
8 |
using System.Windows.Data; |
|
9 |
using System.Windows.Documents; |
|
10 |
using System.Windows.Media; |
|
11 |
|
|
12 |
namespace Markus.Service.StationController.Behaviors |
|
13 |
{ |
|
14 |
public class AutoSizeBehaviors : DependencyObject |
|
15 |
{ |
|
16 |
public static bool GetAutoSize(DependencyObject obj) |
|
17 |
{ |
|
18 |
return (bool)obj.GetValue(AutoSizeProperty); |
|
19 |
} |
|
20 |
public static void SetAutoSize(DependencyObject obj, bool value) |
|
21 |
{ |
|
22 |
obj.SetValue(AutoSizeProperty, value); |
|
23 |
} |
|
24 |
|
|
25 |
public static readonly DependencyProperty AutoSizeProperty = DependencyProperty.RegisterAttached("AutoSize", typeof(bool), typeof(AutoSizeBehaviors), |
|
26 |
new FrameworkPropertyMetadata(false, new PropertyChangedCallback(AutoSizePropertyyChanged))); |
|
27 |
|
|
28 |
private static void AutoSizePropertyyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) |
|
29 |
{ |
|
30 |
var control = (FrameworkElement)d; |
|
31 |
|
|
32 |
if (control != null && !App.IsDesignMode) |
|
33 |
{ |
|
34 |
if (GetAutoSize(control)) |
|
35 |
{ |
|
36 |
Binding widthBinding = new Binding(); |
|
37 |
widthBinding.Path = new PropertyPath(FrameworkElement.ActualWidthProperty); |
|
38 |
widthBinding.Source = control.Parent; |
|
39 |
widthBinding.Mode = BindingMode.OneWay; |
|
40 |
control.SetBinding(FrameworkElement.WidthProperty, widthBinding); |
|
41 |
|
|
42 |
Binding hegihtBinding = new Binding(); |
|
43 |
hegihtBinding.Path = new PropertyPath(FrameworkElement.ActualHeightProperty); |
|
44 |
hegihtBinding.Source = control.Parent; |
|
45 |
hegihtBinding.Mode = BindingMode.OneWay; |
|
46 |
control.SetBinding(FrameworkElement.HeightProperty, hegihtBinding); |
|
47 |
} |
|
48 |
} |
|
49 |
|
|
50 |
} |
|
51 |
} |
|
52 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/Behaviors/StatusTypeSet.cs | ||
---|---|---|
37 | 37 |
{ |
38 | 38 |
|
39 | 39 |
} |
40 |
|
|
41 |
public List<StatusCodeType> StatusTypes |
|
42 |
{ |
|
43 |
get { return (List<StatusCodeType>)GetValue(StatusTypesProperty); } |
|
44 |
set { SetValue(StatusTypesProperty, value); } |
|
45 |
} |
|
46 | 40 |
} |
47 | 41 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/Controls/ITraceTextSink.cs | ||
---|---|---|
3 | 3 |
using System.Linq; |
4 | 4 |
using System.Diagnostics; |
5 | 5 |
|
6 |
namespace Markus.Service.Controls |
|
6 |
namespace Markus.Service.StationController.Controls
|
|
7 | 7 |
{ |
8 | 8 |
interface ITraceTextSink |
9 | 9 |
{ |
ConvertService/ServiceBase/Markus.Service.StationController/Controls/RowIndexColumn.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using System.Windows; |
|
7 |
using System.Windows.Controls; |
|
8 |
|
|
9 |
namespace Markus.Service.StationController.Controls |
|
10 |
{ |
|
11 |
public class RowIndexColumn : Telerik.Windows.Controls.GridViewColumn |
|
12 |
{ |
|
13 |
public override FrameworkElement CreateCellElement(Telerik.Windows.Controls.GridView.GridViewCell cell, object dataItem) |
|
14 |
{ |
|
15 |
TextBlock textBlock = cell.Content as TextBlock; |
|
16 |
|
|
17 |
if (textBlock == null) |
|
18 |
{ |
|
19 |
textBlock = new TextBlock(); |
|
20 |
} |
|
21 |
|
|
22 |
textBlock.Text = string.Format("{0}", this.DataControl.Items.IndexOf(dataItem) + 1); |
|
23 |
|
|
24 |
return textBlock; |
|
25 |
} |
|
26 |
|
|
27 |
protected override void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs args) |
|
28 |
{ |
|
29 |
base.OnPropertyChanged(args); |
|
30 |
|
|
31 |
if (args.PropertyName == "DataControl") |
|
32 |
{ |
|
33 |
if (this.DataControl != null && this.DataControl.Items != null) |
|
34 |
{ |
|
35 |
this.DataControl.Items.CollectionChanged += (s, e) => |
|
36 |
{ |
|
37 |
if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) |
|
38 |
{ |
|
39 |
this.Refresh(); |
|
40 |
} |
|
41 |
}; |
|
42 |
} |
|
43 |
} |
|
44 |
} |
|
45 |
} |
|
46 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/Controls/TraceDocument.xaml | ||
---|---|---|
1 |
<FlowDocument x:Class="Markus.Service.Controls.TraceDocument" |
|
1 |
<FlowDocument x:Class="Markus.Service.StationController.Controls.TraceDocument"
|
|
2 | 2 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | 3 |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
4 | 4 |
FontSize="12" FontFamily="Courier New" PageWidth="10000" Loaded="Document_Loaded" Unloaded="Document_Unloaded"> |
ConvertService/ServiceBase/Markus.Service.StationController/Controls/TraceDocument.xaml.cs | ||
---|---|---|
5 | 5 |
using System.Diagnostics; |
6 | 6 |
using System.Windows.Controls.Primitives; |
7 | 7 |
|
8 |
namespace Markus.Service.Controls |
|
8 |
namespace Markus.Service.StationController.Controls
|
|
9 | 9 |
{ |
10 | 10 |
public partial class TraceDocument : FlowDocument, ITraceTextSink |
11 | 11 |
{ |
ConvertService/ServiceBase/Markus.Service.StationController/Controls/TraceTextSource.cs | ||
---|---|---|
1 | 1 |
using System; |
2 | 2 |
using System.Diagnostics; |
3 | 3 |
|
4 |
namespace Markus.Service.Controls |
|
4 |
namespace Markus.Service.StationController.Controls
|
|
5 | 5 |
{ |
6 | 6 |
class TraceTextSource : TraceListener |
7 | 7 |
{ |
ConvertService/ServiceBase/Markus.Service.StationController/Extensions/VisualTreeHelper.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using System.Windows; |
|
7 |
|
|
8 |
namespace Markus.Service |
|
9 |
{ |
|
10 |
public static class VisualTreeHelperEx |
|
11 |
{ |
|
12 |
public static IEnumerable<T> FindLogicalChildren<T>(DependencyObject obj) where T : DependencyObject |
|
13 |
{ |
|
14 |
if (obj != null) |
|
15 |
{ |
|
16 |
if (obj is T) |
|
17 |
yield return obj as T; |
|
18 |
|
|
19 |
foreach (DependencyObject child in LogicalTreeHelper.GetChildren(obj).OfType<DependencyObject>()) |
|
20 |
foreach (T c in FindLogicalChildren<T>(child)) |
|
21 |
yield return c; |
|
22 |
} |
|
23 |
} |
|
24 |
} |
|
25 |
} |
ConvertService/ServiceBase/Markus.Service.StationController/MainWindow.xaml | ||
---|---|---|
69 | 69 |
</Grid> |
70 | 70 |
</DockPanel> |
71 | 71 |
</materialDesign:ColorZone> |
72 |
<Grid Grid.Row="1"> |
|
72 |
<!--<Grid Grid.Row="1">
|
|
73 | 73 |
<Grid.RowDefinitions> |
74 |
<RowDefinition Height="Auto" /> |
|
75 | 74 |
<RowDefinition Height="*" /> |
76 |
</Grid.RowDefinitions> |
|
77 |
<ScrollViewer Grid.Row="1"
|
|
75 |
</Grid.RowDefinitions>-->
|
|
76 |
<!--<ScrollViewer Grid.Row="1" Width="{Binding ActualWidth, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
|
|
78 | 77 |
HorizontalScrollBarVisibility="Auto" |
79 |
VerticalScrollBarVisibility="Auto"> |
|
80 |
<ContentControl Content="{Binding SelectNavigationItem.Content}"/>
|
|
81 |
</ScrollViewer>
|
|
82 |
</Grid>
|
|
78 |
VerticalScrollBarVisibility="Auto">-->
|
|
79 |
<ContentControl Grid.Row="1" Content="{Binding SelectNavigationItem.Content}"/>
|
|
80 |
<!--</ScrollViewer>-->
|
|
81 |
<!--</Grid>-->
|
|
83 | 82 |
</Grid> |
84 | 83 |
</materialDesign:DrawerHost> |
85 | 84 |
</materialDesign:DialogHost> |
ConvertService/ServiceBase/Markus.Service.StationController/Markus.Service.StationController.csproj | ||
---|---|---|
138 | 138 |
</ApplicationDefinition> |
139 | 139 |
<Compile Include="AppInit.cs" /> |
140 | 140 |
<Compile Include="AppDefine.cs" /> |
141 |
<Compile Include="Behaviors\AutoSizeBehaviors.cs" /> |
|
141 | 142 |
<Compile Include="Behaviors\RichTextBoxBehaviors.cs" /> |
142 | 143 |
<Compile Include="Behaviors\StatusTypeSet.cs" /> |
143 | 144 |
<Compile Include="Controls\ITraceTextSink.cs" /> |
145 |
<Compile Include="Controls\RowIndexColumn.cs" /> |
|
144 | 146 |
<Compile Include="Controls\TraceDocument.xaml.cs"> |
145 | 147 |
<DependentUpon>TraceDocument.xaml</DependentUpon> |
146 | 148 |
</Compile> |
... | ... | |
148 | 150 |
<Compile Include="Data\NavigationItem.cs" /> |
149 | 151 |
<Compile Include="Extensions\ConvertItemChangeValue.cs" /> |
150 | 152 |
<Compile Include="Extensions\GetStatusTypeEnums.cs" /> |
153 |
<Compile Include="Extensions\VisualTreeHelper.cs" /> |
|
151 | 154 |
<Compile Include="ViewModel\DataBaseByStatusViewModel.cs" /> |
152 | 155 |
<Compile Include="ViewModel\AliveViewModel.cs" /> |
153 | 156 |
<Compile Include="ViewModel\MainViewModel.cs" /> |
ConvertService/ServiceBase/Markus.Service.StationController/Themes/TelerikTheme.xaml | ||
---|---|---|
11 | 11 |
<Style TargetType="telerik:RadGridView"> |
12 | 12 |
<Setter Property="ShowGroupPanel" Value="False"/> |
13 | 13 |
</Style> |
14 |
<Style x:Key="RowNumberStyle" |
|
15 |
TargetType="telerik:GridViewCell" |
|
16 |
BasedOn="{StaticResource GridViewCellStyle}"> |
|
17 |
<Setter Property="Background" |
|
18 |
Value="{telerik:Windows8Resource ResourceKey=AccentBrush}" /> |
|
19 |
<Setter Property="Foreground" |
|
20 |
Value="{telerik:Windows8Resource ResourceKey=MainBrush}" /> |
|
21 |
</Style> |
|
14 | 22 |
</ResourceDictionary> |
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/AliveViewModel.cs | ||
---|---|---|
111 | 111 |
} |
112 | 112 |
} |
113 | 113 |
|
114 |
ItemsUpdate(newitems);
|
|
114 |
await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => ItemsUpdate(newitems));
|
|
115 | 115 |
} |
116 | 116 |
catch (Exception ex) |
117 | 117 |
{ |
... | ... | |
167 | 167 |
|
168 | 168 |
if (newitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0) |
169 | 169 |
{ |
170 |
AliveItems.RemoveAt(i); |
|
170 |
try |
|
171 |
{ |
|
172 |
AliveItems.RemoveAt(i); |
|
173 |
} |
|
174 |
catch (Exception ex) |
|
175 |
{ |
|
176 |
System.Diagnostics.Debug.WriteLine(ex.ToString()); |
|
177 |
} |
|
171 | 178 |
} |
172 | 179 |
} |
173 | 180 |
} |
... | ... | |
222 | 229 |
{ |
223 | 230 |
base.Loaded(); |
224 | 231 |
|
225 |
if (!IsDesignMode) |
|
232 |
if (!App.IsDesignMode)
|
|
226 | 233 |
{ |
227 | 234 |
backgroundWorker = new BackgroundWorker(); |
228 | 235 |
backgroundWorker.DoWork += backgroundWorker_DoWork; |
ConvertService/ServiceBase/Markus.Service.StationController/ViewModel/DataBaseByStatusViewModel.cs | ||
---|---|---|
149 | 149 |
{ |
150 | 150 |
base.Loaded(); |
151 | 151 |
|
152 |
if (!IsDesignMode) |
|
152 |
if (!App.IsDesignMode)
|
|
153 | 153 |
{ |
154 | 154 |
backgroundWorker = new BackgroundWorker(); |
155 | 155 |
backgroundWorker.DoWork += backgroundWorker_DoWork; |
... | ... | |
163 | 163 |
|
164 | 164 |
public override void Closed() |
165 | 165 |
{ |
166 |
if (!IsDesignMode) |
|
166 |
if (!App.IsDesignMode)
|
|
167 | 167 |
{ |
168 | 168 |
backgroundWorker.DoWork -= backgroundWorker_DoWork; |
169 | 169 |
backgroundWorker.RunWorkerCompleted -= backgroundWorker_RunWorkerCompleted; |
ConvertService/ServiceBase/Markus.Service.StationController/Views/AliveView.xaml | ||
---|---|---|
8 | 8 |
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" |
9 | 9 |
xmlns:vm="clr-namespace:Markus.Service.StationController.ViewModel" |
10 | 10 |
xmlns:Behaviors="clr-namespace:Markus.Service.StationController.Behaviors" |
11 |
xmlns:controls="clr-namespace:Markus.Service.Controls" Background="White" |
|
11 |
xmlns:controls="clr-namespace:Markus.Service.StationController.Controls" |
|
12 |
Background="White" |
|
12 | 13 |
d:DesignHeight="800" d:DesignWidth="800"> |
13 | 14 |
<UserControl.DataContext> |
14 | 15 |
<vm:AliveViewModel/> |
... | ... | |
23 | 24 |
</i:Interaction.Triggers> |
24 | 25 |
<Grid> |
25 | 26 |
<Grid.RowDefinitions> |
27 |
<RowDefinition Height="Auto"/> |
|
26 | 28 |
<RowDefinition Height="7*"/> |
27 |
<RowDefinition Height="3*" MinHeight="150" MaxHeight="300"/>
|
|
29 |
<RowDefinition Height="Auto" MinHeight="150" MaxHeight="200"/>
|
|
28 | 30 |
<RowDefinition Height="Auto"/> |
29 | 31 |
</Grid.RowDefinitions> |
30 |
<telerik:RadGridView ItemsSource="{Binding AliveItems}" AutoGenerateColumns="False" |
|
32 |
<Grid> |
|
33 |
<Grid.RowDefinitions> |
|
34 |
<RowDefinition Height="Auto"/> |
|
35 |
<RowDefinition Height="Auto"/> |
|
36 |
</Grid.RowDefinitions> |
|
37 |
<Grid.ColumnDefinitions> |
|
38 |
<ColumnDefinition Width="Auto"/> |
|
39 |
<ColumnDefinition Width="Auto"/> |
|
40 |
</Grid.ColumnDefinitions> |
|
41 |
</Grid> |
|
42 |
<Grid> |
|
43 |
<Grid.ColumnDefinitions> |
|
44 |
<ColumnDefinition/> |
|
45 |
<ColumnDefinition/> |
|
46 |
<ColumnDefinition/> |
|
47 |
<ColumnDefinition/> |
|
48 |
<ColumnDefinition/> |
|
49 |
</Grid.ColumnDefinitions> |
|
50 |
<GroupBox Header="" Margin="3" BorderThickness="0"> |
|
51 |
<TextBlock/> |
|
52 |
</GroupBox> |
|
53 |
<GroupBox Header="" Grid.Column="1" Margin="3" BorderThickness="0"> |
|
54 |
<TextBlock/> |
|
55 |
</GroupBox> |
|
56 |
<GroupBox Header="" Grid.Column="2" Margin="3" BorderThickness="0"> |
|
57 |
<TextBlock/> |
|
58 |
</GroupBox> |
|
59 |
<GroupBox Header="" Grid.Column="3" Margin="3" BorderThickness="0"> |
|
60 |
<TextBlock/> |
|
61 |
</GroupBox> |
|
62 |
<GroupBox Header="" Grid.Column="4" Margin="3" BorderThickness="0"> |
|
63 |
<TextBlock/> |
|
64 |
</GroupBox> |
|
65 |
</Grid> |
|
66 |
<GroupBox Grid.Row="1" |
|
67 |
Header="Alive Items" Margin="3" BorderThickness="0" |
|
68 |
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"> |
|
69 |
<telerik:RadGridView ItemsSource="{Binding AliveItems}" AutoGenerateColumns="False" |
|
31 | 70 |
x:Name="DataGrid" ScrollViewer.CanContentScroll="False"> |
32 |
<telerik:RadGridView.Columns> |
|
33 |
<telerik:GridViewDataColumn Header="Service ID" DataMemberBinding="{Binding ServiceID}"/> |
|
34 |
<telerik:GridViewDataColumn Header="Convert ID" DataMemberBinding="{Binding ConvertID}"/> |
|
35 |
<telerik:GridViewDataColumn Header="Project No" DataMemberBinding="{Binding ProjectNumber}"/> |
|
36 |
<telerik:GridViewDataColumn Header="Status" DataMemberBinding="{Binding ConvertState}"/> |
|
37 |
<telerik:GridViewDataColumn Header="Current Page" DataMemberBinding="{Binding CurrentPageNo}"/> |
|
38 |
<telerik:GridViewDataColumn Header="TotalPage" DataMemberBinding="{Binding TotalPage}"/> |
|
39 |
<telerik:GridViewDataColumn Header="Originfile" DataMemberBinding="{Binding OriginfilePath}"/> |
|
40 |
<telerik:GridViewDataColumn Header="Output Path" DataMemberBinding="{Binding ConvertPath}"/> |
|
41 |
</telerik:RadGridView.Columns> |
|
42 |
</telerik:RadGridView> |
|
71 |
<telerik:RadGridView.Columns> |
|
72 |
<controls:RowIndexColumn Header="#" Width="30" CellStyle="{StaticResource RowNumberStyle}" /> |
|
73 |
<telerik:GridViewDataColumn Header="Service ID" DataMemberBinding="{Binding ServiceID}"/> |
|
74 |
<telerik:GridViewDataColumn Header="Convert ID" DataMemberBinding="{Binding ConvertID}"/> |
|
75 |
<telerik:GridViewDataColumn Header="Project No" DataMemberBinding="{Binding ProjectNumber}"/> |
|
76 |
<telerik:GridViewDataColumn Header="Status" DataMemberBinding="{Binding ConvertState}"/> |
|
77 |
<telerik:GridViewDataColumn Header="Current Page" DataMemberBinding="{Binding CurrentPageNo}"/> |
|
78 |
<telerik:GridViewDataColumn Header="TotalPage" DataMemberBinding="{Binding TotalPage}"/> |
|
79 |
<telerik:GridViewDataColumn Header="Originfile" DataMemberBinding="{Binding OriginfilePath}"/> |
|
80 |
<telerik:GridViewDataColumn Header="Output Path" DataMemberBinding="{Binding ConvertPath}"/> |
|
81 |
</telerik:RadGridView.Columns> |
|
82 |
</telerik:RadGridView> |
|
83 |
</GroupBox> |
|
43 | 84 |
<!--<GroupBox Header="ServiceStation Connection Log" Background="White" Grid.Row="1" Margin="3" BorderThickness="0">--> |
44 |
<Grid Grid.Row="1">
|
|
85 |
<Grid Grid.Row="2">
|
|
45 | 86 |
<RichTextBox IsReadOnly="True" AllowDrop="False" VerticalScrollBarVisibility="Visible" |
46 | 87 |
IsUndoEnabled="False" HorizontalScrollBarVisibility="Auto" |
47 | 88 |
Height="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}}" |
... | ... | |
51 | 92 |
</RichTextBox> |
52 | 93 |
</Grid> |
53 | 94 |
<!--</GroupBox>--> |
54 |
<ProgressBar Grid.Row="2" IsIndeterminate="{Binding IsLoading}" Height="5"/>
|
|
95 |
<ProgressBar Grid.Row="3" IsIndeterminate="{Binding IsLoading}" Height="5"/>
|
|
55 | 96 |
</Grid> |
56 | 97 |
</UserControl> |
내보내기 Unified diff