1 using System;
2 using System.Windows;
3
4 namespace FileExplorer
5 {
6 public class OpenAndExpandAction : ClickAction
7 {
8 public nothrow OpenAndExpandAction(Node* node_) : base(), node(node_)
9 {
10 }
11 public override void Execute()
12 {
13 MainWindow* mainWindow = node->GetMainWindow();
14 if (mainWindow != null)
15 {
16 try
17 {
18 mainWindow->HideContextMenu();
19 node->OpenAndExpand();
20 }
21 catch (const Exception& ex)
22 {
23 MessageBox.Show(ex.ToString(), "Error", null, cast<MessageBoxType>(MessageBoxType.MB_OK | MessageBoxType.MB_ICONSTOP));
24 }
25 }
26 }
27 private Node* node;
28 }
29
30 public class OpenAction : ClickAction
31 {
32 public nothrow OpenAction(Node* node_) : base(), node(node_)
33 {
34 }
35 public override void Execute()
36 {
37 MainWindow* mainWindow = node->GetMainWindow();
38 if (mainWindow != null)
39 {
40 try
41 {
42 mainWindow->HideContextMenu();
43 node->Open();
44 }
45 catch (const Exception& ex)
46 {
47 MessageBox.Show(ex.ToString(), "Error", null, cast<MessageBoxType>(MessageBoxType.MB_OK | MessageBoxType.MB_ICONSTOP));
48 }
49 }
50 }
51 private Node* node;
52 }
53 }
54