What is 'TextFile' and where it is uses in WPF project - c#

i want to know about the use of 'TextFile' item in wpf project-
1)I am Create a project in VS2010 .
2)write click on project(Or click on 'Project Tab in MenuBar')-->select 'Add New Item'--> in open dialog box,appear 'TextFile' option. see in picture.-

That's just a text file. It does nothing.
As with any other file, you are free to include it in your project as a resource, and perhaps load it at runtime via GetResourceStream() or something.

To expand on the previous answer, text files can be very useful in a number of ways, especially if you have multiple people working on a project. Adding a todo list or instructions to other developers in the project tree itself makes them more obvious.
It also helps to keep them up-to-date when using code revision control.
(Would have commented but not enough reputation... the previous answer sums it up)

I add 'TextFile' in project ,now problem is ,How to access it(Or Open it) on Button click Event.

Related

How can I customize existing user interfaces in WIX

I would like to add a custom user interface to my *.MSI created using Windows Installer XML. I am currently using the WIXUI_Advanced dialog set. I want to change the dialogs and remove some existing dialogs from it.
Can someone explain me the relationship between the dialogs and how to overwrite them with my custom code ? I have referred WIX documentation and ended up with a pile of errors while building the assembly.
Can someone explain me how these can be done with a working code example ?
Just download wix source code and use WIXUI_Advanced dialog wxs file as a template.
For example - Remove the InstallDirDlg in Publish elements and save it to your solution.
Check this link for example: http://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html

making a TreeView of our own file explorer

I'm trying to get a file explorer on c# and I have found nothing about this. Is c# provide a file explorer already ready to work?
If not, is TreeView a good idea to create mine? Have you got some link to perform this?
Thanks in advance for these informations.
C# Doesn't provide file explorer tree as it is, but if you want to create a dialog for selecting the folder you can use FolderBrowserDialog(full dialog for folder selection)
However if you want to create one, yes, It is easy to do it with WPF TreeView.
As a hint
Take TreeView, write HiearchyDataProvider which provides files and folders and templates for each node to display icons and so on
P.S.
Simple google search shows a lot of ready-samples

Application Links item in Open/SaveFileDialog in C#

When showing the open file dialog, I want to show up the "App,lication Links" category in the left side pane on Vista/7. Visual Studio does that too when opening project files.
How can I do this with a standard OpenFileDialog-Object in C#? I am using WPF by the way, but I don't think that matters in this case.
You need to use FileDialog.CustomPlaces. That MSDN link contains some sample code to get you going. Ultimately this is wrapping the native functionality exposed by IFileDialog::AddPlace.

How to avoid all code nodes to expand on project opening?

I have a C# project and some code pages have few thousand lines of code. I really like the idea of nodes in the code editor. I use it a lot and create many regions. But every time I open the project, all the nodes are expanded and I have to minimize them manually. It gets really annoying.
I have not found any help about this on internet nor in the options of VS. There must be a setting somewhere.
In the Options dialog onder Text Editor --> C# --> Advanced, there is an option "Enter outlining mode when files open". This should be checked.
In the IDE, from the Tools menu click Options. Alter default Outlining using
TextEditor->C#->Formatting->Advanced
There is a checkbox here you can use to set defaults for Outlining. This is VC# 10 Express but similar in other versions.
If you try the suggested change, you may be disappointed. According to this C# PM, who's responding to a similar complaint:
It is a bit confusing, but the
behavior you're seeing is intended.
The feedback that we received with VS
2003 was that we should persist the
outlining state of source files after
they have been closed and then
reopened. The option in Tools |
Option now effectively means what the
default behavior should be for a file
that you have never opened before. It
has no effect on files that you have
opened previously, since those files
already have a persisted outlining
state.
I don't want be a smart ass here, but often if you have that huge code in one file, you have more than one logical unit and might be able to (ans should) split it. (Single Responsibility Principle).
For my share, I don't like the regions because they are hiding code and I prefer to see all of it.

C# File Browsing w/ Checkboxes

Ok, so this question kind of builds on my last one. I am trying to build a "file browser" but it will do other things.
What I am trying to accomplish:
Have a tab dedicated to listing files just like "Browse Files" except I want to be able
check certain files and directories. I also want the functionality of "Browse Files" as
change location.
Get value's from checkboxes to apply elsewhere.
The question's kinda vague. We really need a basic implementation to build on or we might be giving you bad advice.
That said, here are some links that might help you get started:
SplitContainer control (in the toolbox)
ListView control (in the toolbox)
Get File Icon used by Shell

Categories