public void Open_TwoResolvers_ReturnsFirstResolverStream() { // Arrange using (new ObjectFactoryContainerRegion()) { using (var ms1 = new MemoryStream()) { using (var ms2 = new MemoryStream()) { ObjectFactory.Container.RegisterType <IResourceResolverStrategy, ResourceResolverStrategy>(new ContainerControlledLifetimeManager()); var firstNode = new DummyResourceResolverNode(); firstNode.CurrentExistsMock = (pathDefinition, virtualPath) => true; firstNode.CurrentOpenMock = (pathDefinition, virtualPath) => ms1; var secondNode = new DummyResourceResolverNode(); secondNode.CurrentExistsMock = (pathDefinition, virtualPath) => true; secondNode.CurrentOpenMock = (pathDefinition, virtualPath) => ms2; ObjectFactory.Resolve <IResourceResolverStrategy>().SetFirst(firstNode).SetNext(secondNode); // Act var resolver = new ResourceResolver(); var result = resolver.Open(new PathDefinition(), "~/Test"); // Assert Assert.AreNotSame(ms2, result, "The stream for the second node was returned while the first one was expected."); Assert.AreSame(ms1, result, "The stream for the first node was not returned."); } } } }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); GetTemplateParts(); m_dialogMinHeight = ResourceResolver.ResolveTopLevelResourceDouble("ContentDialogMinHeight"); // For dialogs that were shown when not in the visual tree, since we couldn't prepare // their content during the ShowAsync() call, do it now that it's loaded. if (m_placementMode == PlacementMode.EntireControlInPopup) { PrepareContent(); } // UNO TODO //IFC_RETURN(m_epLayoutRootGotFocusHandler.AttachEventHandler( //m_tpLayoutRootPart.AsOrNull<IUIElement>().Get(), //[this](IInspectable *, xaml::IRoutedEventArgs *) //{ // // Update which command button has the default button visualization. // return UpdateVisualState(); //})); }
public ComboBox() { ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "ComboBoxLightDismissOverlayBackground", isThemeResourceExtension: true); IsItemClickEnabled = true; DefaultStyleKey = typeof(ComboBox); }
private void EnsurePopupCreated() { if (_popup == null) { ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "FlyoutLightDismissOverlayBackground", isThemeResourceExtension: true, isHotReloadSupported: true); var child = CreatePresenter(); _popup = new Popup() { Child = child, IsLightDismissEnabled = _isLightDismissEnabled, AssociatedFlyout = this, }; SynchronizePropertyToPopup(Popup.TemplatedParentProperty, TemplatedParent); _popup.Opened += OnPopupOpened; _popup.Closed += OnPopupClosed; _popup.BindToEquivalentProperty(this, nameof(LightDismissOverlayMode)); _popup.BindToEquivalentProperty(this, nameof(LightDismissOverlayBackground)); InitializePopupPanel(); SynchronizePropertyToPopup(Popup.DataContextProperty, DataContext); SynchronizePropertyToPopup(Popup.AllowFocusOnInteractionProperty, AllowFocusOnInteraction); SynchronizePropertyToPopup(Popup.AllowFocusWhenDisabledProperty, AllowFocusWhenDisabled); } }
/// <summary> /// Returns the set of authority tokens defined by all plugins. /// </summary> /// <returns></returns> public static AuthorityTokenDefinition[] GetAuthorityTokens() { List <AuthorityTokenDefinition> tokens = new List <AuthorityTokenDefinition>(); // scan all plugins for token definitions foreach (PluginInfo plugin in Platform.PluginManager.Plugins) { IResourceResolver resolver = new ResourceResolver(plugin.Assembly); foreach (Type type in plugin.Assembly.GetTypes()) { // look at public fields foreach (FieldInfo field in type.GetFields()) { AuthorityTokenAttribute attr = AttributeUtils.GetAttribute <AuthorityTokenAttribute>(field, false); if (attr != null) { string token = (string)field.GetValue(null); string description = resolver.LocalizeString(attr.Description); tokens.Add(new AuthorityTokenDefinition(token, description)); } } } } return(tokens.ToArray()); }
public PlayManager(ConfBot config, Player playerConnection, PlaylistManager playlistManager, ResourceResolver resourceResolver) { confBot = config; this.playerConnection = playerConnection; this.playlistManager = playlistManager; this.resourceResolver = resourceResolver; }
/// <summary> /// Returns the set of authority tokens defined by all plugins. /// </summary> /// <returns></returns> public static AuthorityTokenDefinition[] GetAuthorityTokens() { var tokens = new List <AuthorityTokenDefinition>(); // scan all plugins for token definitions foreach (var plugin in Platform.PluginManager.Plugins) { var assembly = plugin.Assembly.Resolve(); var resolver = new ResourceResolver(assembly); foreach (var type in plugin.Assembly.Resolve().GetTypes()) { // look at public fields foreach (var field in type.GetFields()) { var attr = AttributeUtils.GetAttribute <AuthorityTokenAttribute>(field, false); if (attr != null) { var token = (string)field.GetValue(null); var description = resolver.LocalizeString(attr.Description); var formerIdentities = (attr.Formerly ?? "").Split(';'); tokens.Add(new AuthorityTokenDefinition(token, assembly.FullName, description, formerIdentities)); } } } } return(tokens.ToArray()); }
private static PaletteColorLut CreateFromColorPaletteSopInstanceXml(string resourceName) { try { var resourceResolver = new ResourceResolver(Assembly.GetExecutingAssembly()); using (var xmlStream = resourceResolver.OpenResource(resourceName)) { var xmlDocument = new XmlDocument(); xmlDocument.Load(xmlStream); var docRootNode = CollectionUtils.FirstElement(xmlDocument.GetElementsByTagName("ClearCanvasColorPaletteDefinition")) as XmlElement; if (docRootNode != null) { var instanceNode = CollectionUtils.FirstElement(docRootNode.GetElementsByTagName("Instance")) as XmlElement; if (instanceNode != null) { var instanceXml = new InstanceXml(instanceNode, null); return(Create(instanceXml.Collection)); } } } } catch (Exception ex) { Platform.Log(LogLevel.Debug, ex, "Failed to load embedded standard color palette SOP from resource {0}", resourceName); } return(null); }
partial void OnApplyTemplatePartial() { // NativePanel may not exist if we're using a non-virtualizing ItemsPanel. if (NativePanel != null) { // Propagate the DataContext manually, since ItemsPanelRoot isn't really part of the visual tree ItemsPanelRoot.SetValue(DataContextProperty, DataContext, DependencyPropertyValuePrecedences.Inheritance); if (ScrollViewer?.Style == null) { throw new InvalidOperationException($"Performance hit: {this} is using a ScrollViewer in its template with a default style, which would break virtualization. A Style containing {nameof(ListViewBaseScrollContentPresenter)} must be used."); } if (ScrollViewer != null) { NativePanel.HorizontalScrollBarVisibility = ScrollViewer.HorizontalScrollBarVisibility; NativePanel.VerticalScrollBarVisibility = ScrollViewer.VerticalScrollBarVisibility; } } else { if (ScrollViewer?.Style != null && ScrollViewer.Style == ResourceResolver.GetSystemResource <Style>("ListViewBaseScrollViewerStyle")) //TODO: this, too, properly { // We're not using NativeListViewBase so we need a 'real' ScrollViewer, remove the internal custom style ScrollViewer.Style = null; } } }
internal void ApplyTo(DependencyObject o, DependencyPropertyValuePrecedences precedence) { if (o == null) { this.Log().Warn("Style.ApplyTo - Applied to null object - Skipping"); return; } using (DependencyObjectExtensions.OverrideLocalPrecedence(o, precedence)) { var flattenedSetters = CreateSetterMap(); #if !HAS_EXPENSIVE_TRYFINALLY try #endif { ResourceResolver.PushNewScope(_xamlScope); foreach (var pair in flattenedSetters) { pair.Value(o); } // Check tree for resource binding values, since some Setters may have set ThemeResource-backed values (o as IDependencyObjectStoreProvider) !.Store.UpdateResourceBindings(isThemeChangedUpdate: false); } #if !HAS_EXPENSIVE_TRYFINALLY finally #endif { ResourceResolver.PopScope(); } } }
public static void CreateDatabase(string fileName) { var filePath = GetDatabaseFilePath(fileName); // ensure the parent directory exists before trying to create database Directory.CreateDirectory(GetDatabaseDirectory()); //NOTE: Since we're using CE 4.0, the LINQ CreateDatabase function won't work because it creates a 3.5 database. var resourceResolver = new ResourceResolver(typeof(TContext).Assembly); using (Stream resourceStream = resourceResolver.OpenResource(fileName)) { using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.None)) { var buffer = new byte[1024]; int bytesRead = resourceStream.Read(buffer, 0, buffer.Length); // write the required bytes while (bytesRead > 0) { fileStream.Write(buffer, 0, bytesRead); bytesRead = resourceStream.Read(buffer, 0, buffer.Length); } fileStream.Close(); } resourceStream.Close(); } }
private static PaletteColorLut CreateFromColorPaletteSopInstanceXml(string resourceName) { try { var resourceResolver = new ResourceResolver(Assembly.GetExecutingAssembly()); using (var xmlStream = resourceResolver.OpenResource(resourceName)) { //var xmlDocument = new XmlDocument(); //xmlDocument.Load(xmlStream); //var docRootNode = CollectionUtils.FirstElement(xmlDocument.GetElementsByTagName("UIHColorPaletteDefinition")) as XmlElement; //if (docRootNode != null) //{ // var instanceNode = CollectionUtils.FirstElement(docRootNode.GetElementsByTagName("Instance")) as XmlElement; // if (instanceNode != null) // { // var instanceXml = new InstanceXml(instanceNode, null); // return Create(instanceXml.Collection); // } //} } } catch (Exception ex) { LogAdapter.Logger.Error(ex, "erorr load resource {0}", resourceName); } return(null); }
public async Task InitializeAsync(CancellationToken ct) { var serviceConfig = await ResourceResolver.LoadConfigurationAsync <DiscordGatewayService, DiscordServiceConfiguration>(); var clientConfig = new DiscordSocketConfig { AlwaysDownloadUsers = true, GuildSubscriptions = true, }; Client = new DiscordSocketClient(clientConfig); // Client.Log += msg => // { // Console.WriteLine(msg.Message); // return Task.CompletedTask; // }; Client.MessageReceived += _HandleMessageReceived; Client.Disconnected += ex => { _MessageChannel.Writer.Complete(ex); return(Task.CompletedTask); }; await Client.LoginAsync(TokenType.Bot, serviceConfig.OAuthToken); // would be cool if we could use a custom status here that was not a game but it seems // the discord API does not properly support this yet and the library subsequently also await Client.SetGameAsync("with Electric Sheep"); // *Playing* with Electric Sheep await Client.StartAsync(); }
public PluginManager(ConfPlugins config, CoreInjector coreInjector, ResourceResolver resourceResolver, BotManager botManager) { this.config = config; this.coreInjector = coreInjector; this.resourceResolver = resourceResolver; this.botManager = botManager; }
public DatePicker() { DefaultStyleKey = typeof(DatePicker); ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "DatePickerLightDismissOverlayBackground", isThemeResourceExtension: true); InitializePartial(); }
public override void Start() { base.Start(); // establish default resource resolver on this assembly (not the assembly of the derived class) IResourceResolver resourceResolver = new ResourceResolver(typeof(FolderConfigurationNodeBase).Assembly); _folderSystemsActionModel = new SimpleActionModel(resourceResolver); _folderSystemsActionModel.AddAction(_moveFolderSystemUpKey, SR.TitleMoveUp, "Icons.UpToolSmall.png", SR.TitleMoveUp, MoveFolderSystemUp); _folderSystemsActionModel.AddAction(_moveFolderSystemDownKey, SR.TitleMoveDown, "Icons.DownToolSmall.png", SR.TitleMoveDown, MoveFolderSystemDown); _folderSystemsActionModel[_moveFolderSystemUpKey].Enabled = false; _folderSystemsActionModel[_moveFolderSystemDownKey].Enabled = false; _foldersActionModel = new SimpleActionModel(resourceResolver); _foldersActionModel.AddAction(_addFolderKey, SR.TitleAddContainerFolder, "Icons.AddToolSmall.png", SR.TitleAddContainerFolder, AddFolder); var editFolderAction = _foldersActionModel.AddAction(_editFolderKey, SR.TitleRenameFolder, "Icons.EditToolSmall.png", SR.TitleRenameFolder, EditFolder); _foldersActionModel.AddAction(_deleteFolderKey, SR.TitleDeleteContainerFolder, "Icons.DeleteToolSmall.png", SR.TitleDeleteContainerFolder, DeleteFolder); _foldersActionModel.AddAction(_moveFolderUpKey, SR.TitleMoveUp, "Icons.UpToolSmall.png", SR.TitleMoveUp, MoveFolderUp); _foldersActionModel.AddAction(_moveFolderDownKey, SR.TitleMoveDown, "Icons.DownToolSmall.png", SR.TitleMoveDown, MoveFolderDown); _foldersActionModel.AddAction(_resetFolderSystemKey, SR.TitleReset, "Icons.ResetToolSmall.png", SR.MessageResetAllFolders, ResetFolderSystem); _foldersActionModel[_addFolderKey].Enabled = false; _foldersActionModel[_editFolderKey].Enabled = false; _foldersActionModel[_deleteFolderKey].Enabled = false; _foldersActionModel[_moveFolderUpKey].Enabled = false; _foldersActionModel[_moveFolderDownKey].Enabled = false; _foldersActionModel[_resetFolderSystemKey].Enabled = false; editFolderAction.KeyStroke = XKeys.F2; LoadFolderSystems(); }
/// <summary> /// Constructor. /// </summary> /// <remarks> /// The resource is resolved using the calling assembly (from <see cref="System.Reflection.Assembly.GetCallingAssembly"/>). /// </remarks> /// <param name="resourceName">The resource name of the cursor.</param> public CursorToken(string resourceName) { Platform.CheckForEmptyString(resourceName, "resourceName"); _resourceName = resourceName; _resolver = new ApplicationThemeResourceResolver(Assembly.GetCallingAssembly()); }
private void Initialize(bool reloadSettings) { lock (_syncLock) { if (Document != null && !reloadSettings) { return; } AnnotationLayoutStoreSettings.Default.Reload(); if (Document != null) { return; } try { XmlDocument document = new XmlDocument(); ResourceResolver resolver = new ResourceResolver(this.GetType().Assembly); using (Stream stream = resolver.OpenResource("AnnotationLayoutStoreDefaults.xml")) { document.Load(stream); Document = document; } } catch (Exception e) { Platform.Log(LogLevel.Debug, e); Clear(); } } }
internal void ApplyTo(DependencyObject o, DependencyPropertyValuePrecedences precedence) { if (o == null) { this.Log().Warn("Style.ApplyTo - Applied to null object - Skipping"); return; } using (DependencyObjectExtensions.OverrideLocalPrecedence(o, precedence)) { var flattenedSetters = CreateSetterMap(); #if !HAS_EXPENSIVE_TRYFINALLY try #endif { ResourceResolver.PushNewScope(_xamlScope); foreach (var pair in flattenedSetters) { pair.Value(o); } } #if !HAS_EXPENSIVE_TRYFINALLY finally #endif { ResourceResolver.PopScope(); } } }
public ActionBuildingContext(string actionID, object actionTarget) { _actionID = actionID; _actionTarget = actionTarget; _resolver = new ActionResourceResolver(_actionTarget); }
private IActionSet GetContextMenuActionSet() { Dictionary <String, List <AimGraphic> > aimUserGraphics = GetAimUserGraphics(); List <IAction> actionsList = new List <IAction>(); String path = "imageviewer-contextmenu/Visible AIM Users/"; ResourceResolver resolver = new ResourceResolver(GetType(), true); foreach (String aimUser in aimUserGraphics.Keys) { if (aimUserGraphics.Count > 0) { string user = aimUser; MenuAction action = new MenuAction(aimUser, new ActionPath(path + aimUser, resolver), ClickActionFlags.CheckAction, resolver); action.Checked = aimUserGraphics[aimUser][0].Visible; action.Enabled = true; action.Persistent = false; action.Label = aimUser; actionsList.Add(action); action.SetClickHandler( delegate { bool visible = !action.Checked; _displayMarkupPerUser[user] = visible; action.Checked = visible; this.SelectedPresentationImage.Draw(); }); } } return(new ActionSet(actionsList)); }
private void EnsurePopupCreated() { if (_popup == null) { ResourceResolver.ApplyResource(this, LightDismissOverlayBackgroundProperty, "FlyoutLightDismissOverlayBackground", isThemeResourceExtension: true); var child = CreatePresenter(); _popup = new Windows.UI.Xaml.Controls.Popup() { Child = child, IsLightDismissEnabled = _isLightDismissEnabled, }; SynchronizeTemplatedParent(); _popup.Opened += OnPopupOpened; _popup.Closed += OnPopupClosed; _popup.BindToEquivalentProperty(this, nameof(LightDismissOverlayMode)); _popup.BindToEquivalentProperty(this, nameof(LightDismissOverlayBackground)); InitializePopupPanel(); SynchronizeDataContext(); } }
/// <summary> /// Create an /// <see cref="iText.Kernel.Pdf.Xobject.PdfFormXObject"/> /// tied to the passed /// <c>PdfDocument</c> /// using the SVG processing result. /// </summary> /// <param name="result">Processing result containing the SVG information</param> /// <param name="pdfDocument">pdf that shall contain the image</param> /// <returns>PdfFormXObject instance</returns> public virtual PdfFormXObject CreateXObjectFromProcessingResult(ISvgProcessorResult result, PdfDocument pdfDocument ) { ISvgNodeRenderer topSvgRenderer = result.GetRootRenderer(); float width; float height; float[] wh = SvgConverter.ExtractWidthAndHeight(topSvgRenderer); width = wh[0]; height = wh[1]; PdfFormXObject pdfForm = new PdfFormXObject(new Rectangle(0, 0, width, height)); PdfCanvas canvas = new PdfCanvas(pdfForm, pdfDocument); ResourceResolver tempResolver = new ResourceResolver(null, resourceResolver.GetRetriever()); // TODO DEVSIX-4107 pass the resourceResolver variable (not tempResolver variable) to the // SvgDrawContext constructor so that the SVG inside the SVG is processed. SvgDrawContext context = new SvgDrawContext(tempResolver, result.GetFontProvider(), result.GetRootRenderer ()); context.AddNamedObjects(result.GetNamedObjects()); context.PushCanvas(canvas); ISvgNodeRenderer root = new PdfRootSvgNodeRenderer(topSvgRenderer); root.Draw(context); return(pdfForm); }
public static List <SelectItemsViewModel.PackageDefinitionBindable> GetPackages() { return(new List <SelectItemsViewModel.PackageDefinitionBindable> { new SelectItemsViewModel.PackageDefinitionBindable { Name = "NServiceBusPreReqs", ImageUrl = ResourceResolver.GetPackUrl("/Images/NSB.png"), ToolTip = "NServiceBus", Enabled = true, }, new SelectItemsViewModel.PackageDefinitionBindable { Name = "ServiceControl", ImageUrl = ResourceResolver.GetPackUrl("/Images/SC.png"), ToolTip = "ServiceControl", Enabled = true, }, new SelectItemsViewModel.PackageDefinitionBindable { Name = "ServicePulse", ImageUrl = ResourceResolver.GetPackUrl("/Images/SP.png"), ToolTip = "ServicePulse", Enabled = true, }, new SelectItemsViewModel.PackageDefinitionBindable { Name = "ServiceInsight", ImageUrl = ResourceResolver.GetPackUrl("/Images/SI.png"), ToolTip = "ServiceInsight", Enabled = true, }, }); }
public override void Process(Configuration config) { var tables = GetTables(config); // create a resource resolver that will scan all plugins // TODO: we should only scan plugins that are tied to the specified PersistentStore, but there is currently no way to know this IResourceResolver resolver = new ResourceResolver( CollectionUtils.Map(Platform.PluginManager.Plugins, (PluginInfo pi) => pi.Assembly).ToArray()); // find all dbi resources var rx = new Regex("dbi.xml$", RegexOptions.Compiled | RegexOptions.IgnoreCase); var dbiFiles = resolver.FindResources(rx); foreach (var dbiFile in dbiFiles) { using (var stream = resolver.OpenResource(dbiFile)) { var xmlDoc = new XmlDocument(); xmlDoc.Load(stream); var indexElements = xmlDoc.SelectNodes("indexes/index"); if (indexElements == null) { continue; } foreach (XmlElement indexElement in indexElements) { ProcessIndex(indexElement, tables); } } } }
public DummySvgConverterProperties() { rendererFactory = new DummySvgNodeFactory(); mediaDeviceDescription = new MediaDeviceDescription(""); baseUri = ""; resourceResolver = new ResourceResolver(""); }
private static IActionSet CreateAbstractActionSet(string actionModelId) { var dummyResourceResolver = new ResourceResolver(typeof(ActionModelsTool), false); var actionNodes = ActionModelSettings.DefaultInstance.ActionModelsXml.SelectNodes(string.Format("/action-models/action-model[@id='{0}']/action", actionModelId)); return(actionNodes != null ? new ActionSet((from XmlElement action in actionNodes select AbstractAction.Create(action.GetAttribute("id"), action.GetAttribute("path"), true, dummyResourceResolver)).ToList()) : new ActionSet()); }
/// <summary> /// Translates the default value for a settings class given the raw value. /// </summary> /// <remarks> /// If the specified raw value is the name of an embedded resource (embedded in the same /// assembly as the specified settings class), the contents of the resource are returned. /// Otherwise, the raw value is simply returned. /// </remarks> public static string TranslateDefaultValue(Type settingsClass, string rawValue) { // short circuit if nothing translatable if (string.IsNullOrEmpty(rawValue)) { return(rawValue); } // does the raw value look like it could be an embedded resource? if (Regex.IsMatch(rawValue, @"^([\w]+\.)+\w+$")) { try { // try to open the resource IResourceResolver resolver = new ResourceResolver(settingsClass.Assembly); using (Stream resourceStream = resolver.OpenResource(rawValue)) { StreamReader r = new StreamReader(resourceStream); return(r.ReadToEnd()); } } catch (MissingManifestResourceException) { // guess it was not an embedded resource, so return the raw value return(rawValue); } } else { return(rawValue); } }
/// <summary> /// Stops the plugin and removes all its functionality available in the bot. /// Changes the status from <see cref="PluginStatus.Active"/> to <see cref="PluginStatus.Ready"/> when successful or <see cref="PluginStatus.Error"/> otherwise. /// </summary> /// <param name="bot">The bot instance where this plugin should be stopped. Can be null when not required.</param> public PluginResponse Stop(Bot bot) { switch (Type) { case PluginType.None: break; case PluginType.BotPlugin: if (bot is null) { foreach (var pluginObjs in botPluginList.Values) { DestroyPluginObjects(pluginObjs); } botPluginList.Clear(); } else { if (botPluginList.TryGetValue(bot, out var pluginObjs)) { botPluginList.Remove(bot); DestroyPluginObjects(pluginObjs); } } break; case PluginType.CorePlugin: if (corePlugin != null) { BotManager.IterateAll(b => { if (b.Injector.TryGet <CommandManager>(out var commandManager)) { commandManager.UnregisterCollection(corePlugin.Bag); } }); DestroyPluginObjects(corePlugin); corePlugin = null; } break; case PluginType.Factory: ResourceResolver.RemoveResolver(factoryObject); break; case PluginType.Commands: if (corePlugin != null) { DestroyPluginObjects(corePlugin); } break; default: throw Tools.UnhandledDefault(Type); } status = PluginStatus.Ready; return(PluginResponse.Ok); }
public void Exists_SecondNodeExists_ReturnsTrue() { using (new ObjectFactoryContainerRegion()) { //Arrange ObjectFactory.Container.RegisterType <IResourceResolverStrategy, ResourceResolverStrategy>(new ContainerControlledLifetimeManager()); var firstNode = new DummyResourceResolverNode(); firstNode.CurrentExistsMock = (pathDefinition, virtualPath) => false; var secondNode = new DummyResourceResolverNode(); secondNode.CurrentExistsMock = (pathDefinition, virtualPath) => true; ObjectFactory.Resolve <IResourceResolverStrategy>() .SetFirst(firstNode) .SetNext(secondNode); //Act var resolver = new ResourceResolver(); var result = resolver.Exists(new PathDefinition(), "~/Test"); //Assert Assert.IsTrue(result, "Resolver returned false for Exists while there is one node for which the resource exits."); } }