How to get the selected items in source control explorer? - vspackage

I'm writing a vspackage and while I can add things to the context menus in source control explorer, I don't know how to figure out the currently selected file(s).
For the solution explorer, I know I can do something like this:
var applicationObject = GetDTE2();
UIHierarchy hierarchy = applicationObject.ToolWindows.SolutionExplorer;
Array selectedItems = (Array)hierarchy.SelectedItems;
But looking at applicationObject.ActiveWindow gives me the source control explorer window, but I can't figure out any way to figure out what files are selected.

Related

Transfer a file to a web page via browse button

I want to fill in a form in VBA. I can fill everything empty field and set the drop down menus. However I couldn't find a way to put a file in the browse button.
The code for this button is:
I tried something like this
IE.Document.getElementById("browseFiles").Value = "C:\Users\nx\Documents\BCAM development.docx"
or
IE.Document.getElementById("fileElement").Value = "C:\Users\nx\Documents\BCAM development.docx"
As expected it didn't work even though it doesn't give me any error.
Do you know if it is possible to transfer a file like this?
Thank you in advance!

Xpages - Custom property using method binding option is not showing the content

I have a custom control with around 20 custom properties. However, some of these properties need to contain code logic. This is fine, as I create the property as Type: javax.faces.el.MethodBinding and Editor: Method Binding Editor which works fine.
However, once I close the editor, click somewhere else, then click back to the custom properties of my custom control, the code has disappeared. If I look at the source code however, the logic is visible. Its a little frustrating, as whenever I want to use the editor, I need to copy my code from the source and paste back into the editor (to help with formatting, showing errors as I type etc)
Has anyone else come across this and know how to fix it, or is this just another quirk of designer?
This image shows the empty property
This image shows the property has logic in the source code

Command Not Handled Exception

I'm new to Domino Designer. I'm trying to modify an existing application which is running on a remote server. I create a blank xPage and view in browser and it works. I add a label and view in browser and it works. I add a combo box and setup a data source for my xPage. The data source is in the current application and I'm using a view. I setup my combo to point to that data source and specify BindTo value. I view it in browser and I get Error 500 "HTTP Web Server: Command Not Handled Exception" I can open the view that I've used and see all the data in the view. I can even add, edit, and delete from the view.
Ideas... Thnxs in advance.
Additional Info. I've added a "View" from "Container Controls" and used the same data source and the same view and it also works in the browser.
The error being printed is:
javax.faces.el.PropertyNotFoundException: Error getting property 'CompanyName' from bean of type lotus.domino.local.View
com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:119)
com.ibm.xsp.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:144)
com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:182)
com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:163)
com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.j‌​ava:257)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:150) ....
This was already answered in the comments, but I want to write a better answer.
The problem in this case is that a view data source is being used for editing a document. Directly, this is not a possibility, though there are a few great ways to get around this. The first way, and my favorite, is to use an inline form. I think the Extension Library Demo database offers a few great examples of how to go about doing this. One way is to use a tooltip dialog. Another way is an inline form. A repeater is used and for every row in the view, a hidden panel can be made which contains the document data source and all field which are required to be changeable. By clicking on a button or link, the panel is made visible. This is my favorite variant because it is simple, quick, and generally looks great.
Another way to go about this is to have a view data source only, but use scripts to retrieve the document and set the values in the background and then save and release. It all depends on what you are trying to achieve.
My main recommendation is to look at the ExtLib demo and take a look at what they are doing there.

vc Resource item display can't be access & is disable

I use VC and I'd like to load a bitmap file on my user Dialogue.
But when I choose the picture item and add it into my Dialogue.
I found that the picture item can't be access by its property.
I can only show the bitmap by adding a bitmap item and I
can not use the picture item. why? Could have anyone else tell me
how to enable the picture item in my Dialogue , so that I can edit
the picture item 's property??
Lovely everybody, I found my soloution, And Now I
can show different Bitmap in my Dialogue without
use any source code.
Here is the Website that I found the problem:
http://www.functionx.com/visualc/applications/displaybitmap.htm
Hope it help

Loading embedded resource .rtf file into richtextbox on load C#

Ok so I read about loading an embedded rtf into a rich text box and I am trying to do it when the form loads. The form is not the main form, it is a second form that loads when a control is clicked. This is what I have on the form when it loads:
private void Credits_Load(object sender, EventArgs e)
{
Assembly creditAssm = Assembly.GetExecutingAssembly();
using (Stream creditStream =
creditAssm.GetManifestResourceStream("YDisplayView.credits.rtf"))
{
creditsRichTextBox.LoadFile(creditStream, RichTextBoxStreamType.RichText);
}
}
In the solution explorer the rtf file shows as a resource and the build action is set to embedded resource.
when I click the button to load the form, it shows as expected, but nothing happens. The contents of the rtf doesn't seem to show :/
I can only assume I am doing it wrong :(
Any help for this newbie would be appreciated.
I figured it out:
creditAssm.GetManifestResourceStream("YDisplayView.credits.rtf"))
needed to be:
creditAssm.GetManifestResourceStream("YDisplayView.Resources.credits.rtf"))
Edit: For some reason this time around I can't get the above code to work but I found another one that did so hopefully either/or will be of some help to new coders out there :)
string rtf = yourAppName.Properties.Resources.yourEmbeddedRTFName;
yourRichTextBox.Rtf = rtf;
I wanted to create an rtf help file named Help.rtf and have it stored as a resource and so it could be loaded when a Help form was loaded without having a Help.rtf hanging around the application folders.
I found I needed to add the rtf file to the resources through the menu's Project-> 'Your name space' Properties... then navigate to Resources tab, then Add Item etc etc... before the intellisense would offer the rtf file in it's drop-down list when I typed 'My.Resource.' Now, the list of resources including the Help file I added shows up (without extension, which is normal).
In short, once this was done, then the following worked:
RichTextBox1.rtf = My.Resources.Help
Apparently it wasn't enough just to Drag&Drop, Copy or even add the file using the 'Solution Explorer'!
Spent 3 days on this problem so I hope someone finds it usefull.

Resources