Exemplo n.º 1
0
        private void HandleRegularCommand(StartPageListItem item)
        {
            var dvm = this.DynamoViewModel;

            switch (item.ContextData)
            {
            case ButtonNames.NewWorkspace:
                dvm.NewHomeWorkspaceCommand.Execute(null);
                break;

            case ButtonNames.OpenWorkspace:
                dvm.ShowOpenDialogAndOpenResultCommand.Execute(null);
                break;

            case ButtonNames.NewCustomNodeWorkspace:
                dvm.ShowNewFunctionDialogCommand.Execute(null);
                break;

            case ButtonNames.ShowGallery:
                dvm.ShowGalleryCommand.Execute(null);
                break;

            default:
                throw new ArgumentException(
                          string.Format("Invalid command: {0}", item.ContextData));
            }
        }
Exemplo n.º 2
0
        private void HandleFilePath(StartPageListItem item)
        {
            var path = item.ContextData;

            if (string.IsNullOrEmpty(path) || (File.Exists(path) == false))
            {
                MessageBox.Show(string.Format(Resources.MessageFileNotFound, path));
                return;
            }

            var dvm = this.DynamoViewModel;

            if (dvm.OpenCommand.CanExecute(path))
            {
                dvm.OpenCommand.Execute(path);
            }
        }
Exemplo n.º 3
0
        internal void HandleListItemClicked(StartPageListItem clicked)
        {
            if (clicked != null)
            {
                switch (clicked.ClickAction)
                {
                case StartPageListItem.Action.RegularCommand:
                    HandleRegularCommand(clicked);
                    break;

                case StartPageListItem.Action.FilePath:
                    HandleFilePath(clicked);
                    break;

                case StartPageListItem.Action.ExternalUrl:
                    HandleExternalUrl(clicked);
                    break;
                }
            }
        }
Exemplo n.º 4
0
 private void HandleExternalUrl(StartPageListItem item)
 {
     System.Diagnostics.Process.Start(item.ContextData);
 }
Exemplo n.º 5
0
        private void HandleFilePath(StartPageListItem item)
        {
            var path = item.ContextData;

            this.DynamoViewModel.OpenCommand.Execute(path);
        }
Exemplo n.º 6
0
 private void HandleExternalUrl(StartPageListItem item)
 {
     System.Diagnostics.Process.Start(item.ContextData);
 }
Exemplo n.º 7
0
        private void HandleFilePath(StartPageListItem item)
        {
            var path = item.ContextData;
            if (string.IsNullOrEmpty(path) || (File.Exists(path) == false))
            {
                MessageBox.Show(string.Format("File not found: {0}", path));
                return;
            }

            var dvm = this.DynamoViewModel;
            if (dvm.OpenCommand.CanExecute(path))
                dvm.OpenCommand.Execute(path);
        }
Exemplo n.º 8
0
        private void HandleRegularCommand(StartPageListItem item)
        {
            var dvm = this.DynamoViewModel;

            switch (item.ContextData)
            {
                case ButtonNames.NewWorkspace:
                    dvm.NewHomeWorkspaceCommand.Execute(null);
                    break;

                case ButtonNames.OpenWorkspace:
                    dvm.ShowOpenDialogAndOpenResultCommand.Execute(null);
                    break;

                default:
                    throw new ArgumentException(
                        string.Format("Invalid command: {0}", item.ContextData));
            }
        }
Exemplo n.º 9
0
        internal void HandleListItemClicked(StartPageListItem clicked)
        {
            if (clicked != null)
            {
                switch (clicked.ClickAction)
                {
                    case StartPageListItem.Action.RegularCommand:
                        HandleRegularCommand(clicked);
                        break;

                    case StartPageListItem.Action.FilePath:
                        HandleFilePath(clicked);
                        break;

                    case StartPageListItem.Action.ExternalUrl:
                        HandleExternalUrl(clicked);
                        break;
                }
            }
        }
Exemplo n.º 10
0
 private void HandleFilePath(StartPageListItem item)
 {
     var path = item.ContextData;
     this.DynamoViewModel.OpenCommand.Execute(path);
 }