Ejemplo n.º 1
0
 public void Startup(ViewStartupParams p)
 {
     publishModel = new PublishModel(p.AuthProvider, p.CustomNodeManager);
     publishViewModel = new PublishViewModel(publishModel);
    
     inviteModel = new InviteModel(p.AuthProvider);
     inviteModel.MessageLogged += this.OnMessageLogged;
     inviteViewModel = new InviteViewModel(inviteModel);            
 }
Ejemplo n.º 2
0
        public void SetUp()
        {
            authenticationProvider = new Mock<IAuthProvider>();
            authenticationProvider.Setup(provider => provider.Username).Returns("DummyUserName");

            // Create mock of reach client.
            var client = new Mock<IWorkspaceStorageClient>();
            client.Setup(c =>
                // If it's sent any workspace or any custom nodes, result always will be successful.
                c.Send(It.IsAny<HomeWorkspaceModel>(), It.IsAny<IEnumerable<CustomNodeWorkspaceModel>>())).
                Returns(Resource.WorkspacesSendSucceededServerResponse);

            // Create publish model.
            publishModel = new PublishModel(authenticationProvider.Object, 
                CurrentDynamoModel.CustomNodeManager, client.Object);            
        }
Ejemplo n.º 3
0
        internal PublishViewModel(PublishModel model)
        {
            this.model = model;

            PublishCommand = new DelegateCommand(OnPublish);
        }
Ejemplo n.º 4
0
 private void OnModelStateChanged(PublishModel.UploadState state)
 {
     IsUploading = state == PublishModel.UploadState.Uploading;
     BeginInvoke(() => PublishCommand.RaiseCanExecuteChanged());
 }
Ejemplo n.º 5
0
        internal PublishViewModel(PublishModel model)
        {
            this.model = model;

            PublishCommand = new DelegateCommand(OnPublish, CanPublish);
            model.UploadStateChanged += OnModelStateChanged;
        }
Ejemplo n.º 6
0
        private MenuItem GenerateMenuItem()
        {
            var item = new MenuItem();
            item.Header = Resources.DynamoViewMenuItemPublishTitle;

            var isEnabled = loadedParams.CurrentWorkspaceModel is HomeWorkspaceModel && startupParams.AuthProvider != null;
            item.IsEnabled = isEnabled;

            item.Click += (sender, args) =>
            {
                var model = new PublishModel(startupParams.AuthProvider, startupParams.CustomNodeManager);
                model.MessageLogged += this.OnMessageLogged;

                var viewModel = new PublishViewModel(model)
                {
                    CurrentWorkspaceModel = loadedParams.CurrentWorkspaceModel
                };

                var window = new PublishView(viewModel)
                {
                    Owner = loadedParams.DynamoWindow,
                    WindowStartupLocation = WindowStartupLocation.CenterOwner
                };

                window.ShowDialog();

                model.MessageLogged -= this.OnMessageLogged;
            };

            return item;
        }
Ejemplo n.º 7
0
 public void Startup(ViewStartupParams p)
 {
     publishModel = new PublishModel(p.AuthProvider, p.CustomNodeManager);
     publishViewModel = new PublishViewModel(publishModel);
 }
Ejemplo n.º 8
0
 private void OnModelStateChanged(PublishModel.UploadState state)
 {
     IsUploading = state == PublishModel.UploadState.Uploading;
     firstTimeErrorMessage = state == PublishModel.UploadState.Failed;
     BeginInvoke(() => PublishCommand.RaiseCanExecuteChanged());
 }
Ejemplo n.º 9
0
        internal PublishViewModel(PublishModel model)
        {
            this.model = model;

            PublishCommand = new DelegateCommand(OnPublish, CanPublish);
            VisitCommand = new DelegateCommand(Visit, CanVisit);
            CopyLinkCommand = new DelegateCommand(CopyLink, CanCopyLink);
            model.UploadStateChanged += OnModelStateChanged;
            model.CustomizerURLChanged += OnCustomizerURLChanged;
        }