프로젝트

일반

사용자정보

개정판 c362d2a5

IDc362d2a5883b88b0724f1aef49b7c3061801b381
상위 e77fc685
하위 68e3cd94

김태성이(가) 4년 이상 전에 추가함

종료시 저장여부 Confirm 수정 Yes/No/Cancel
MainWindow 위치 수정

Change-Id: Ia539e64f2b134bdc9cbf66d6746cef9ecd5416f0

차이점 보기:

KCOM/App.xaml
10 10
                <ResourceDictionary Source="/Telerik.Windows.Controls;component/Themes/FontResources.xaml"/>
11 11
                <ResourceDictionary Source="Resources\Theme_Color.xaml"/>
12 12
                <ResourceDictionary Source="Resources\WindowStyle.xaml"/>
13
                <ResourceDictionary Source="Resources\RadConfirmStyle.xaml"/>
13 14
                <ResourceDictionary Source="Resources\DecodeImageTemplate.xaml"/>
14 15
                <ResourceDictionary Source="Resources\Theme_CustomControl.xaml"/>
15 16
                <ResourceDictionary Source="Resources\SimpleLIstViewStyle.xaml"/>
KCOM/Controls/CustomWindow.cs
149 149
                    {
150 150
                        win.Left = screen.WorkingArea.X;
151 151
                        win.Width = screen.WorkingArea.Width;
152
                        win.Top = 0;
152
                        win.Top = 0 + screen.Bounds.Y;
153 153
                        win.Height = screen.WorkingArea.Height;
154 154
                    });
155 155
                }
KCOM/KCOM.csproj
698 698
      <SubType>Designer</SubType>
699 699
      <Generator>MSBuild:Compile</Generator>
700 700
    </Page>
701
    <Page Include="Resources\RadConfirmStyle.xaml">
702
      <SubType>Designer</SubType>
703
      <Generator>MSBuild:Compile</Generator>
704
    </Page>
701 705
    <Page Include="Resources\RadPasswordPromptStyle.xaml">
702 706
      <SubType>Designer</SubType>
703 707
      <Generator>MSBuild:Compile</Generator>
KCOM/MainWindow.xaml.cs
46 46

  
47 47
        public MainWindow()
48 48
        {
49

  
49 50
            App.splashString(ISplashMessage.MAINWINDOW);
51

  
50 52
            this.Loaded += MainWindow_Loaded;
51 53
            this.Unloaded += MainWindow_Unloaded;
52 54
            //this.PreviewKeyDown += new KeyEventHandler(KeyEventDownAction);
......
69 71

  
70 72
        public void DialogMessage_Alert(string content, string header)
71 73
        {
74
            App.splashScreen.Close();
75

  
72 76
            Telerik.Windows.Controls.DialogParameters parameters = new Telerik.Windows.Controls.DialogParameters()
73 77
            {
74 78
                Owner = Application.Current.MainWindow,
......
95 99

  
96 100
            var point = GetScreenCenter();
97 101

  
98
            this.Left = point.X;
99
            this.Top = point.Y;
102
            //this.Left = point.X;
103
            //this.Top = point.Y;
100 104

  
101 105
            ViewerDataModel.Instance.SystemMain = this;
102 106

  
......
231 235

  
232 236
            if(!SaveCheck())
233 237
            {
234
                if(SaveConfirm())
235
                {
236
                    dzTopMenu.SaveEventCallback(null, null);
237
                }
238
                else
238
                var IsConfirm = SaveConfirm();
239

  
240
                if (IsConfirm == null)
239 241
                {
240 242
                    e.Cancel = true;
241 243
                }
244
                else if(IsConfirm == true)
245
                { 
246
                    dzTopMenu.SaveEventCallback(null, null);
247
                }
242 248
            }
243 249

  
244 250
            //Update Check 를 통해 update url 을 Get 하고 결과값이 있을 경우에는 SmartUpdater 실행.
......
279 285
            return result;
280 286
        }
281 287

  
282
        private bool SaveConfirm()
288
        private bool? SaveConfirm()
283 289
        {
284
            bool result = false;
290
            bool? result = null;
285 291

  
286 292
            EventHandler<WindowClosedEventArgs> Closedhandler = null;
287 293

  
288 294
            Closedhandler = (snd, evt) =>
289 295
            {
290
                result = evt.DialogResult.GetValueOrDefault();
296
                result = evt.DialogResult;
291 297
            };
292 298

  
293

  
294 299
            DialogParameters parameters = new DialogParameters()
295 300
            {
296
                Owner = Application.Current.MainWindow,
297 301
                Content = new TextBlock()
298 302
                {
299
                    MinWidth = 400,
303
                    MinWidth = 300,
300 304
                    FontSize = 11,
301 305
                    Text = "Found unsaved comments. Save now?",
302 306
                    TextWrapping = System.Windows.TextWrapping.Wrap
303 307
                },
308

  
304 309
                Header = "Confirm",
305 310
                Theme = new VisualStudio2013Theme(),
311
                ContentStyle = Application.Current.Resources["RadConfirmYNCStyle"] as Style,
306 312
                ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
313

  
314
                Owner = Application.Current.MainWindow,
315
                Opened = (s, openedEvent) =>
316
                {
317
                    RadWindow confirm = s as RadWindow;
318
                    //Button Cancel = confirm.ChildrenOfType<Button>()[5];
319
                    //FocusManager.SetIsFocusScope(confirm, true);
320
                    //FocusManager.SetFocusedElement(confirm, Cancel);
321
                },
322

  
307 323
                Closed = Closedhandler
308 324
            };
309 325

  
......
312 328
            return result;
313 329
        }
314 330

  
331

  
315 332
        private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
316 333
        {
317 334
            Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate
KCOM/Resources/RadConfirmStyle.xaml
1
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
3
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
4
    <!-- telerikNavigation:RadConfirm -->
5
    <telerik:VisualStudio2013Theme x:Key="Theme" />
6
    <SolidColorBrush x:Key="BorderLineOuterColor" Color="#26000000" />
7
    <SolidColorBrush x:Key="BorderLineInnerColor" Color="#FFFFFFFF" />
8
    <Style TargetType="telerik:RadConfirm" x:Key="RadConfirmYNCStyle">
9
        <Setter Property="IsTabStop" Value="False"/>
10
        <Setter Property="MinWidth" Value="275"/>
11
        <Setter Property="MaxWidth" Value="500"/>
12
        <Setter Property="SnapsToDevicePixels" Value="True"/>
13
        <Setter Property="Template">
14
            <Setter.Value>
15
                <ControlTemplate TargetType="{x:Type telerik:RadConfirm}">
16
                    <Grid x:Name="LayoutRoot">
17
                        <Grid.ColumnDefinitions>
18
                            <ColumnDefinition Width="Auto"/>
19
                            <ColumnDefinition Width="*"/>
20
                        </Grid.ColumnDefinitions>
21
                        <Grid.RowDefinitions>
22
                            <RowDefinition Height="*"/>
23
                            <RowDefinition Height="Auto"/>
24
                        </Grid.RowDefinitions>
25
                        <ContentPresenter x:Name="Icon" Content="{TemplateBinding Content}" Margin="16,8,8,8" VerticalAlignment="Top">
26
                            <ContentPresenter.ContentTemplate>
27
                                <DataTemplate>
28
                                    <Grid Height="44" Width="44">
29
                                        <Ellipse Width="44">
30
                                            <Ellipse.Fill>
31
                                                <LinearGradientBrush EndPoint="0.718,0.95" StartPoint="0.282,0.05">
32
                                                    <GradientStop Color="#FF67A1F4" Offset="0.107"/>
33
                                                    <GradientStop Color="#FF1660C0" Offset="0.691"/>
34
                                                </LinearGradientBrush>
35
                                            </Ellipse.Fill>
36
                                        </Ellipse>
37
                                        <Path Data="M289.00311,92.619354C289.00311,92.619354 299.31836,80.597733 329.41049,81.075485 329.88766,81.083061 332.65619,107.10075 308.88998,107.10075 296.08267,107.10075 289.00311,92.619354 289.00311,92.619354z" Margin="1.512,16.495,0.765,0.399" Stretch="Fill">
38
                                            <Path.Fill>
39
                                                <LinearGradientBrush EndPoint="0.61,0.964" StartPoint="0.39,0.036">
40
                                                    <GradientStop Color="#FF1660C0" Offset="0"/>
41
                                                    <GradientStop Color="#FF084EAB" Offset="1"/>
42
                                                </LinearGradientBrush>
43
                                            </Path.Fill>
44
                                        </Path>
45
                                        <Ellipse Margin="1,1,0,0" Stroke="#FF9AC2FA">
46
                                            <Ellipse.OpacityMask>
47
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
48
                                                    <GradientStop Color="#7C1D99EC" Offset="0"/>
49
                                                    <GradientStop Color="#7EAFDDFC" Offset="1"/>
50
                                                    <GradientStop Color="#C45EB6F1" Offset="0.382"/>
51
                                                </LinearGradientBrush>
52
                                            </Ellipse.OpacityMask>
53
                                        </Ellipse>
54
                                        <Path Data="M300.16647,72.508377L300.20032,76.801308C300.20032,76.801308 303.76443,74.208626 308.57635,75.053101 312.64224,75.766647 312.37244,80.342621 311.28177,81.957657 307.64908,87.336853 306.09219,88.091827 306.09219,89.696152 306.09219,91.561272 306.08142,92.930161 306.08142,92.930161L311.46021,92.930161 311.46597,89.720444C311.46597,89.720444 312.49261,89.006256 315.2182,85.837914 316.81396,83.982925 318.0397,81.959572 318.45352,80.790619 319.04788,79.111671 319.7117,74.514389 315.04593,72.119629 313.44992,71.300461 311.46005,70.473305 307.15707,70.607811 302.8541,70.742317 300.16647,72.508377 300.16647,72.508377z" Fill="White" Margin="13.257,6.592,12.036,15.073" Stretch="Fill"/>
55
                                        <Rectangle Fill="White" Height="6" Margin="19,0,19,6" VerticalAlignment="Bottom"/>
56
                                        <Ellipse Width="44">
57
                                            <Ellipse.Stroke>
58
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
59
                                                    <GradientStop Color="#FF2F6FC4" Offset="0"/>
60
                                                    <GradientStop Color="#FF084FAB" Offset="1"/>
61
                                                </LinearGradientBrush>
62
                                            </Ellipse.Stroke>
63
                                        </Ellipse>
64
                                    </Grid>
65
                                </DataTemplate>
66
                            </ContentPresenter.ContentTemplate>
67
                        </ContentPresenter>
68
                        <ScrollViewer Grid.Column="1" HorizontalScrollBarVisibility="Auto" Margin="0,0,0,8" Grid.Row="0" VerticalScrollBarVisibility="Auto" BorderBrush="{x:Null}">
69
                            <telerik:StyleManager.Theme>
70
                                <telerik:VisualStudio2013Theme/>
71
                            </telerik:StyleManager.Theme>
72
                            <ContentPresenter x:Name="ConfirmText" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="8,8,8,0" VerticalAlignment="Center"/>
73
                        </ScrollViewer>
74
                        <Border x:Name="HorizontalRule" BorderBrush="White" BorderThickness="0,0,0,1" Background="#26000000" Grid.ColumnSpan="2" Height="2" Grid.Row="1" VerticalAlignment="Top"/>
75
                        <StackPanel x:Name="DialogButtons" Grid.ColumnSpan="2" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="2">
76
                            <telerik:RadButton x:Name="OK" Content="OK" Margin="0,10,8,8" 
77
								MinWidth="100" telerik:LocalizationManager.ResourceKey="Ok"  Command="{x:Static telerik:WindowCommands.Confirm}" telerik:RadWindow.ResponseButton="Accept">
78
                                <telerik:StyleManager.Theme>
79
                                    <telerik:VisualStudio2013Theme/>
80
                                </telerik:StyleManager.Theme>
81
                            </telerik:RadButton>
82
                            <telerik:RadButton x:Name="NO" Content="NO" Margin="0,10,8,8" MinWidth="100" telerik:LocalizationManager.ResourceKey="Cancel"  Command="{x:Static telerik:WindowCommands.Cancel}" >
83
                                <telerik:StyleManager.Theme>
84
                                    <telerik:VisualStudio2013Theme/>
85
                                </telerik:StyleManager.Theme>
86
                            </telerik:RadButton>
87
                            <telerik:RadButton x:Name="Cancel" Content="Cancel" Margin="0,10,8,8" MinWidth="100" telerik:LocalizationManager.ResourceKey="Close"  Command="{x:Static telerik:WindowCommands.Close}" >
88
                                <telerik:StyleManager.Theme>
89
                                    <telerik:VisualStudio2013Theme/>
90
                                </telerik:StyleManager.Theme>
91
                            </telerik:RadButton>
92
                        </StackPanel>
93
                    </Grid>
94
                </ControlTemplate>
95
            </Setter.Value>
96
        </Setter>
97
    </Style>
98
</ResourceDictionary>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)