Donaghy's Q&A profile
Visual Studio 2008 (Pre-release) DependencyProperty.IsAttached
Given a DependencyProperty instance, I want to know if it is an attached property. So IsAttached(Canvas.LeftProperty) should be true, IsAttached(FrameworkElement.MarginProperty) should be false. I don't see a way to get this information from the members of DependencyProperty, but maybe I'm missing some class with helper methods regarding dependency properties bool IsAttached(DependencyProperty p) { return ; } try DependencyPropertyDescriptor dpd = DependencyPropertyDescriptor .FromProperty( FrameworkElement .MarginProperty, typeof ( Canvas )); then use dpd.IsAttached ...Show All
Windows Forms Windows Forms Connection String Encryption
I have tried multiple methods of encrypting connection strings in app.config and other encrypting in code. Most would put the encyption methods in the code and encrypt the connection string and it would be satisfied. But think like a hacker for a second. Build a simple app, add a connection string to the application. Build the app. Go to your project directory->Bin directory and find the app exe. Rename it to app.txt and open the app in notepad. Make sure notepad is set to wrap, go all the way down to the bottom of the file and you will see the connection string in plain text. It will look like J EData Source=localhost;Initial Catalog=database;Integrated Security=True 1.0.0.0 ) Imagine if the username and password bei ...Show All
.NET Development Behavior of XPath Query to find attribute that had the maximum value
I have the following Xml: <Books><Book id="10"/><Book id="16" /><Book id="12" /><Book id="18" /></Books> I wanted to get the Book node that had the highest "id" value (<Book id="18" /> node in our case). The following XPath query works perfectly fine. /Books/Book/@id[not (. < ../preceding-sibling::Book/@id) and not(. < ../following-sibling::Book/@id)] I was trying to understand this query and changed it to: /Books/Book/@id [(. > ../preceding-sibling::Book/@id) and (. > ../following-sibling::Book/@id)] Note that I removed the not operator and changed the comparison operator. However, I find that the above query ...Show All
Visual Studio Cannot set value because it is in a register and not in the top frame
Hi. I have a problem, that... when the string variable shows "mystring" but string.IsNullOrEmpty evaluates to true. I'm using this variable to access SortedList and it fails that key cannot be null. However when I watch the variable it has the value it is supposed to have. The subroutine where it first occurs is: public bool IsReadOnly( string fmBind) { XPathNavigator node = xpData.SelectSingleNode(bindings[fmBind].NodeSet, _nm); if ( string .IsNullOrEmpty(bindings[fmBind].ReadOnly)) return false ; return /*node != null && */ ( bool )node.Evaluate(bindings[fmBind].ReadOnly); } Exception is thrown on the return - because node gets null. However I cannot try to find out why it is, b ...Show All
Visual Studio DataGridView wrapper - additional property-combobox fill up
Hi All, I have made a datagridview wrapper, in wich I add properties to grid for the developer to see at the design time in properties window of the grid . The properties in which developer has to type in a value, those are easy to do. But now I have to make a property as such which appears as a combobox and has 2 values(same as autoscroll property of datagridview -where we have true and false as two default values, and false is default) which are strings and appear in dropdown. I have been able to make a property appear as combobox, but I am nto able to fill up the dropdown list. The code to make property as combobox is here below: ComboBox formManagerMode; public ComboBox FormManagerMode { get { ...Show All
Visual Basic VB 2005 Blues
I retired 12 months ago and I tried my luck with programming before senility took completely over. I was successful constructing six programs all dictionaries of chords (Guitar, Bass and Keyboards) and/or scales of 53 types of mysic (Mongolian, Hungarian-Gypsy and Persian included) in all 12 keys. Unfortunately I did them in VB6 and not possible to add sound hence VB 2005 with NET 2.0 promises possibilities. But what was ease whith VB6 I find impossible with VB 2005 and no amount of Wizard upgrading was able to assist me. So here I am asking any direction or assistance from You Lovely People It will be GREATLY appreciated. Private Sub List1_Click() if List2.Text = "A" Then ...Show All
SQL Server Need help in copying a temp tables contents to a existing table
I have a real table with an identity column and a trigger to populate this column. I need to import / massage data for data loads from a different format, so I have a temp table defined that contains only the columns that are represented in the data file so I can bulk insert. I then alter this table to add all the other columns so that it reflects all the columns in the real table. I then populate all the values so that this contains the data I need. I then want to insert into the real table pushing the data from the temp table, however this gives me errors stating that the query returned multiple rows. I specified all the columns in the insert grouping as well as on the select from the temp table. ANY thoughts / comments ar ...Show All
Game Technologies: DirectX, XNA, XACT, etc. get screen resolution & FullScreen
How do I get screen resolution of the computer Because my program will be shared between many computers, I want the program to find the resolution of the computer on wich it is running. By example, on my computer at home, the program will return the value 1024 and the value 768 in order to make 1024 X 768. On my laptop, I will get 1920 and 1200. I want to get the width and the height separately, in two variables. With those values, I will be able to set automatically on each computer the window size as I want it. To resume, I am looking for something like this: width = computer.ScreenResolution.width; height = computer.ScreenResolution.height; Also... If I ever decide to start the game in FullScreen (Make the wind ...Show All
Visual C# Accessing info from Active Directory
Hi, I am creating an intranet using VS2005 with C# as the language of choice. I would like to access some information from Active Directory (which is on another server) on users that log in. Does anyone know of a tutorial online that I could read to see how this can be done or a book that covers this I would want to be able to generate a drop-down list containing all users from the directory as well as displaying the logged-in users' name. Thanks in advance There are lot of Tutorials available to read AD http://asp.dotnetheaven.com/howto/doc/adread.aspx http://msdn.microsoft.com/library/default.asp url=/library/en-us/sds/sds/directorysearcher_example.asp http://msdn.microsoft.com/library/de ...Show All
Visual Studio Team System 2 questions about Automation Build / Build Types.
Hi folks, these are very blond questions - i'm trying to figure out what this Build Automation stuff is in TFS. 1) Are there any url links to that explain what this is and how to get started with it 2) How does Build Types differ from Web Deployment projects Basically, i have some class libraries, a web project and some test cases (unit tests and later on some web tests). I'm guessing the build automation that comes with TFS is used to build my solution, test cases and code coverage and then deploy the website to the iis machine thanks in advance to any help. :) Hi Aaron - I would be forever in your debt if you could post a few blogs about the various wishes i requested (above). I understand that i have been greedy and a ...Show All
Visual Studio ResolveAssemblyReference
I've been encountering a strange bug in MSBuild that I can't find a workaround or solution for. We have a relatively complex solution of 18 various project files, one of which is a VS2005 SP1 "Web Application Project". When I compile the solution in MSBuild using the command: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild /l:FileLogger,Microsoft.Build.Engine;logfile=Build.log;verbosity=Detailed "C:\Sandbox\Development\Server\BRServer.sln" The Web Application Project does not copy all of the required project dependencies to the output folder! Checking the detailed log, I see this: Task "ResolveAssemblyReference" Assemblies: System System.Data System.Drawing ...Show All
Visual Studio 2008 (Pre-release) Slow Render Performance (2000+ UIElements)
I’m creating a Grid that is 35x35, each cell containing a ContentControl with a ContentTemplate defining a TextBlock inside a Border. It is necessary for the entire grid to be rendered at one time. Perhaps obviously, there is a noticeable delay after my code ends (building the grid dynamically) and when the grid displays on the screen. (based on Timers and a Debug.Write) The delay also seems to occur when I’m building the grid for printing and its not actually rendered. I would guess I’ve reached a limitation of WPF, but is there something I can do to minimize this delay Thanks for suggestions. ----- Code --- <Style x:Key="DefaultCellBox" TargetType="{x:Type ContentControl}"> <Se ...Show All
.NET Development Escaping decimal points in regular expressions
I'm trying to do something that ought to be very simple. I'm trying to test whether a string (which is an argument to a command) is a valid value of the type I need. That is, I want it to be convertable to a double and be in the range 0.1-1.0. I have this line in my code: Regex ValidPause = new Regex("^((1\.0)|(0\.[1-9]))$"); The problem is that VS marks the string as bad and gives me the message "Unrecognized escape sequence." If I take out the backslashes, the red squiggly line goes away, but then it matches "0x0", which is obviously not what I want. How should I escape the decimal points correctly Thanks! That worked. I didn't think it would because I thought the '@' just ...Show All
SQL Server How can i find the default values for a Stored Procedure parameter
I have a stored procedure, CREATE PROCEDURE [dbo] . [SReport] ( @ListByBatch BIT , @UnPrintedOnly BIT = 1 ) AS ............................ ........ I can find the information regarding parameters of this Stored Procedure from " syscolumns" or " Information_Schema.Parameters" system tables. These tables provides information about parametername, datatype ...etc. But dont provide information about default values for these parameters. Here i have assigned a value, Does SQL Server stores this value Does SQL Server maintains information about Default Values for Parameter (For tables it maintains the default value for a column). Is there any way , i can find All pa ...Show All
Visual Studio Namespace Summary pages - adding additional content
I would like to automate the process of adding a "Resources" section to my namespace summary pages. This section will contain links to additional content (UML diagrams, etc.). Any help would be greatly appreciated. Also, if anyone has done this type of thing in nDoc, please let me know as well. TIA. EWoodruff wrote: You can put HTML links to other pages including the additional content pages in the namespace summary comments. Eric I would like to automate the process though (i.e. via xml from within the various projects in the solution). It's a very large application, so we want to make the process as non-manual as possible. ...Show All
