public override void Create() { Parts.Clear(); // Part1 if (GetPart1Dependencies() != null) { var part1 = Factory.CreateSegment(Drawing, GetPart1Dependencies()); if (part1 != null) { Parts.Add(part1); } } // Cross Part if (GetCrossPartDependencies() != null) { var crossPart = Factory.CreateCircle(Drawing, GetCrossPartDependencies()); Parts.Add(crossPart); } Dependencies.Clear(); Children.Clear(); if (Parts != null) { foreach (IFigure f in Parts) { Children.Add(f); foreach (IPoint p in f.Dependencies) { Dependencies.Add(p); } } } }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { Dependencies.Clear(); if (_input != null) { _input.Dispose(); } if ((ContentControl != null) && (!ContentControl.IsDisposed)) { ContentControl.Dispose(); } } _disposed = true; ContentControl = null; }
/// <summary> /// Initialize a set of <see cref="MorroSystem"/> types this system depends on running first before this system can run. /// </summary> /// <param name="systems">The types of <see cref="MorroSystem"/> this system depends on running first.</param> public void Depend(params Type[] systems) { Dependencies.Clear(); for (int i = 0; i < systems.Length; i++) { Dependencies.Add(systems[i]); } }
/// <summary> /// Initializes from a nuget package. /// </summary> /// <param name="metadata">The nuget metadata.</param> private void InitializeFrom(NuGet.IPackageMetadata metadata) { Name = metadata.Id; Version = new PackageVersion(metadata.Version.ToString()); Title = metadata.Title; Authors.AddRange(metadata.Authors); Owners.AddRange(metadata.Owners); IconUrl = metadata.IconUrl; LicenseUrl = metadata.LicenseUrl; ProjectUrl = metadata.ProjectUrl; RequireLicenseAcceptance = metadata.RequireLicenseAcceptance; Description = metadata.Description; Summary = metadata.Summary; ReleaseNotes = metadata.ReleaseNotes; Language = metadata.Language; Tags = metadata.Tags; Copyright = metadata.Copyright; var dependencySets = metadata.DependencySets.ToList(); if (dependencySets.Count > 1) { throw new InvalidOperationException("Metadata loaded from nuspec cannot have more than one group of dependency"); } // Load dependencies Dependencies.Clear(); var dependencySet = dependencySets.FirstOrDefault(); if (dependencySet != null) { foreach (var dependency in dependencySet.Dependencies) { var packageDependency = new PackageDependency(dependency.Id, PackageVersionRange.FromVersionSpec(dependency.VersionSpec)); Dependencies.Add(packageDependency); } } var serverMetaData = metadata as NuGet.IServerPackageMetadata; if (serverMetaData != null) { ReportAbuseUrl = serverMetaData.ReportAbuseUrl; DownloadCount = serverMetaData.DownloadCount; } var package = metadata as NuGet.IPackage; if (package != null) { IsAbsoluteLatestVersion = package.IsAbsoluteLatestVersion; IsLatestVersion = package.IsLatestVersion; Listed = package.Listed; Published = package.Published; } }
public static void Clear() { MatchingProfiles.Clear(); Dependencies.Clear(); OrderedProfiles.Clear(); DistinctProfiles.Clear(); Result.Clear(); ValidProfiles.Clear(); KeptProfiles.Clear(); }
public void Clear() { foreach (var dependency in Dependencies) { AssetGraphNode removed; var ret = dependency.Value.References.TryRemove(SourcePath, out removed); ToolDebug.Assert(ret); } Dependencies.Clear(); }
public void Clear(Revision before) { if (VerifiedAt <= before) { cachedValue = null; ChangedAt = Revision.Invalid; VerifiedAt = Revision.Invalid; Dependencies.Clear(); } }
/// <summary> /// Initializes the dependency manger and performs the following: /// - Parse functionAppRoot\requirements.psd1 file and create a list of dependencies to install. /// - Set the DependenciesPath which gets used in 'SetupWellKnownPaths'. /// - Determines if the dependency module needs to be installed by checking the latest available version /// in the PSGallery and the destination path (to see if it is already installed). /// - Set the destination path (if running in Azure vs local) where the function app dependencies will be installed. /// </summary> internal void Initialize(FunctionLoadRequest request) { if (!request.ManagedDependencyEnabled) { return; } try { // Resolve the FunctionApp root path. var functionAppRootPath = Path.GetFullPath(Path.Join(request.Metadata.Directory, "..")); // Resolve the managed dependencies installation path. DependenciesPath = GetManagedDependenciesPath(functionAppRootPath); // Parse and process the function app dependencies defined in requirements.psd1. Hashtable entries = ParsePowerShellDataFile(functionAppRootPath, RequirementsPsd1FileName); foreach (DictionaryEntry entry in entries) { // A valid entry is of the form: 'ModuleName'='MajorVersion.*" string name = (string)entry.Key; string version = (string)entry.Value; // Validates that the module name is a supported dependency. ValidateModuleName(name); // Validate the module version. string majorVersion = GetMajorVersion(version); string latestVersion = DependencyManagementUtils.GetModuleLatestSupportedVersion(name, majorVersion); ValidateModuleMajorVersion(name, majorVersion, latestVersion); // Before installing the module, check the path to see if it is already installed. var moduleVersionFolderPath = Path.Combine(DependenciesPath, name, latestVersion); if (!Directory.Exists(moduleVersionFolderPath)) { _shouldUpdateFunctionAppDependencies = true; } // Create a DependencyInfo object and add it to the list of dependencies to install. var dependencyInfo = new DependencyInfo(name, majorVersion, latestVersion); Dependencies.Add(dependencyInfo); } } catch (Exception e) { // Reset DependenciesPath and Dependencies. DependenciesPath = null; Dependencies.Clear(); var errorMsg = string.Format(PowerShellWorkerStrings.FailToInstallFuncAppDependencies, e.Message); throw new DependencyInstallationException(errorMsg, e); } }
/// <summary> /// Function called when the content is reverted back to its original state. /// </summary> /// <returns> /// TRUE if reverted, FALSE if not. /// </returns> protected override bool OnRevert() { if (!HasChanges) { return(false); } Dependencies.Clear(); Reload(); ValidateSpriteProperties(); return(true); }
public void Unload() { if (this.AssetBundle != null) { this.AssetBundle.Unload(true); this.AssetBundle = null; } LoadState = AssetLoadState.Unloaded; //foreach (var item in Dependencies) // item.Release(); Dependencies.Clear(); DependenciesNames = null; this.ABLoader = null; this.LoadTask = UniTask.CompletedTask.ToAsyncLazy(); }
protected void ProcessText() { if (!ShouldProcessText) { return; } string text = this.text; this.UnregisterFromDependencies(); Dependencies.Clear(); embeddedExpressions = new List <CompileResult>(); textChunks = new List <string>(); var matches = squareBrackets.Matches(text); int chunkStart = 0; int chunkEnd = 0; string chunk; foreach (Match match in matches) { chunkEnd = match.Index; chunk = ""; if (chunkEnd > chunkStart) { chunk = text.Substring(chunkStart, chunkEnd - chunkStart); } textChunks.Add(chunk); ProcessMatch(match); chunkStart = match.Index + match.Length; } chunkEnd = text.Length; chunk = ""; if (chunkEnd > chunkStart) { chunk = text.Substring(chunkStart, chunkEnd - chunkStart); } textChunks.Add(chunk); this.RegisterWithDependencies(); Recalculate(); }
private void UpdateDependencies() { Dependencies.Clear(); GetAllDependencies().ToList().ForEach(Dependencies.Add); }
public void StartCompiling() { Diagnostics.Clear(); Dependencies.Clear(); TranspilationDependencies = null; }
public override void Create() { Parts.Clear(); Dependencies.Clear(); Children.Clear(); switch (BarStyle) { case Reinforcement.BarStyle.SingleLine: // Part1 // Chú ý khi gọi phương thức GetPart1Dependencies() // ứng với trường hợp Transform = Rotate180, Rotate90CCW, Rotate90CW // Thì góc Rotate đã bị thay đổi 1 lần // Do đó trong phương thức GetPart1Dependencies() // khi thay đổi góc Rotate chỉ thay đổi 1/2 là đủ if (GetPart1Dependencies() != null) { var part1 = Factory.CreateSegment(Drawing, GetPart1Dependencies()); part1.Style = base.Style; Parts.Add(part1); } // Part2 if (GetPart2Dependencies() != null) { if (ViewDirection != Reinforcement.ViewDirection.Left) { var part2 = Factory.CreateArc(Drawing, GetPart2Dependencies()); part2.Clockwise = ArcPartClockWise; part2.Style = base.Style; Parts.Add(part2); } else { var part2 = Factory.CreateSegment(Drawing, GetPart2Dependencies()); part2.Style = base.Style; Parts.Add(part2); } } // Part3 if (GetPart3Dependencies() != null) { var part3 = Factory.CreateSegment(Drawing, GetPart3Dependencies()); part3.Style = base.Style; Parts.Add(part3); } // Cross Part if (GetCrossPartDependencies() != null) { var crossPart = Factory.CreateCircle(Drawing, GetCrossPartDependencies()); crossPart.Style = base.Style; Parts.Add(crossPart); } if (Parts != null) { foreach (IFigure f in Parts) { Children.Add(f); foreach (IPoint p in f.Dependencies) { Dependencies.Add(p); DependencyPoints.Add(p.Coordinates); } } } break; case Reinforcement.BarStyle.BoundLine: break; case Reinforcement.BarStyle.FilledLine: break; } }
/// <summary> /// Initializes the dependency manger and performs the following: /// - Parse functionAppRoot\requirements.psd1 file and create a list of dependencies to install. /// - Set the DependenciesPath which gets used in 'SetupWellKnownPaths'. /// - Determines if the dependency module needs to be installed by checking the latest available version /// in the PSGallery and the destination path (to see if it is already installed). /// - Set the destination path (if running in Azure vs local) where the function app dependencies will be installed. /// </summary> internal void Initialize(FunctionLoadRequest request) { if (!request.ManagedDependencyEnabled) { return; } try { // Resolve the FunctionApp root path. var functionAppRootPath = Path.GetFullPath(Path.Join(request.Metadata.Directory, "..")); // Resolve the managed dependencies installation path. DependenciesPath = GetManagedDependenciesPath(functionAppRootPath); // Parse and process the function app dependencies defined in requirements.psd1. Hashtable entries = ParsePowerShellDataFile(functionAppRootPath, RequirementsPsd1FileName); foreach (DictionaryEntry entry in entries) { // A valid entry is of the form: 'ModuleName'='MajorVersion.*" string name = (string)entry.Key; string version = (string)entry.Value; // Validates that the module name is a supported dependency. ValidateModuleName(name); // Validate the module version. string majorVersion = GetMajorVersion(version); // Try to connect to the PSGallery to get the latest module supported version. string latestVersion = null; try { latestVersion = GetModuleLatestSupportedVersion(name, majorVersion); } catch (Exception e) { // If we fail to get the latest module version (this could be because the PSGallery is down). // Check to see if there are previous managed dependencies installed. If this is the case, // DependenciesPath is already set, so Get-Module will be able to find the modules. var pathToInstalledModule = Path.Combine(DependenciesPath, name); if (Directory.Exists(pathToInstalledModule)) { // Message to the user for skipped dependencies upgrade. _dependenciesNotUpdatedMessage = string.Format(PowerShellWorkerStrings.DependenciesUpgradeSkippedMessage, e.Message); // Make sure that function app dependencies will NOT be installed, just continue with the function app execution. _shouldUpdateFunctionAppDependencies = false; return; } // Otherwise, rethrow and stop the function app execution. throw; } // Before installing the module, check the path to see if it is already installed. var moduleVersionFolderPath = Path.Combine(DependenciesPath, name, latestVersion); if (!Directory.Exists(moduleVersionFolderPath)) { _shouldUpdateFunctionAppDependencies = true; } // Create a DependencyInfo object and add it to the list of dependencies to install. var dependencyInfo = new DependencyInfo(name, majorVersion, latestVersion); Dependencies.Add(dependencyInfo); } } catch (Exception e) { // Reset DependenciesPath and Dependencies. DependenciesPath = null; Dependencies.Clear(); var errorMsg = string.Format(PowerShellWorkerStrings.FailToInstallFuncAppDependencies, e.Message); throw new DependencyInstallationException(errorMsg, e); } }
void IParsingLifetimeEventHandler.ParsingCompleted() { Dependencies.Clear(); }
protected override void Reset() { base.Reset(); Dependencies.Clear(); Components.Clear(); }