private bool HavingPricesToUpdate(ProjectSettings project) { Properties.Settings.Default.PropertyValues["suzadbConnectionString"].PropertyValue = project.ConnectionString; var d = new DataClasses1DataContext(); d.Connection.Open(); var di = new DirectoryInfo(project.DirWithPrices); var pricesToUpdate = (from f in di.GetFiles("*", SearchOption.AllDirectories) join pl in d.PriceLists on f.Name.Replace(f.Extension, "").ToLower() equals pl.PriceListName.ToLower() where (pl.UpdateMode > 0 /*|| pl.LastUpdate < f.LastWriteTime*/) && pl.UpdateFromMail orderby pl.PriceListName select new { f, pl }).Distinct(); if (pricesToUpdate.Count() > 0) { file.WriteLine(DateTime.Now + "\t" + project.DirWithProgramm + "\tНовых прайсов: " + pricesToUpdate.Count()); /*file.WriteLine(DateTime.Now + "\t" + pricesToUpdate.FirstOrDefault().f.FullName + "\t" + pricesToUpdate.FirstOrDefault().pl.PriceListID + "\t" + pricesToUpdate.FirstOrDefault().pl.LastUpdate + "\t" + pricesToUpdate.FirstOrDefault().f.LastWriteTime);*/ file.Flush(); return true; } //file.WriteLine(DateTime.Now + "\tНовых прайсов: 0"); //file.Flush(); return false; }
static void Main(string[] args) { //this object has responsibility for creating all needed objects ProjectSettings settings = new ProjectSettings(); var project = new StandardProject<StandardRecord<StandardRecordData>>(settings); BIO.Framework.Core.Evaluation.Results.Results results = project.run(); }
/// <summary> /// Initializes a new instance of the <see cref="Project"/> class /// upon creation of a brand new project. /// </summary> /// <param name="container">The container for this project (not null).</param> /// <param name="projectId">The unique ID for the project.</param> /// <param name="ps">The initial project settings (not null).</param> internal Project(ProjectDatabase container, Guid projectId, ProjectSettings ps) { if (container == null || ps == null) throw new ArgumentNullException(); m_Container = container; m_Id = projectId; m_Settings = ps; m_MapModel = new CadastralMapModel(); }
/// <summary> /// Returns languages of given settings path /// </summary> /// <param name="project">EPLAN project</param> /// <param name="settingsPath">EPLAN settings path</param> /// <returns>Language list</returns> private static StringCollection GetLanguages(Project project, string settingsPath) { using (new LockingStep()) { ProjectSettings projectSettings = new ProjectSettings(project); var displayLanguagesString = projectSettings.GetStringSetting(settingsPath, 0); var languages = new StringCollection(); var languagesFromSettings = displayLanguagesString.Split(';') .Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToArray(); // remove empty languages.AddRange(languagesFromSettings); return languages; } }
public GollumForm(ProjectSettings projectSettings, SubversionArguments subversionArguments) { InitializeComponent(); using (var graphics = CreateGraphics()) { _dpiX = graphics.DpiX; _dpiY = graphics.DpiY; } _projectSettings = projectSettings; _subversionArguments = subversionArguments; _bugMatcher = new Regex(@"(?<=(fixed bug #)|(fix for bug #)|(fixed bug )|(fix for bug ))\s?\d+", RegexOptions.Compiled | RegexOptions.IgnoreCase); ToggleBugzillaVisibility(false); }
static void Main(string[] args) { //PCA evaluation //this object has responsibility for creating all needed objects ProjectSettings settings = new ProjectSettings(); PCA.Training pcaTraining = new PCA.Training(settings.BlockEvaluationSettings); TrainableProject<StandardRecord<StandardRecordData>> pcaProject = new TrainableProject<StandardRecord<StandardRecordData>>( pcaTraining, settings ); BIO.Framework.Core.Evaluation.Results.Results results = pcaProject.run(); }
public ProjectSettingsWindow(string projectName, ProjectSettings settings) { InitializeComponent(); // set variables this.settings = settings; // fill controls inital values lblProject.Text = projectName; txbPublishFolder.Text = settings.GetPublishLocation(); chkIndividualFolder.IsChecked = settings.PublishTarget.IsUserSpecific; txbIgnoreFilter.Text = settings.IgnoreFilter; chkMappingEnabled.IsChecked = settings.MappingEnabled; // initialize controls txbPublishFolder.Focus(); }
/// <summary> /// Initializes a new instance of the <see cref="Project"/> class. /// </summary> public Project( ProjectProcessingState initialProcessingState = ProjectProcessingState.Interactive) { // Set up the initial states. ProcessingState = initialProcessingState; // We need the settings set up first since it may contribute // to the loading of other components of the project. Settings = new ProjectSettings(); Properties = new PropertiesDictionary(); BlockTypes = new BlockTypeSupervisor(this); Blocks = new ProjectBlockCollection(this); Commands = new BlockCommandSupervisor(this); Plugins = new PluginSupervisor(this); Macros = new ProjectMacros(); }
public MappingWindow(ProjectSettings settings, ItemSettings item) { InitializeComponent(); // set variables this.settings = settings; this.item = item; this.itemName = item.GetName(); // fill controls inital values lblPath.Text = item.Path; txbMapping.Text = item.Mapping.OrDefault(itemName); // initialize controls txbMapping.SelectAll(); txbMapping.Focus(); UpdateMappingPreview(); }
private void ButtonOkClick(object sender, EventArgs e) { labelInfo.Text = ""; string workingCopyPath = textBoxWorkingCopyPath.Text; if (!Directory.Exists(workingCopyPath)) { labelInfo.Text = "The path does not exist"; return; } if (!Directory.Exists(Path.Combine(workingCopyPath, ".svn"))) { labelInfo.Text = "The path is not a working copy. There is no .svn directory."; return; } textBoxPathToExe.Text = Application.ExecutablePath; textBoxPathToExe.Focus(); textBoxPathToExe.SelectAll(); string settingsFilePath = Path.Combine(workingCopyPath, ProjectSettings.DefaultFileName); if (!File.Exists(settingsFilePath)) { var settings = new ProjectSettings { RepositoryBasePath = "/", ReviewBoardGroup = "ExampleReviewBoardGroup", ReviewBoardRepositoryName = "ExampleReviewBoardRepositoryName" }; ProjectSettings.Save(settings, Path.Combine(workingCopyPath, ProjectSettings.DefaultFileName)); labelInfo.Text = "The project specific settings file " + ProjectSettings.DefaultFileName + " created."; OpenFileInEditor(workingCopyPath, settingsFilePath); LaunchTortoiseSettings(); } else { OpenFileInEditor(workingCopyPath, settingsFilePath); } }
public Error OpenInExternalEditor(Script script, int line, int col) { var editorId = (ExternalEditorId)_editorSettings.GetSetting("mono/editor/external_editor"); switch (editorId) { case ExternalEditorId.None: // Not an error. Tells the caller to fallback to the global external editor settings or the built-in editor. return(Error.Unavailable); case ExternalEditorId.VisualStudio: { string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); var args = new List <string> { GodotSharpDirs.ProjectSlnPath, line >= 0 ? $"{scriptPath};{line + 1};{col + 1}" : scriptPath }; string command = Path.Combine(GodotSharpDirs.DataEditorToolsDir, "GodotTools.OpenVisualStudio.exe"); try { if (Godot.OS.IsStdoutVerbose()) { Console.WriteLine($"Running: \"{command}\" {string.Join(" ", args.Select(a => $"\"{a}\""))}"); } OS.RunProcess(command, args); } catch (Exception e) { GD.PushError($"Error when trying to run code editor: VisualStudio. Exception message: '{e.Message}'"); } break; } case ExternalEditorId.VisualStudioForMac: goto case ExternalEditorId.MonoDevelop; case ExternalEditorId.Rider: { string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); RiderPathManager.OpenFile(GodotSharpDirs.ProjectSlnPath, scriptPath, line); return(Error.Ok); } case ExternalEditorId.MonoDevelop: { string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); GodotIdeManager.LaunchIdeAsync().ContinueWith(launchTask => { var editorPick = launchTask.Result; if (line >= 0) { editorPick?.SendOpenFile(scriptPath, line + 1, col); } else { editorPick?.SendOpenFile(scriptPath); } }); break; } case ExternalEditorId.VsCode: { if (string.IsNullOrEmpty(_vsCodePath) || !File.Exists(_vsCodePath)) { // Try to search it again if it wasn't found last time or if it was removed from its location _vsCodePath = VsCodeNames.SelectFirstNotNull(OS.PathWhich, orElse: string.Empty); } var args = new List <string>(); bool osxAppBundleInstalled = false; if (OS.IsMacOS) { // The package path is '/Applications/Visual Studio Code.app' const string vscodeBundleId = "com.microsoft.VSCode"; osxAppBundleInstalled = Internal.IsOsxAppBundleInstalled(vscodeBundleId); if (osxAppBundleInstalled) { args.Add("-b"); args.Add(vscodeBundleId); // The reusing of existing windows made by the 'open' command might not choose a wubdiw that is // editing our folder. It's better to ask for a new window and let VSCode do the window management. args.Add("-n"); // The open process must wait until the application finishes (which is instant in VSCode's case) args.Add("--wait-apps"); args.Add("--args"); } } string resourcePath = ProjectSettings.GlobalizePath("res://"); args.Add(resourcePath); string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); if (line >= 0) { args.Add("-g"); args.Add($"{scriptPath}:{line}:{col}"); } else { args.Add(scriptPath); } string command; if (OS.IsMacOS) { if (!osxAppBundleInstalled && string.IsNullOrEmpty(_vsCodePath)) { GD.PushError("Cannot find code editor: VSCode"); return(Error.FileNotFound); } command = osxAppBundleInstalled ? "/usr/bin/open" : _vsCodePath; } else { if (string.IsNullOrEmpty(_vsCodePath)) { GD.PushError("Cannot find code editor: VSCode"); return(Error.FileNotFound); } command = _vsCodePath; } try { OS.RunProcess(command, args); } catch (Exception e) { GD.PushError($"Error when trying to run code editor: VSCode. Exception message: '{e.Message}'"); } break; } default: throw new ArgumentOutOfRangeException(); } return(Error.Ok); }
public ProjectBindingRegistryCache(DiscoveryStatus status, ProjectBindingRegistry bindingRegistry = null, ProjectSettings projectSettings = null, DateTime?testAssemblyWriteTimeUtc = null) { Status = status; BindingRegistry = bindingRegistry; ProjectSettings = projectSettings; TestAssemblyWriteTimeUtc = testAssemblyWriteTimeUtc; }
public SpecFlowProject() { ProjectSettings = new ProjectSettings(); Configuration = new SpecFlowProjectConfiguration(); }
private void _ExportBeginImpl(string[] features, bool isDebug, string path, int flags) { if (!File.Exists(GodotSharpDirs.ProjectSlnPath)) { return; } string platform = DeterminePlatformFromFeatures(features); if (platform == null) { throw new NotSupportedException("Target platform not supported"); } string outputDir = new FileInfo(path).Directory?.FullName ?? throw new FileNotFoundException("Base directory not found"); string buildConfig = isDebug ? "ExportDebug" : "ExportRelease"; string scriptsMetadataPath = Path.Combine(GodotSharpDirs.ResMetadataDir, $"scripts_metadata.{(isDebug ? "debug" : "release")}"); CsProjOperations.GenerateScriptsMetadata(GodotSharpDirs.ProjectCsProjPath, scriptsMetadataPath); AddFile(scriptsMetadataPath, scriptsMetadataPath); // Turn export features into defines var godotDefines = features; if (!BuildManager.BuildProjectBlocking(buildConfig, godotDefines)) { throw new Exception("Failed to build project"); } // Add dependency assemblies var assemblies = new Godot.Collections.Dictionary <string, string>(); string projectDllName = GodotSharpEditor.ProjectAssemblyName; string projectDllSrcDir = Path.Combine(GodotSharpDirs.ResTempAssembliesBaseDir, buildConfig); string projectDllSrcPath = Path.Combine(projectDllSrcDir, $"{projectDllName}.dll"); assemblies[projectDllName] = projectDllSrcPath; if (platform == OS.Platforms.Android) { string godotAndroidExtProfileDir = GetBclProfileDir("godot_android_ext"); string monoAndroidAssemblyPath = Path.Combine(godotAndroidExtProfileDir, "Mono.Android.dll"); if (!File.Exists(monoAndroidAssemblyPath)) { throw new FileNotFoundException("Assembly not found: 'Mono.Android'", monoAndroidAssemblyPath); } assemblies["Mono.Android"] = monoAndroidAssemblyPath; } string bclDir = DeterminePlatformBclDir(platform); var initialAssemblies = assemblies.Duplicate(); internal_GetExportedAssemblyDependencies(initialAssemblies, buildConfig, bclDir, assemblies); AddI18NAssemblies(assemblies, bclDir); string outputDataDir = null; if (PlatformHasTemplateDir(platform)) { outputDataDir = ExportDataDirectory(features, platform, isDebug, outputDir); } string apiConfig = isDebug ? "Debug" : "Release"; string resAssembliesDir = Path.Combine(GodotSharpDirs.ResAssembliesBaseDir, apiConfig); bool assembliesInsidePck = (bool)ProjectSettings.GetSetting("mono/export/export_assemblies_inside_pck") || outputDataDir == null; if (!assembliesInsidePck) { string outputDataGameAssembliesDir = Path.Combine(outputDataDir, "Assemblies"); if (!Directory.Exists(outputDataGameAssembliesDir)) { Directory.CreateDirectory(outputDataGameAssembliesDir); } } foreach (var assembly in assemblies) { void AddToAssembliesDir(string fileSrcPath) { if (assembliesInsidePck) { string fileDstPath = Path.Combine(resAssembliesDir, fileSrcPath.GetFile()); AddFile(fileSrcPath, fileDstPath); } else { Debug.Assert(outputDataDir != null); string fileDstPath = Path.Combine(outputDataDir, "Assemblies", fileSrcPath.GetFile()); File.Copy(fileSrcPath, fileDstPath); } } string assemblySrcPath = assembly.Value; string assemblyPathWithoutExtension = Path.ChangeExtension(assemblySrcPath, null); string pdbSrcPath = assemblyPathWithoutExtension + ".pdb"; AddToAssembliesDir(assemblySrcPath); if (File.Exists(pdbSrcPath)) { AddToAssembliesDir(pdbSrcPath); } } // AOT compilation bool aotEnabled = platform == OS.Platforms.iOS || (bool)ProjectSettings.GetSetting("mono/export/aot/enabled"); if (aotEnabled) { string aotToolchainPath = null; if (platform == OS.Platforms.Android) { aotToolchainPath = (string)ProjectSettings.GetSetting("mono/export/aot/android_toolchain_path"); } if (aotToolchainPath == string.Empty) { aotToolchainPath = null; // Don't risk it being used as current working dir } // TODO: LLVM settings are hard-coded and disabled for now var aotOpts = new AotOptions { EnableLLVM = false, LLVMOnly = false, LLVMPath = "", LLVMOutputPath = "", FullAot = platform == OS.Platforms.iOS || (bool)(ProjectSettings.GetSetting("mono/export/aot/full_aot") ?? false), UseInterpreter = (bool)ProjectSettings.GetSetting("mono/export/aot/use_interpreter"), ExtraAotOptions = (string[])ProjectSettings.GetSetting("mono/export/aot/extra_aot_options") ?? new string[] { }, ExtraOptimizerOptions = (string[])ProjectSettings.GetSetting("mono/export/aot/extra_optimizer_options") ?? new string[] { }, ToolchainPath = aotToolchainPath }; AotBuilder.CompileAssemblies(this, aotOpts, features, platform, isDebug, bclDir, outputDir, outputDataDir, assemblies); } }
private static ProcessorArchitectureSetting GetProcessorArchitecture(DeveroomConfiguration deveroomConfiguration, ProjectSettings projectSettings) { if (deveroomConfiguration.ProcessorArchitecture != ProcessorArchitectureSetting.AutoDetect) { return(deveroomConfiguration.ProcessorArchitecture); } if (projectSettings.PlatformTarget == ProjectPlatformTarget.x86) { return(ProcessorArchitectureSetting.X86); } if (projectSettings.PlatformTarget == ProjectPlatformTarget.x64) { return(ProcessorArchitectureSetting.X64); } return(ProcessorArchitectureSetting.UseSystem); }
/// <remarks/> public void RunScanAndAddToProjectAsync(string sessionId, ProjectSettings projectSettings, LocalCodeContainer localCodeContainer, bool visibleToUtherUsers) { this.RunScanAndAddToProjectAsync(sessionId, projectSettings, localCodeContainer, visibleToUtherUsers, null); }
public bool TrySelectFile(Project project, string title, string filter, string storageKey, out string file) { IVsSolution solution = (IVsSolution)Dialog.ServiceProvider.GetService(typeof(SVsSolution)); IVsHierarchy hierarchy; if (!NativeMethods.Succeeded(solution.GetProjectOfUniqueName(project.FullName, out hierarchy))) { file = null; return false; } // We want to read/persist the last directory location that was used if a key is provided. string lastSelectedFile = null; ProjectSettings settings = null; IVsBuildPropertyStorage storage = null; if (storageKey != null) { storage = hierarchy as IVsBuildPropertyStorage; } if (storage != null) { try { settings = new ProjectSettings(storage); lastSelectedFile = settings[storageKey]; } catch { // We don't want to fail scaffolding/selection if we have a settings issue. We'll just // ignore the settings entirely. settings = null; } } if (ProjectItemSelector.TrySelectItem(hierarchy, title, filter, lastSelectedFile, out file)) { if (settings != null) { try { settings[storageKey] = file; } catch { // We don't want to fail scaffolding/selection if we have a settings issue. We'll just // ignore the settings entirely. settings = null; } } return true; } else { return false; } }
public void InitializeDataWriter(ProjectSettings settings, ILogger logger) { }
/// <remarks/> public void CreateAndRunProjectAsync(string SessionID, ProjectSettings ProjectSettings, LocalCodeContainer LocalCodeContainer, bool visibleToOtherUsers) { this.CreateAndRunProjectAsync(SessionID, ProjectSettings, LocalCodeContainer, visibleToOtherUsers, null); }
static void LoadSettings() { string settingsPath = $"{Host.settingsPath}/Packages/{name}/Settings.asset"; settings = ProjectSettings.GetInstance <Settings>(settingsPath); }
public CxWSResponseRunID RunScanAndAddToProject(string sessionId, ProjectSettings projectSettings, LocalCodeContainer localCodeContainer, bool visibleToUtherUsers) { CxWSResponseRunID result = _web_Service.RunScanAndAddToProject(sessionId, projectSettings, localCodeContainer, visibleToUtherUsers); return result; }
public CxWSResponseRunID CreateAndRunProject(string SessionID, ProjectSettings ProjectSettings, LocalCodeContainer LocalCodeContainer, bool visibleToOtherUsers) { CxWSResponseRunID result = _web_Service.CreateAndRunProject(SessionID, ProjectSettings, LocalCodeContainer, visibleToOtherUsers); return result; }
/// <summary> /// Configures the project for publishing. /// </summary> /// <param name="project">The project to configure.</param> /// <param name="settings">The settings.</param> /// <returns> /// true, if the configuration was modified; otherwise, false. /// </returns> private bool ConfigureProject(Project project, ProjectSettings settings) { if (settings != null) { var window = new ProjectSettingsWindow(project.Name, settings); // show dialog and modify settings bool? saveSettings = window.ShowDialog(Globals.GetMainWindowHandle()); if (saveSettings.Value) { settings.Save(); // file does NOT exist? if (!settings.Exists()) { // add to project string projectDir = project.GetDirectory(); string filePath = settings.FilePath; if (filePath.StartsWith(projectDir, StringComparison.OrdinalIgnoreCase)) { ProjectItem item = project.ProjectItems.AddFromFile(filePath); Logger.Log(" -> Settings file added to project '{0}'", project.Name); } } return true; } } return false; }
/// <summary> /// Checks the configuration for the specified project. /// </summary> /// <param name="project">The project to check.</param> /// <param name="settings">The settings of the project.</param> /// <returns>true, if the configuration is valid; otherwise, false.</returns> private bool CheckConfiguration(Project project, ProjectSettings settings) { // check if configuration is valid string targetPath = settings.GetPublishLocation(); if (targetPath.IsNullOrWhiteSpace()) { MessageBoxResult result = MessageBox.Show( "No publish location is specified! Do you want to specify it now?", "Publish Location missing", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes); if (result == MessageBoxResult.No) return false; // show the configuration dialog if (!ConfigureProject(project, settings)) return false; } return true; }
private void OnLostFocus() { ProjectSettings.Save(); }
private async void ButtonGoClick(object sender, EventArgs e) { int revisionTo; int revisionFrom = -1; if (string.IsNullOrWhiteSpace(textBoxProjectDirectory.Text) || !Directory.Exists(textBoxProjectDirectory.Text) || string.IsNullOrWhiteSpace(textBoxRevisionTo.Text) || !int.TryParse(textBoxRevisionTo.Text, out revisionTo) || (!string.IsNullOrWhiteSpace(textBoxRevisionFrom.Text) && !int.TryParse(textBoxRevisionFrom.Text, out revisionFrom)) || revisionFrom >= revisionTo ) { MessageBox.Show("Fill fields better"); return; } var cwd = textBoxProjectDirectory.Text; #if !TEST string projectRootDirectory; try { projectRootDirectory = Program.FindProjectRootDirectory(cwd, ProjectSettings.DefaultFileName); } catch { MessageBox.Show("Directory not gollum-compatible."); return; } #else const string projectRootDirectory = "C:\\"; #endif var subversionArguments = new SubversionArguments { RevisionTo = revisionTo, RevisionFrom = revisionFrom, Cwd = cwd, LocalProjectRootDirectory = projectRootDirectory }; buttonGo.Enabled = false; try { #if TEST subversionArguments.Message = await DummyPatchCreator.GetMessageForRevision(subversionArguments); ProjectSettings = new ProjectSettings { RepositoryBasePath = "/trunk", ReviewBoardGroup = "Ware", ReviewBoardRepositoryName = "Ware" }; #else subversionArguments.Message = await SvnPatchCreator.GetMessageForRevision(subversionArguments); ProjectSettings = ProjectSettings.Load(Path.Combine(subversionArguments.LocalProjectRootDirectory, ProjectSettings.DefaultFileName)); #endif SubversionArguments = subversionArguments; } catch (Exception ex) { MessageBox.Show("Unable to get message for revision: " + ex.Message); buttonGo.Enabled = true; return; } DialogResult = DialogResult.OK; Close(); }
public CxWSResponseRunID CreateAndRunProject(string SessionID, ProjectSettings ProjectSettings, LocalCodeContainer LocalCodeContainer, bool visibleToOtherUsers) { object[] results = this.Invoke("CreateAndRunProject", new object[] { SessionID, ProjectSettings, LocalCodeContainer, visibleToOtherUsers}); return ((CxWSResponseRunID)(results[0])); }
public void NewAppConfig() { SharedData.ActiveProjectPath = ""; SharedData.ProjectPath = ""; SharedData.ProjectSettingsFolder = ""; SharedData.TemplateFileName = ""; string defaultTemplateFileName = SharedData.RegistryGetValue("DefaultTemplateFileName"); string defaultSetupModelTemplateFileName = SharedData.RegistryGetValue("DefaultSetupModelTemplateFileName"); ProjectSettings = new ProjectSettings(defaultTemplateFileName); }
public CxWSResponseRunID RunScanAndAddToProject(string sessionId, ProjectSettings projectSettings, LocalCodeContainer localCodeContainer, bool visibleToUtherUsers) { object[] results = this.Invoke("RunScanAndAddToProject", new object[] { sessionId, projectSettings, localCodeContainer, visibleToUtherUsers}); return ((CxWSResponseRunID)(results[0])); }
/// <ToBeCompleted></ToBeCompleted> public RepositoryProjectEventArgs(ProjectSettings projectSettings) { if (projectSettings == null) throw new ArgumentNullException("projectSettings"); this.projectSettings = projectSettings; }
static void Main(string[] args) { ProjectSettings settings = new ProjectSettings(); var project = new StandardProject<StandardRecord<StandardRecordData>>(settings); Results results = project.run(); }
public AmbientLightElem(ProjectSettings settings) { this.UnityColor = settings.AmbientColor; this.Name = "AmbientLight"; this.Intensity = 1; }
public void InitializeDataWriter(ProjectSettings settings, ILogger logger, IDataReaderService reader) { }
private void OnOpenScreenshotFolder() { GUICommon.Instance.PlayButtonPressSound(); OS.ShellOpen(ProjectSettings.GlobalizePath(Constants.SCREENSHOT_FOLDER)); }
/// <summary> /// Initializes a new instance of the <see cref="SqliteSchemaDescriptor"/> class. /// </summary> /// <param name="db">The database.</param> /// <param name="dbConnector">The database connector.</param> /// <param name="dialect">The dialect.</param> /// <param name="settings">The settings.</param> /// <param name="tableBlackList">The excluded tables.</param> public SqliteSchemaDescriptor(IDbAccess db, IDbConnector dbConnector, SqlDialect dialect, ProjectSettings settings, params string[] tableBlackList) : base(RdbmsBackend.SupportedSystemNames.Sqlite3, dialect) { this.db = db; this.dbConnector = dbConnector; ProjectSettings = settings; if (tableBlackList != null) { FilterSettings = new FilterSettings { TableFilterList = tableBlackList }; } }
private void OnLogButtonPressed() { GUICommon.Instance.PlayButtonPressSound(); OS.ShellOpen(ProjectSettings.GlobalizePath(Constants.LOGS_FOLDER)); }
private bool isServer() { return((((int)ProjectSettings.GetSetting("feudal_mp/application/server")) == 1) || (OS.GetCmdlineArgs().Contains("--fmp-server"))); }
public XUnit2TestGeneratorProvider(CodeDomHelper codeDomHelper, ProjectSettings projectSettings) { CodeDomHelper = codeDomHelper; _projectSettings = projectSettings; }
public void WriteAllXML(string projectPath) { ProjectSettings.WriteXML(projectPath + "/.ksplocalizer.settings"); UserSettings.WriteXML(projectPath + "/.ksplocalizer.settings.user"); }
///////////////////////////////////////// public static void EngineApp_AppCreateBefore() { //register [EngineConfig] fields, properties EngineConfig.RegisterClassParameters(typeof(SimulationApp)); //creation settings if (!Fullscreen) { EngineApp.InitSettings.CreateWindowFullscreen = false; } if (VideoMode != Vector2I.Zero && (SystemSettings.VideoModeExists(VideoMode) || !Fullscreen)) { EngineApp.InitSettings.CreateWindowSize = VideoMode; if (!Fullscreen) { EngineApp.InitSettings.CreateWindowState = EngineApp.WindowStateEnum.Normal; } } if (!VerticalSync) { EngineSettings.Init.SimulationVSync = false; } //get from project settings { var windowStateString = ProjectSettings.ReadParameterFromFile("WindowState"); if (!string.IsNullOrEmpty(windowStateString)) { if (Enum.TryParse <Component_ProjectSettings.WindowStateEnum>(windowStateString, out var windowState)) { if (windowState != Component_ProjectSettings.WindowStateEnum.Auto) { switch (windowState) { case Component_ProjectSettings.WindowStateEnum.Normal: { EngineApp.InitSettings.CreateWindowFullscreen = false; EngineApp.InitSettings.CreateWindowState = EngineApp.WindowStateEnum.Normal; var windowSizeString = ProjectSettings.ReadParameterFromFile("WindowSize", Component_ProjectSettings.WindowSizeDefault.ToString()); if (!string.IsNullOrEmpty(windowSizeString)) { try { EngineApp.InitSettings.CreateWindowSize = Vector2I.Parse(windowSizeString); } catch { } } } break; case Component_ProjectSettings.WindowStateEnum.Minimized: EngineApp.InitSettings.CreateWindowFullscreen = false; EngineApp.InitSettings.CreateWindowState = EngineApp.WindowStateEnum.Minimized; break; case Component_ProjectSettings.WindowStateEnum.Maximized: EngineApp.InitSettings.CreateWindowFullscreen = false; EngineApp.InitSettings.CreateWindowState = EngineApp.WindowStateEnum.Maximized; break; case Component_ProjectSettings.WindowStateEnum.Fullscreen: EngineApp.InitSettings.CreateWindowFullscreen = true; break; } } } } } }
public ITestGenerator CreateGenerator(ProjectSettings projectSettings, IEnumerable <GeneratorPluginInfo> generatorPluginInfos) { var container = new GeneratorContainerBuilder().CreateContainer(projectSettings.ConfigurationHolder, projectSettings, generatorPluginInfos); return(container.Resolve <ITestGenerator>()); }
public void Draw() { using (new GUILayout.HorizontalScope()) { /* logo */ using (new GUILayout.VerticalScope(UIHelpers.panelWithBackground, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true))) { GUILayout.FlexibleSpace(); using (new GUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); var logo = CSImages.Logo; if (logo != null) { logo.wrapMode = TextureWrapMode.Clamp; var logoRect = EditorGUILayout.GetControlRect(GUILayout.Width(logo.width), GUILayout.Height(logo.height)); GUI.DrawTexture(logoRect, logo); GUILayout.Space(5); } GUILayout.FlexibleSpace(); } GUILayout.FlexibleSpace(); } /* buttons and stuff */ using (new GUILayout.HorizontalScope(UIHelpers.panelWithBackground, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true))) { GUILayout.Space(10); using (new GUILayout.VerticalScope()) { GUILayout.Space(10); GUILayout.Label("<size=18>Maintainer v.<b>" + Maintainer.Version + "</b></size>", UIHelpers.centeredLabel); GUILayout.Space(10); GUILayout.Label("Developed by Dmitriy Yukhanov\n" + "Logo by Daniele Giardini\n" + "Icons by Google, Austin Andrews, Cody", UIHelpers.centeredLabel); GUILayout.Space(10); UIHelpers.Separator(); GUILayout.Space(10); if (UIHelpers.ImageButton("Homepage", CSIcons.Home)) { Application.OpenURL(Homepage); } GUILayout.Space(10); if (UIHelpers.ImageButton("Support contacts", CSIcons.Support)) { Application.OpenURL(SupportLink); } GUILayout.Space(10); if (UIHelpers.ImageButton("Full changelog (online)", CSIcons.Log)) { Application.OpenURL(ChangelogLink); } GUILayout.Space(10); //GUILayout.Space(10); //GUILayout.Label("Asset Store links", UIHelpers.centeredLabel); UIHelpers.Separator(); GUILayout.Space(10); if (UIHelpers.ImageButton("Code Stage at the Asset Store", CSIcons.Publisher)) { Application.OpenURL(UasProfileLink); } GUILayout.Space(10); if (UIHelpers.ImageButton("Maintainer at the Asset Store", CSIcons.AssetStore)) { Application.OpenURL(UasLink); } GUILayout.Space(10); if (UIHelpers.ImageButton("Rate & Write Review", CSIcons.Star)) { Application.OpenURL(UasReviewLink); } GUILayout.Label( "It's really important to know your opinion,\n rates & reviews are <b>greatly appreciated!</b>", UIHelpers.centeredLabel); GUILayout.Space(10); #if UNITY_2018_3_OR_NEWER if (Event.current.isKey && Event.current.type == EventType.KeyDown && Event.current.control && Event.current.keyCode == KeyCode.D) #else if (Event.current.isKey && Event.current.control && Event.current.keyCode == KeyCode.D) #endif { showDebug = !showDebug; Event.current.Use(); } if (showDebug) { GUILayout.Space(5); UIHelpers.Separator(); GUILayout.Space(5); GUILayout.Label("Welcome to secret debug mode =D"); if (GUILayout.Button("Remove Assets Map")) { AssetsMap.Delete(); } if (GUILayout.Button("Measure Assets Map build time")) { var sw = Stopwatch.StartNew(); AssetsMap.CreateNew(); sw.Stop(); Debug.Log("Asset Map build took " + sw.Elapsed.TotalSeconds.ToString("0.000", CultureInfo.InvariantCulture) + " seconds"); } if (GUILayout.Button("Remove Settings and Close")) { window.Close(); ProjectSettings.Delete(); } if (GUILayout.Button("Re-save all scenes in project")) { CSSceneTools.ReSaveAllScenes(); } } } GUILayout.Space(10); } } }
private bool CreateProjectSolution() { using (var pr = new EditorProgress("create_csharp_solution", "Generating solution...".TTR(), 3)) { pr.Step("Generating C# project...".TTR()); string resourceDir = ProjectSettings.GlobalizePath("res://"); string path = resourceDir; string name = ProjectAssemblyName; string guid = CsProjOperations.GenerateGameProject(path, name); if (guid.Length > 0) { var solution = new DotNetSolution(name) { DirectoryPath = path }; var projectInfo = new DotNetSolution.ProjectInfo { Guid = guid, PathRelativeToSolution = name + ".csproj", Configs = new List <string> { "Debug", "ExportDebug", "ExportRelease" } }; solution.AddNewProject(name, projectInfo); try { solution.Save(); } catch (IOException e) { ShowErrorDialog("Failed to save solution. Exception message: ".TTR() + e.Message); return(false); } pr.Step("Updating Godot API assemblies...".TTR()); string debugApiAssembliesError = Internal.UpdateApiAssembliesFromPrebuilt("Debug"); if (!string.IsNullOrEmpty(debugApiAssembliesError)) { ShowErrorDialog("Failed to update the Godot API assemblies: " + debugApiAssembliesError); return(false); } string releaseApiAssembliesError = Internal.UpdateApiAssembliesFromPrebuilt("Release"); if (!string.IsNullOrEmpty(releaseApiAssembliesError)) { ShowErrorDialog("Failed to update the Godot API assemblies: " + releaseApiAssembliesError); return(false); } pr.Step("Done".TTR()); // Here, after all calls to progress_task_step CallDeferred(nameof(_RemoveCreateSlnMenuOption)); } else { ShowErrorDialog("Failed to create C# project.".TTR()); } return(true); } }
public static IObjectContainer CreateContainer(SpecFlowConfigurationHolder configurationHolder, ProjectSettings projectSettings, IEnumerable <string> generatorPlugins) { var container = new ObjectContainer(); container.RegisterInstanceAs(projectSettings); RegisterDefaults(container); var configurationProvider = container.Resolve <IGeneratorConfigurationProvider>(); var generatorPluginEvents = container.Resolve <GeneratorPluginEvents>(); var unitTestProviderConfigration = container.Resolve <UnitTestProviderConfiguration>(); var specFlowConfiguration = new SpecFlowProjectConfiguration(); specFlowConfiguration.SpecFlowConfiguration = configurationProvider.LoadConfiguration(specFlowConfiguration.SpecFlowConfiguration, configurationHolder); LoadPlugins(container, generatorPluginEvents, unitTestProviderConfigration, generatorPlugins); generatorPluginEvents.RaiseRegisterDependencies(container); generatorPluginEvents.RaiseConfigurationDefaults(specFlowConfiguration); if (specFlowConfiguration.SpecFlowConfiguration.GeneratorCustomDependencies != null) { container.RegisterFromConfiguration(specFlowConfiguration.SpecFlowConfiguration.GeneratorCustomDependencies); } container.RegisterInstanceAs(specFlowConfiguration); container.RegisterInstanceAs(specFlowConfiguration.SpecFlowConfiguration); var generatorInfo = container.Resolve <IGeneratorInfoProvider>().GetGeneratorInfo(); container.RegisterInstanceAs(generatorInfo); container.RegisterInstanceAs(container.Resolve <CodeDomHelper>(projectSettings.ProjectPlatformSettings.Language)); if (unitTestProviderConfigration != null) { container.RegisterInstanceAs(container.Resolve <IUnitTestGeneratorProvider>(unitTestProviderConfigration.UnitTestProvider ?? ConfigDefaults.UnitTestProviderName)); } generatorPluginEvents.RaiseCustomizeDependencies(container, specFlowConfiguration); container.Resolve <IConfigurationLoader>().TraceConfigSource(container.Resolve <ITraceListener>(), specFlowConfiguration.SpecFlowConfiguration); return(container); }
// Called when the node enters the scene tree for the first time. public override void _Ready() { if (enable) { baseResolution = new Vector2((int)ProjectSettings.GetSetting("display/window/size/width"), (int)ProjectSettings.GetSetting("display/window/size/height")); resolutionOptions = GetNode <SmartOptionButton>("VBoxContainer/Resolution/OptionButton"); LoadSettings(); resolutionOptions.Selected = resolutionOption; resolutionOptions.Connect("item_selected", this, nameof(SetResolutionFromOption)); var fullscreenCheckbox = GetNode <CheckBox>("VBoxContainer/Fullscreen/CheckBox"); fullscreenCheckbox.Pressed = Fullscreen; fullscreenCheckbox.Connect("toggled", this, nameof(SetFullscreen)); // GetNode<CheckBox>("VBoxContainer/Borderless/CheckBox").Connect("toggled", this, nameof(SetBorderless)); } }
private void UpdateModDetails() { if (selectedMod == null) { return; } if (workshopData.PreviouslyUploadedItemData.TryGetValue(selectedMod.InternalName, out var previousData)) { editedTitle.Text = previousData.Title; editedDescription.Text = previousData.Description; editedVisibility.Pressed = previousData.Visibility == SteamItemVisibility.Public; editedTags.Text = string.Join(",", previousData.Tags); toBeUploadedPreviewImagePath = previousData.PreviewImagePath; changeNotes.Text = string.Empty; ValidateForm(); } else { editedTitle.Text = selectedMod.Info.Name; editedDescription.Text = string.IsNullOrEmpty(selectedMod.Info.LongDescription) ? selectedMod.Info.Description : selectedMod.Info.LongDescription; editedVisibility.Pressed = true; editedTags.Text = string.Empty; toBeUploadedPreviewImagePath = Path.Combine(selectedMod.Folder, selectedMod.Info.Icon); // TODO: this is not translated here as the default language to upload mods in, is English // See: https://github.com/Revolutionary-Games/Thrive/issues/2828 changeNotes.Text = "Initial version"; } toBeUploadedContentLocation.Text = string.Format(CultureInfo.CurrentCulture, TranslationServer.Translate("CONTENT_UPLOADED_FROM"), ProjectSettings.GlobalizePath(selectedMod.Folder)); UpdatePreviewRect(); }
private void OnQuit() { ProjectSettings.Save(); }
/// <summary> /// Initializes a new instance of the <see cref="SpecBindConfigurationProvider"/> class. /// </summary> /// <param name="projectSettings">The project settings.</param> public SpecBindConfigurationProvider(ProjectSettings projectSettings) { this.projectSettings = projectSettings; }
public XrmFrameworkProject() { ProjectSettings = new ProjectSettings(); }
private RunScanResult RunBoundedProjectScan(Scan scan, BackgroundWorkerHelper bg, CxWebServiceClient client, byte[] zippedProject) { RunScanResult runScanResult = null; bg.DoWorkFunc = delegate(object obj) { ProjectSettings projectSettings = new ProjectSettings(); projectSettings.projectID = CommonData.ProjectId; LocalCodeContainer localCodeContainer = new LocalCodeContainer(); localCodeContainer.FileName = "zipCxViewer"; localCodeContainer.ZippedFile = zippedProject; try { CxWSResponseRunID cxWSResponseRunID; if (_scan.IsIncremental) { cxWSResponseRunID = client.ServiceClient.RunIncrementalScan( scan.LoginResult.SessionId, projectSettings, localCodeContainer , CommonData.IsProjectPublic, scan.IsPublic ); } else { cxWSResponseRunID = client.ServiceClient.RunScanAndAddToProject( scan.LoginResult.SessionId, projectSettings, localCodeContainer , CommonData.IsProjectPublic, scan.IsPublic ); } runScanResult = new RunScanResult(); // RunScanResult.FromXml(scanZipedSource); runScanResult.IsSuccesfull = cxWSResponseRunID.IsSuccesfull; runScanResult.ScanId = cxWSResponseRunID.RunId; //Server actually returns the scanId which is a long number (and not the runID) scan.LoginResult.AuthenticationData.UnboundRunID = cxWSResponseRunID.RunId; CommonData.ProjectId = cxWSResponseRunID.ProjectID; _scan.RunScanResult = runScanResult; if (!cxWSResponseRunID.IsSuccesfull) { TopMostMessageBox.Show(string.Format("Scan Error: {0}", cxWSResponseRunID.ErrorMessage), "Scanning Error", MessageBoxButtons.OK); } else { LoginHelper.Save(scan.LoginResult.AuthenticationData); } } catch (Exception err) { Logger.Create().Error(err.ToString()); TopMostMessageBox.Show(string.Format("Scan Error: {0}", err.Message), "Scanning Error", MessageBoxButtons.OK); } }; if (!bg.DoWork("Upload project zipped source for scanning...")) { return(null); } return(runScanResult); }
/// <remarks/> public System.IAsyncResult BeginCreateAndRunProject(string SessionID, ProjectSettings ProjectSettings, LocalCodeContainer LocalCodeContainer, bool visibleToOtherUsers, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateAndRunProject", new object[] { SessionID, ProjectSettings, LocalCodeContainer, visibleToOtherUsers}, callback, asyncState); }
private RunScanResult RunScan(BackgroundWorkerHelper bg, CxWebServiceClient client, ConfigurationResult configuration, byte[] zippedProject) { RunScanResult runScanResult = null; bg.DoWorkFunc = delegate(object obj) { ProjectSettings projectSettings = new ProjectSettings(); projectSettings.AssociatedGroupID = _scan.UploadSettings.Team.ToString(); projectSettings.PresetID = _scan.UploadSettings.Preset; projectSettings.ProjectName = _scan.UploadSettings.ProjectName; projectSettings.ScanConfigurationID = configuration.FirstConfigurationKey; LocalCodeContainer localCodeContainer = new LocalCodeContainer(); localCodeContainer.FileName = "zipCxViewer"; localCodeContainer.ZippedFile = zippedProject; try { CxWSResponseRunID cxWSResponseRunID; if (_scan.IsIncremental) { cxWSResponseRunID = client.ServiceClient.RunIncrementalScan( _scan.LoginResult.SessionId, projectSettings, localCodeContainer , _scan.UploadSettings.IsPublic, _scan.IsPublic ); } else { cxWSResponseRunID = client.ServiceClient.CreateAndRunProject( _scan.LoginResult.SessionId, projectSettings, localCodeContainer , _scan.UploadSettings.IsPublic, _scan.IsPublic ); } runScanResult = new RunScanResult(); runScanResult.IsSuccesfull = cxWSResponseRunID.IsSuccesfull; runScanResult.ScanId = cxWSResponseRunID.RunId;//Server actually returns the scanId which is a long number (and not the runID) _scan.LoginResult.AuthenticationData.UnboundRunID = cxWSResponseRunID.RunId; runScanResult.ProjectId = cxWSResponseRunID.ProjectID; _scan.RunScanResult = runScanResult; if (!cxWSResponseRunID.IsSuccesfull) { TopMostMessageBox.Show(string.Format("Scan Error: {0}", cxWSResponseRunID.ErrorMessage), "Scanning Error", MessageBoxButtons.OK); } else { LoginHelper.Save(_scan.LoginResult.AuthenticationData); } } catch (Exception err) { Logger.Create().Error(err.ToString()); TopMostMessageBox.Show(string.Format("Scan Error: {0}", err.Message), "Scanning Error", MessageBoxButtons.OK); } }; if (!bg.DoWork("Upload project zipped source for scanning...")) { return(null); } return(runScanResult); }
/// <remarks/> public void CreateAndRunProjectAsync(string SessionID, ProjectSettings ProjectSettings, LocalCodeContainer LocalCodeContainer, bool visibleToOtherUsers, object userState) { if ((this.CreateAndRunProjectOperationCompleted == null)) { this.CreateAndRunProjectOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateAndRunProjectOperationCompleted); } this.InvokeAsync("CreateAndRunProject", new object[] { SessionID, ProjectSettings, LocalCodeContainer, visibleToOtherUsers}, this.CreateAndRunProjectOperationCompleted, userState); }
public void LoadAppConfig(string appConfigFileName, bool skipTemplateLoad, string templateFilename) { if (!File.Exists(appConfigFileName)) { log.Error("Could not find the App Config file."); throw new FileNotFoundException("Could not find appconfig.xml at the following path: " + appConfigFileName); } SharedData.ActiveProjectPath = ""; SharedData.ProjectPath = ""; SharedData.ProjectSettingsFolder = ""; SharedData.TemplateFileName = ""; string file = Path.GetFileName(appConfigFileName).ToLower(); if (file == "appconfig.xml") { ProjectSettings = new ProjectSettings(); ProjectSettings.Open(appConfigFileName, this); } else if (file == "project.settings") { using (StreamReader reader = new StreamReader(appConfigFileName)) { if (reader.BaseStream.Length > 0) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(IWorkbenchProjectSettings)); ProjectSettings = (IWorkbenchProjectSettings)xmlSerializer.Deserialize(reader); //ProjectSettings.FileName = appConfigFileName; } reader.Close(); } } if (skipTemplateLoad == false) { if (templateFilename != null) ProjectSettings.TemplateFileName = templateFilename; LoadTemplate(ProjectSettings.TemplateFileName); } else { log.Info("Skipped loading the template."); } SharedData.ProjectSettingsFolder = Path.GetDirectoryName(appConfigFileName); }
/// <remarks/> public System.IAsyncResult BeginRunScanAndAddToProject(string sessionId, ProjectSettings projectSettings, LocalCodeContainer localCodeContainer, bool visibleToUtherUsers, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RunScanAndAddToProject", new object[] { sessionId, projectSettings, localCodeContainer, visibleToUtherUsers}, callback, asyncState); }
public override void _Notification(int what) { base._Notification(what); if (what == NotificationReady) { bool showInfoDialog = (bool)editorSettings.GetSetting("mono/editor/show_info_on_start"); if (showInfoDialog) { aboutDialog.Exclusive = true; _ShowAboutDialog(); // Once shown a first time, it can be seen again via the Mono menu - it doesn't have to be exclusive from that time on. aboutDialog.Exclusive = false; } var fileSystemDock = GetEditorInterface().GetFileSystemDock(); fileSystemDock.FilesMoved += (file, newFile) => { if (Path.GetExtension(file) == Internal.CSharpLanguageExtension) { ProjectUtils.RenameItemInProjectChecked(GodotSharpDirs.ProjectCsProjPath, "Compile", ProjectSettings.GlobalizePath(file), ProjectSettings.GlobalizePath(newFile)); } }; fileSystemDock.FileRemoved += file => { if (Path.GetExtension(file) == Internal.CSharpLanguageExtension) { ProjectUtils.RemoveItemFromProjectChecked(GodotSharpDirs.ProjectCsProjPath, "Compile", ProjectSettings.GlobalizePath(file)); } }; fileSystemDock.FolderMoved += (oldFolder, newFolder) => { ProjectUtils.RenameItemsToNewFolderInProjectChecked(GodotSharpDirs.ProjectCsProjPath, "Compile", ProjectSettings.GlobalizePath(oldFolder), ProjectSettings.GlobalizePath(newFolder)); }; fileSystemDock.FolderRemoved += oldFolder => { ProjectUtils.RemoveItemsInFolderFromProjectChecked(GodotSharpDirs.ProjectCsProjPath, "Compile", ProjectSettings.GlobalizePath(oldFolder)); }; } }
/// <remarks/> public void RunScanAndAddToProjectAsync(string sessionId, ProjectSettings projectSettings, LocalCodeContainer localCodeContainer, bool visibleToUtherUsers, object userState) { if ((this.RunScanAndAddToProjectOperationCompleted == null)) { this.RunScanAndAddToProjectOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRunScanAndAddToProjectOperationCompleted); } this.InvokeAsync("RunScanAndAddToProject", new object[] { sessionId, projectSettings, localCodeContainer, visibleToUtherUsers}, this.RunScanAndAddToProjectOperationCompleted, userState); }
public Error OpenInExternalEditor(Script script, int line, int col) { var editor = (ExternalEditorId)editorSettings.GetSetting("mono/editor/external_editor"); switch (editor) { case ExternalEditorId.None: // Tells the caller to fallback to the global external editor settings or the built-in editor return(Error.Unavailable); case ExternalEditorId.VisualStudio: throw new NotSupportedException(); case ExternalEditorId.VisualStudioForMac: goto case ExternalEditorId.MonoDevelop; case ExternalEditorId.Rider: { string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); RiderPathManager.OpenFile(GodotSharpDirs.ProjectSlnPath, scriptPath, line); return(Error.Ok); } case ExternalEditorId.MonoDevelop: { string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); if (line >= 0) { GodotIdeManager.SendOpenFile(scriptPath, line + 1, col); } else { GodotIdeManager.SendOpenFile(scriptPath); } break; } case ExternalEditorId.VsCode: { if (_vsCodePath.Empty() || !File.Exists(_vsCodePath)) { // Try to search it again if it wasn't found last time or if it was removed from its location _vsCodePath = VsCodeNames.SelectFirstNotNull(OS.PathWhich, orElse: string.Empty); } var args = new List <string>(); bool osxAppBundleInstalled = false; if (OS.IsOSX) { // The package path is '/Applications/Visual Studio Code.app' const string vscodeBundleId = "com.microsoft.VSCode"; osxAppBundleInstalled = Internal.IsOsxAppBundleInstalled(vscodeBundleId); if (osxAppBundleInstalled) { args.Add("-b"); args.Add(vscodeBundleId); // The reusing of existing windows made by the 'open' command might not choose a wubdiw that is // editing our folder. It's better to ask for a new window and let VSCode do the window management. args.Add("-n"); // The open process must wait until the application finishes (which is instant in VSCode's case) args.Add("--wait-apps"); args.Add("--args"); } } var resourcePath = ProjectSettings.GlobalizePath("res://"); args.Add(resourcePath); string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath); if (line >= 0) { args.Add("-g"); args.Add($"{scriptPath}:{line + 1}:{col}"); } else { args.Add(scriptPath); } string command; if (OS.IsOSX) { if (!osxAppBundleInstalled && _vsCodePath.Empty()) { GD.PushError("Cannot find code editor: VSCode"); return(Error.FileNotFound); } command = osxAppBundleInstalled ? "/usr/bin/open" : _vsCodePath; } else { if (_vsCodePath.Empty()) { GD.PushError("Cannot find code editor: VSCode"); return(Error.FileNotFound); } command = _vsCodePath; } try { OS.RunProcess(command, args); } catch (Exception e) { GD.PushError($"Error when trying to run code editor: VSCode. Exception message: '{e.Message}'"); } break; } default: throw new ArgumentOutOfRangeException(); } return(Error.Ok); }
public GeneratorPluginLoader(ProjectSettings projectSettings, IGeneratorPluginLocator generatorPluginLocator) { this.projectSettings = projectSettings; this.generatorPluginLocator = generatorPluginLocator; }
private void SetupController() { controller = mocks.DynamicMock<IController>(); Expect.Call(controller.GetTempFilePathForComponent(ComponentKey.Workbench_FileGenerator)).IgnoreArguments().Return("C:/Temp").Repeat.Any(); Settings.Default.PerformMergeAnalysis = true; //Expect.Call(controller.SettingGet(Controller.SettingNames.PerformMergeAnalysis)).Return(true).Repeat.Any(); ProjectSettings settings = new ProjectSettings(); settings.OutputPath = "C:\\doesnotexist"; WorkbenchProject project = new WorkbenchProject(); project.ProjectSettings = settings; Expect.Call(controller.CurrentProject).Return(project); }