示例#1
0
 private void HandleScreenRemoved(ScreenSave screen, List <string> filesToRemove)
 {
     if (NetworkScreenViewModel.IsNetworked(screen))
     {
         filesToRemove.Add(CodeGeneratorCommonLogic.GetGeneratedElementNetworkFilePathFor(screen).FullPath);
         filesToRemove.Add(CodeGeneratorCommonLogic.GetCustomElementNetworkFilePathFor(screen).FullPath);
     }
 }
示例#2
0
        private void HandleScreenViewModelPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            var currentScreen = GlueState.Self.CurrentScreenSave;

            if (currentScreen != null && screenViewModel != null)
            {
                TaskManager.Self.AddSync(() =>
                {
                    screenViewModel.ApplyTo(currentScreen);

                    GlueCommands.Self.GluxCommands.SaveGluxTask();

                    var shouldRegenerate = true;

                    if (e.PropertyName == nameof(NetworkScreenViewModel.IsNetworkScreen))
                    {
                        if (NetworkScreenViewModel.IsNetworked(currentScreen) == false)
                        {
                            shouldRegenerate = false;

                            CodeGeneratorCommonLogic.RemoveCodeFileFromProject(
                                CodeGeneratorCommonLogic.GetGeneratedElementNetworkFilePathFor(currentScreen));

                            CodeGeneratorCommonLogic.RemoveCodeFileFromProject(
                                CodeGeneratorCommonLogic.GetCustomElementNetworkFilePathFor(currentScreen));
                        }
                        else
                        {
                            NetworkConfigurationCodeGenerator.GenerateConfiguration();
                            MessagesCodeGenerator.GenerateAllMessages();
                        }
                    }
                    if (shouldRegenerate)
                    {
                        NetworkScreenCodeGenerator.GenerateCodeFor(currentScreen);
                    }
                }, $"Regenerating network screen {currentScreen}");
            }
        }