resources

Silverlight (WP7) loading a resource

左心房为你撑大大i 提交于 2019-12-24 10:15:58
问题 I have the following code. It's not finding my resource: string filename = "Resources/Functions.plist"; Uri fileUri = new Uri(filename, UriKind.Relative); StreamResourceInfo sr = Application.GetResourceStream(fileUri); But after the above executes, sr is null. Not good. I do have a file named "Functions.plist" in a directory named "Resources", which is a subdirectory of my project directory. When I right click it in the solution explorer, I see its build action as "Resource" and its copy to

Binding a Resource to a View Model

♀尐吖头ヾ 提交于 2019-12-24 09:39:19
问题 How do you bind data from the view model into an object in the resources of the user control? Here is a very abstract example: <UserControl ... xmlns:local="clr-namespace:My.Local.Namespace" Name="userControl"> <UserControl.Resources> <local:GroupingProvider x:Key="groupingProvider" GroupValue="{Binding ???}" /> </UserControl.Resources> <Grid> <local:GroupingConsumer Name="groupingConsumer1" Provider={StaticResource groupingProvider"} /> <local:GroupingConsumer Name="groupingConsumer2"

Using SQL Server as resource locking mechanism

本秂侑毒 提交于 2019-12-24 08:59:15
问题 Given a table of logical resource identifiers (one per row), what is the best way for an arbitrary number of database clients to perform the following operations: Claim access to a specific resource, if it is not already claimed SELECT the next available resource and claim it (similar to above) Release a previously-claimed resource (The table would have a "claimant" column, which would be NULL in unclaimed rows.) I'm stuck on the atomicity of these operations: would I need a whole-table lock

WPF binding issues with resource dictionaries

半世苍凉 提交于 2019-12-24 07:16:50
问题 I have developed a custom data grid control. This control has two parts, one is the custom template used by the data grid itself and the other is my custom control which adds a title area to the data grid. I have a class called CustomDataGrid, here is the XAML. <UserControl x:Class="MDT_Designer.Presentation.ScreenControls.CustomDataGrid" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas

Load image to program (to work with jar)

笑着哭i 提交于 2019-12-24 07:15:52
问题 I'd like to load an image to my program, but in away that my runnable jar will also be able to do so. So new ImageIcon(URL); to JLabel doesn't really work. All my java files are in src folder, in core package. I'd like to put my picture to src folder, but inside images package. Is that possible, or do I have to put my image to specific location inside my project? And what would be a way to load image into my program so it works inside a runnable jar? 回答1: The way I usually embed imagery

using resource files with parameters

三世轮回 提交于 2019-12-24 03:35:21
问题 My question is about resource files (.resx) in c#.(the "strings" part) I'm using it to store my messages,and I want to know how can we use the "value" of a resource entry with parameters ?! example : Name : ShowCellValue Value : value on cell : ? and row : ? is : ? and I want to fill the "?" parameters with different values. Thank you, 回答1: You can use string.Format on strings stored in your resource files. Store ShowCellValue as string showCellValue = "value on cell {0} and row {1} is {2}";

Loading Resources Once in Java

。_饼干妹妹 提交于 2019-12-24 03:24:13
问题 I have a project in Java requiring to load large files (corpus for NLP) for every execution. Let's call it method load(), and this is only called once, and the method process(String text) can be called multiple times where these belong to the class Tagger. My problem is that whenever I need to tweak some code except for class Tagger and recompile/run the project, where the project calls the method process(), I have to wait for some 10 or more seconds just to have these resources loaded. Can I

Getting Resources from a jar: classloader vs class resourceasstream

烈酒焚心 提交于 2019-12-24 02:39:05
问题 I am trying to implement a method that when called, get a string from a particular resource in the jar that the class is loaded from. For example: import mypath.myclass; //from a jar String result = gitid.getGitId(myclass.class); On the backed I am currently using: InputStream is = null; BufferedReader br = null; String line; is = c.getResourceAsStream("/com/file.text"); The problem is I keep getting the same resource for no matter what class I give it. I have also tried: is = c

What is the file path, as a string, of a file in the application's resources?

≡放荡痞女 提交于 2019-12-24 02:05:37
问题 The reason I ask is that I want to print, at run-time, a file in the application's resources, like this: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim printProcess As New Process printProcess.StartInfo.CreateNoWindow = True printProcess.StartInfo.FileName = "C:\Users\Geoffrey van Wyk\Documents\Countdown_Timer_Help.rtf" printProcess.StartInfo.FileName = My.Resources.Countdown_Timer_Help printProcess.StartInfo.Verb = "Print"

How to copy a resource directory and all included files and sub-folders in a Jar onto another directory

丶灬走出姿态 提交于 2019-12-24 01:44:29
问题 Is it possible to copy a resource folder, and all the files within, including all directories and sub directories therein into another directory? What I've managed so far is to copy only one file resource, which is a CSS file: public void addCSS() { Bundle bundle = FrameworkUtil.getBundle(this.getClass()); Bundle[] bArray = bundle.getBundleContext().getBundles(); Bundle cssBundle = null; for (Bundle b : bArray) { if (b.getSymbolicName().equals("mainscreen")) { cssBundle = b; break; } }