how to open a file and edit it in wpf - wpf

Hi
I have a textbox and a button named browser. When I click the browser button, my program uses the Microsoft.Win32.OpenFileDialog to display the file name I selected on the textbox. If I want to add one more button named open, when I click open button, the above file could be opened. No matter it's a *.cs file, *.txt or *.xml. Is this possible?
I try to use OpenFileDialog.OpenFile(), doesn't work. Thanks!

You can use System.Diagnostics.Process.Start it will use whatever is your default program to open the file, like this:
System.Diagnostics.Process.Start(filePath);

Related

Sketch How to open same file in multiple windows/tabs?

Is it possible to open the same .sketch file in multiple tabs/windows?
I tried File -> Open Recents -> Myfile and also opening it multiple times from the Finder but it just keep opening the same windows
You save the file as templateļ¼Œthen open from the template.
to save as template
File > Save As Template
open from template
File > New From Template > select your template
If you want to change the template , you have to save the same name as your template name .
If I have you right, the feature you're looking for is known as Custom Views in Adobe Illustrator, accessible in the menus by "View" > "New view".
I was looking for this feature in Sketch just now, but was unable to find it.
Not really comparable, but I temporarily solved this itch by creating a new Sketch document as a throwaway "New View", and then dragging over a desired Page from the Pages panel above the Layers list in the sidebar of the source document.

Disable sublime text file-reload dialog

Is there a way to disable sublime text file reload dialog from popping up when the content of the current file has changed due to some modifications(modification + save from another text editor).
sublime text file reload dialog is this:
Thank you for your suggestions.
As far as I know, Sublime will prompt only if the file has unsaved changes by default.
If you get a prompt even if the file hasn't been modified, you could set always_prompt_for_file_reload to false in your user settings.
// Always prompt before reloading a file, even if the file hasn't been
// modified. The default behavior is to automatically reload a file if it
// hasn't been edited. If a file has unsaved changes, a prompt will always
// be shown.
"always_prompt_for_file_reload": false

how to close a tabbed window using testcomplete?

I am trying to access a tabbed window which is under Multiple Document interface window under which there are tabs which are generated dynamically.
I wanted to check whether the new tab is opened successfully or not, and after its been opened i need to close it too.I tried to get the number of tabs opened using the following piece of code:
mdiclient.ChildCount
Now need a way to close the opened Tab without using Click coordinates.
Try getting the tab object as a child of the mdiclient window and then call its Close method.
tried using The Close one .. but it always closed the 1st tab .. so i found a Workaround,
use :
mdiclient.Child(index).Dispose
Worked for me like a charm... got the count of the number of tabs opened using the
mdiclient.Controls.get_count

How to modify Centos 5.5 default open command

In Centos 5.5, each time I double click a file named "*.pl" in File Browser, it open a new emacs editor instance.
I want Emacs to run in a single instance way, so I need to modify the open command to "emacsclient %f", but I don't know where and how to modify the configuration.
Easiest way to do this is:
1. Find a .pl file on your desktop or in the File Browser (nautilus)
2. Right click it, select Properties
3. Pick "Open With" tab
4. If you don't see emacsclient, press the add button
a. Can check the list in Add Application dialog for emacsclient
I) If absent, click Use a custom command and browse or enter the path
to the emacsclient executable (mine is at /usr/local/bin/emacsclient).
b. Select emacsclient in the list
c. Press the Add button
5. Make sure the radiobutton is selected for emacsclient in the "Open With"
dialog
6. Press the close button.

Powershell: How to open a file from a separate window

I'm using PowerShell for about a week now. I am able to open a specific URL and fill in my username and password automatically. I can also navigate to a certain page where multiple files can be found to download.
I use the following command to select a certain file to download:
$ie.navigate2('http://www.example.com/resource.aspx?ResourceID=GetDocStoreFile&EntryID=1234')
What happens next is that a second window will open, named "file download". There are three buttons: open, save and close.
I don't want to press the "open" button manually, but would like the script to do that for me and then goes back to the original window to select another file. Any suggestions?
If you use a download URL, I don't think you can interact directly with IE using the COM object, because there's no document. Once the dialog box opens, all of the object's properties become null. You can use the method I posted here: How to perform keystroke inside powershell? AppActivate will work to activate a dialog box by title.
The % represents the the ALT key, so if the underlined letter of the button you want to click is O, you'd invoke SendKeys like this:
$wshell.SendKeys('%O')

Resources