WP7 - Clearing Isolated Storage for my application - windows-phone-7

I would like the users to be able to wipe out their isolated storage for my application and start over. Is there a way to do this? Is this suggested? If so to both prior questions, what is the best way to do this?
Update:
After thinking about this question a little bit, I'm thinking I can probably look through my collection and do a remove operation... So I guess that is one way. Is there a more complete way?

You can do this with IsolatedStorageFile.Remove. It removes all the contents of the application's Isolated Storage.

Have you taken a look at the Isolated Storage Best Practices for Windows Phone? I think you would simply implement this through functionality in your app that gives user access to the relevant directory in the isolated storage scope and allows them to delete specific or in your case, all files. The second link has examples of how to do this.

Related

Creating a Single Container Virtual Data Folder

I have been searching everywhere for all the combinations of things that I want to accomplish hoping something would pop but I can't find anything. Additionally, I am not sure if I am "crafting" my query properly enough so I am hoping I can get some assistance on that here.
What I would like to accomplish is this (pseudo logic)
Create a single container file, for example: vdata.x which will contain everything in it as a single data file
Mount this file as an actual drive/folder in Windows so that you can write to, read from, delete/modify the content as if you were using Windows Explorer. Visible to FS, applications, system/commandline like any other "real" folder on the machine.
Prefer the ability to have this file reside on a thumbdrive and have it mounted either automatically or manually after plugged in and have it show up not as the thumbdrive but as the file inside it, or mount both doesn't matter.
Additionally the ability for that file to be locked, encrypted and accessible (despite auto mounting, if that's the case) after it have been authenticated with a password, random token or whatnot.
Finally a housekeeping element, such as being aware of its available "host" space (aka the thumbdrive) so that as it reaches a certain threshold of expansion, it says, hey move me to a larger device, make room or stop adding more, something akin to, running out of space warning.
I thought about putting this in software recommendation SE but that is not fully up and running yet (at last check) and plus the range of who access that sub-se might very limited, so I am asking here to get feedback and discussion to see if we can answer it better here or it needs to move to there.
Thank you in advance and hope to get some brilliant minds out there to help me accomplish this.
PS. I am not averse to building something like this myself but I am limited in time and health and plus if its already done, why reinvent the wheel right? But if anything could help launch the development of such a tool, I would take that input as well, thank you.

Most suitable place to store programdata for use over network

I am currently working on a CRM application. The application is meant for multiple users, so I need a suitable folder to store things like documents, notes and most importantly the database. This folder should be shared across all users and over network as well.
After searching online it seemed this folder is recommended: "C:\Users\Public\Public Documents". However, this seems like a rather 'hard to find' folder for our customers, who are for the most part little to no experience with computers.
Our non-programmer suggested simply using "C:\CRM\", since it is very easy to find even for new users (and unlikely to be forgotten during a backup!)
I've been trying to find out what the (technical) ups and downs about these two folders are, but I'm finding it hard to get a clear answer. So bassicaly my question is:
Can anyone explain to me why I shouldn't use "C:\CRM\", but I should use "C:\Users\Public\Public"? And what problems I could run into when I do use "C:\CRM\"?
Thanks in advance!

Using version control (SVN) for images

We have images stored in a file system in the following format. So that web applications can have access to those images with url (http://imageserver.domain.com/items/it1/small.jpg) through an http server.
Now, to allow graphics team to have access to those images for
adding/updating, I was thinking to setup an SVN rep for the folder
“items”. Is this considered a best practice? Any suggestions?
Its certainly doable, however I'd advise that you have 2 folders: one containing a "working set" of images to be used by your web app, and another to be accessed by your graphics team whenever necessary. That way, your team can have a stock of images to work with, while avoiding any possibilities of broken image links or other problems inside your web app.
Better to play it safe IMO.
Hope this helps!
I've always heard that it's considered 'good practice' to have only text under source control. With that said, I've seen companies certainly put images in their repository. Others have created round-abouts like having a virtual directory in IIS point to a shared file server. I prefer the latter since it doesn't take so long to bring down branches. On the reverse side, it provides no historical data that SC would--if needed, of course.
I was thinking to setup an SVN rep for the folder “items”. Is this considered a best practice?
It's an acceptable practice. The images are small and not all that likely to change.
Any suggestions?
Write a cheat sheet for your graphic artists so that they can check out and commit images without problems. The cheat sheets would be specific to the graphic tools they use and their access to Subversion.

Redirect the open syscall of resource on Windows

Let me first explain my situation:
I have an old application and don't have any possibility of changing it. This application works with sqlite tables, one of them being a "temporary" database, but does not create temporary tables in memory but rather uses normal tables.
I install this application in a terminal server and the problem is that the application tries to read from a static path from the temporary table.
I need to redirect the "open syscall" to another file, so I want to know if I could do that with some software or by programming it.
Several options in order of "preferableness":
Create a junction. Click the link to get a tool for doing this.
Use a shim if possible.
If the above are not possible then you could use Madshi's madCodeHook lib to intercept the(*) call. Somebody over here is having a similar question, the discussion there also applies to your situation.
Be careful though when using API hooking and always ask yourself what would happen if two programs are doing it at the same time. This would likely result in an unstable system a.k.a. a mess.
(*) You would also have to figure out which call you actually need to hook.
You should be able to do that with a junction point.

Is it possible to list named events in Windows?

I would like to create events for certain resources that are used across various processes and access these events by name. The problem seems to be that the names of the events must be known to all applications referring to them.
Is there maybe a way to get a list of names events in the system?
I am aware that I might use some standard names, but it seems rather inflexible with regard to future extensibility (all application would require a recompile).
I'm afraid, I can't even consider ZwOpenDirectoryObject, because it is described as needing Windows XP or higher, so it is out of question. Thanks for the suggestion though.
I am a little unsure about shared memory, because I haven't tried it so far. Might do some reading in that area I guess. Configuration files and registry are a slight problem, because they do tend to fail with Vista due to access problems. I am a bit afraid, that shared memory will have the same problem.
The idea with ProcessExplorer sounds promising. Does anyone know an API that could be used for listing events for a process? And, does it work without administrative rights?
Thank you for the clarification.
There is not really a master process. It is more of a driver dll that is used from different processes and the events would be used to "lock" resources used by these processes.
I am thinking about setting up a central service that has sufficient access rights even under Vista. It will certainly complicate things, but it might be the only thing left facing the problems with security.
No, there is not any facility to enumerate named events. You could enumerate all objects in the respective object manager directory using ZwOpenDirectoryObject and then filter for events. But this routine is undocumented and therefore should not be used without good reason.
Why not use a separate mechanism to share the event names? You could list them in a configuration file, a registry key or maybe even in shared memory.
Do not mix up the user mode ZwOpenDirectoryObject with the kernel mode ZwOpenDirectoryObject -- the kernel mode API (http://msdn.microsoft.com/en-us/library/ms800966.aspx) indeed seems to available as of XP only, but the user mode version should be available at least since NT 4. Anyway, I would not recommend using ZwOpenDirectoryObject.
Why should configuration files and registry keys fail on Vista? Of course, you have to get the security settings right -- but you would have to do that for your named events as well -- so there should not be a big difference here. Maybe you should tell us some more details about the nature of your processes -- do they all run within the same logon session or do they run as different users even? And is there some master process or who creates the events in the first place?
Frankly, I tend to find the Process Explorer idea to be not a very good one. Despite the fact that you probably will not be able to accomplish that without using undocumented APIs and/or a device driver, I do not think that a process should be spelunking around in the handle table of another process just to find out the names of some kernel objects. And, of course, the same security issues apply again.
ProcessExplorer is able to enumerate all the named events held by some specific process. You could go over the entire process list and do something similar although I have now clue as to what API is used to get the list...

Resources