개정판 702abd98
fixed issue #540: Place 버튼을 눌러 심볼 생성
KCOM/Controls/Symbol.xaml | ||
---|---|---|
50 | 50 |
</Grid.RowDefinitions> |
51 | 51 |
|
52 | 52 |
<StackPanel Grid.Row="0" Orientation="Vertical"> |
53 |
<!--<TextBlock Text="Symbol" FontSize="15"/>--> |
|
54 | 53 |
<Grid Margin="0,10"> |
55 | 54 |
<Grid.ColumnDefinitions> |
56 | 55 |
<ColumnDefinition Width="3*"/> |
... | ... | |
61 | 60 |
<Button Content="Register" Grid.Column="1" Click="Create_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/> |
62 | 61 |
<Button Content="Rename" Grid.Column="2" Click="Rename_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/> |
63 | 62 |
<Button Content="Remove" Grid.Column="3" Click="Remove_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/> |
64 |
|
|
65 |
<!--<Button Content="Register" Grid.Column="1" Click="Create_Symbol" Margin="5,0,0,0" Padding="5" Background="#3d3d3d" Foreground="White"/> |
|
66 |
<Button Content="Rename" Grid.Column="2" Click="Rename_Symbol" Margin="5,0,0,0" Padding="5" Background="#3d3d3d" Foreground="White"/> |
|
67 |
<Button Content="Remove" Grid.Column="3" Click="Remove_Symbol" Margin="5,0,0,0" Padding="5" Background="#3d3d3d" Foreground="White"/>--> |
|
68 | 63 |
</Grid> |
69 |
<TextBlock Text="[Tip : Double Click]" FontSize="10" HorizontalAlignment="Right"/> |
|
64 |
<Grid Margin="0,10"> |
|
65 |
<Grid.ColumnDefinitions> |
|
66 |
<ColumnDefinition Width="1*"/> |
|
67 |
<ColumnDefinition Width="3*"/> |
|
68 |
</Grid.ColumnDefinitions> |
|
69 |
<Button Content="Place" Click="Place_Symbol" Grid.Column="0" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/> |
|
70 |
<TextBlock Text="[Tip : Double Click]" Grid.Column="1" FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
|
71 |
</Grid> |
|
70 | 72 |
</StackPanel> |
71 | 73 |
<ScrollViewer x:Name="ScView" Grid.Row="1" > |
72 | 74 |
<ListBox x:Name="lstSymbolPrivate" Background="#f5f5f5" FontWeight="Normal" ItemTemplate="{StaticResource SymbolTemplate_Private}" |
... | ... | |
77 | 79 |
<telerik:ListBoxDragDrop.Behavior> |
78 | 80 |
<telerik:ListBoxDragDropBehavior AllowReorder="True" /> |
79 | 81 |
</telerik:ListBoxDragDrop.Behavior> |
80 |
|
|
81 |
<!--<ListBox.ItemsPanel> |
|
82 |
<ItemsPanelTemplate> |
|
83 |
<WrapPanel:WrapPanel /> |
|
84 |
</ItemsPanelTemplate> |
|
85 |
</ListBox.ItemsPanel>--> |
|
86 |
<!--<telerik:ListBoxDragDrop></telerik:ListBoxDragDrop>--> |
|
82 |
|
|
87 | 83 |
</ListBox> |
88 | 84 |
</ScrollViewer> |
89 | 85 |
</Grid> |
... | ... | |
97 | 93 |
</Grid.RowDefinitions> |
98 | 94 |
|
99 | 95 |
<StackPanel Grid.Row="0" Orientation="Vertical"> |
100 |
<!--<TextBlock Text="Symbol" FontSize="15"/>--> |
|
101 | 96 |
<Grid Margin="0,10"> |
102 | 97 |
<Grid.ColumnDefinitions> |
103 | 98 |
<ColumnDefinition Width="1*"/> |
104 | 99 |
<ColumnDefinition Width="3*"/> |
105 | 100 |
</Grid.ColumnDefinitions> |
106 |
<!--<Button Content="Register" Grid.Column="1" Click="Create_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/> |
|
107 |
<Button Content="Rename" Grid.Column="2" Click="Rename_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/> |
|
108 |
<Button Content="Remove" Grid.Column="3" Click="Remove_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/>--> |
|
109 |
|
|
110 |
<!--<Button Content="Register" Grid.Column="1" Click="Create_Symbol" Margin="5,0,0,0" Padding="5" Background="#3d3d3d" Foreground="White"/> |
|
111 |
<Button Content="Rename" Grid.Column="2" Click="Rename_Symbol" Margin="5,0,0,0" Padding="5" Background="#3d3d3d" Foreground="White"/> |
|
112 |
<Button Content="Remove" Grid.Column="3" Click="Remove_Symbol" Margin="5,0,0,0" Padding="5" Background="#3d3d3d" Foreground="White"/>--> |
|
101 |
|
|
113 | 102 |
<TextBlock VerticalAlignment="Center">Department</TextBlock> |
114 | 103 |
<telerik:RadComboBox EmptyText="ALL" Grid.Column="1" HorizontalAlignment="Stretch" Margin="5" DropDownWidth="*" Background="White" BorderBrush="#d6d6d6" x:Name="deptlist" |
115 | 104 |
ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="Show All" SelectionChanged="deptlist_SelectionChanged"/> |
116 | 105 |
|
117 | 106 |
</Grid> |
118 |
<TextBlock Text="[Tip : Double Click]" FontSize="10" HorizontalAlignment="Right"/> |
|
107 |
<Grid Margin="0,10"> |
|
108 |
<Grid.ColumnDefinitions> |
|
109 |
<ColumnDefinition Width="1*"/> |
|
110 |
<ColumnDefinition Width="3*"/> |
|
111 |
</Grid.ColumnDefinitions> |
|
112 |
<Button Content="Place" Grid.Column="0" Click="Remove_Symbol" Margin="5,0,0,0" FontWeight="Normal" Padding="5" Background="#3d3d3d" Foreground="White"/> |
|
113 |
<TextBlock Text="[Tip : Double Click]" Grid.Column="1" FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
|
114 |
</Grid> |
|
119 | 115 |
</StackPanel> |
120 | 116 |
<ScrollViewer x:Name="ScView_Public" Grid.Row="1" > |
121 | 117 |
<ListBox x:Name="lstSymbolPublic" Background="#f5f5f5" FontWeight="Normal" ItemTemplate="{StaticResource SymbolTemplate_Private}" MouseDoubleClick="Move_Symbol" PreviewMouseWheel ="lstSymbolPublic_PreviewMouseWheel"> |
122 | 118 |
<telerik:ListBoxDragDrop.Behavior> |
123 | 119 |
<telerik:ListBoxDragDropBehavior AllowReorder="True" /> |
124 | 120 |
</telerik:ListBoxDragDrop.Behavior> |
125 |
<!--<ListBox.ItemsPanel> |
|
126 |
<ItemsPanelTemplate> |
|
127 |
<WrapPanel:WrapPanel /> |
|
128 |
</ItemsPanelTemplate> |
|
129 |
</ListBox.ItemsPanel>--> |
|
130 |
<!--<telerik:ListBoxDragDrop></telerik:ListBoxDragDrop>--> |
|
131 | 121 |
</ListBox> |
132 | 122 |
</ScrollViewer> |
133 | 123 |
</Grid> |
KCOM/Controls/Symbol.xaml.cs | ||
---|---|---|
290 | 290 |
} |
291 | 291 |
#endregion |
292 | 292 |
|
293 |
#region Symbol DoubleClick Event |
|
294 |
private void Move_Symbol(object sender, MouseButtonEventArgs e) |
|
293 |
/// <summary> |
|
294 |
/// place symbol which has given id to original position which is created |
|
295 |
/// </summary> |
|
296 |
/// <date>2018.06.14</date> |
|
297 |
/// <param name="id"></param> |
|
298 |
private void PlaceSymbol(string id) |
|
295 | 299 |
{ |
296 |
moveItem_id = ((e.OriginalSource as Image).DataContext as Symbol_Custom).ID; |
|
297 |
|
|
298 |
IsMouseDown = true; |
|
300 |
string Data_ = ""; |
|
299 | 301 |
|
300 |
if (e.ClickCount > 1)
|
|
302 |
try
|
|
301 | 303 |
{ |
302 |
//string moveItem_id = ((e.Source as ListBox).SelectedItem as Symbol_Custom).ID; |
|
303 |
string Data_ = ""; |
|
304 |
|
|
305 | 304 |
using (KCOMEntities Entity = new KCOMEntities(ConnectStringBuilder.KCOMConnectionString().ToString())) |
306 | 305 |
{ |
307 | 306 |
if (RadTab.SelectedIndex == 0) |
308 |
Data_ = Entity.SYMBOL_PRIVATE.Where(data => data.ID == moveItem_id).FirstOrDefault().DATA;
|
|
307 |
Data_ = Entity.SYMBOL_PRIVATE.Where(data => data.ID == id).FirstOrDefault().DATA; |
|
309 | 308 |
else |
310 |
Data_ = Entity.SYMBOL_PUBLIC.Where(data => data.ID == moveItem_id).FirstOrDefault().DATA;
|
|
309 |
Data_ = Entity.SYMBOL_PUBLIC.Where(data => data.ID == id).FirstOrDefault().DATA; |
|
311 | 310 |
} |
312 | 311 |
|
313 | 312 |
if (Data_.Contains("|DZ|")) |
... | ... | |
335 | 334 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
336 | 335 |
} |
337 | 336 |
} |
337 |
catch(Exception ex) |
|
338 |
{ |
|
339 |
this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message, "Error"); |
|
340 |
} |
|
341 |
} |
|
342 |
|
|
343 |
#region Symbol DoubleClick Event |
|
344 |
private void Move_Symbol(object sender, MouseButtonEventArgs e) |
|
345 |
{ |
|
346 |
string id = ((e.OriginalSource as Image).DataContext as Symbol_Custom).ID; |
|
347 |
IsMouseDown = true; |
|
348 |
if (e.ClickCount > 1) |
|
349 |
{ |
|
350 |
this.PlaceSymbol(id); |
|
351 |
} |
|
338 | 352 |
} |
339 | 353 |
#endregion |
340 | 354 |
|
... | ... | |
443 | 457 |
{ |
444 | 458 |
IsMouseDown = false; |
445 | 459 |
} |
460 |
|
|
461 |
/// <summary> |
|
462 |
/// place symbol which user select |
|
463 |
/// </summary> |
|
464 |
/// <author>humkyung</author> |
|
465 |
/// <date>2018.06.14</date> |
|
466 |
/// <param name="sender"></param> |
|
467 |
/// <param name="e"></param> |
|
468 |
private void Place_Symbol(object sender, RoutedEventArgs e) |
|
469 |
{ |
|
470 |
if (lstSymbolPrivate.SelectedItem == null) |
|
471 |
{ |
|
472 |
DialogMessage_Alert("Please Select Symbol", "Alert"); |
|
473 |
return; |
|
474 |
} |
|
475 |
|
|
476 |
string id = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID; |
|
477 |
this.PlaceSymbol(id); |
|
478 |
} |
|
446 | 479 |
} |
447 | 480 |
} |
내보내기 Unified diff