I've seen an IPad / IPhone emulator for Apple...but typical apple they want you to only install and run it on an apple. Go to their IStore and look for developer tools, etc.
Michael Eber
Posts
-
IPhone / IPad / Android / Windows Phone 7 how to quickly test a web page without buying those devices? -
A question on wcf and composite objectsThis is my scenario: I have a huge database and I'm building numerous services to access the data. Each service exposes a unique set of data and services to the consumer. So for an object such as Company our internal service needs the raw address in the composite. However our portal service need fully enumerated Address info in the composite. I wanted to avoid having a massive object with various composite addon's that don't apply to a given object but I'm running into difficulties. First I decided that each composite builder class will be in a namespace deeper than the data namespace. So instead of myApp.Data it would be myApp.Data.Mainservice and myApp.Data.Portalservice for the composite objects. My next step was to inherit Company, add a constructure that takes Company as input to populate internal fields, and add the DataMember for each Composite that is needed. Works great but I get a runtime error that I cannot inherit an object that is not marked as Serializable or DataContract. Initially I just added a public partial class Customer and added the DataContract attribute, but that does not expose the DataMembers inside of the object. I also cannot use the partial class definition as I need to be inside the namespace of the Customer object which puts me back into the same problem of having an accumulation of composite objects. For those who need pictures here is the code I want to implement:
namespace Company.Data.InternalServices { \[DataContract\] public sealed class CompositeLocation : Company.Data.Location { \[DataMember\] public Address LocationAddress{get;set;} } \[ServiceContract\] public class InternalContract:IInternalContract { \[OperationContract\] public CompositeLocation GetLocation( Guid LocationIdentity ); } } namespace Company.Data.Portal { \[DataContract\] public sealed class CompositeLocation:Location { \[DataMember\] public EnumeratedAddress{get;set;} } \[ServiceContract\] public class PortalContract:IPortalContract { \[OperationContract\] public CompositeLocation GetLocation(Guid LocationIdentity); } }
When no method returns a Location, WCF drops the DataContract for Location. I want to force it to keep Lo
-
ErrorProvider logic to avoid DialogResult.OK button completion?Your question is a little confusing but I'll take a stab at your question. You cannot use the basic MessageBox for what you want to do. You creat a form, design it as a dialog, and put your own code in the form to accomplish that. Now if you are really sharp then you can do something like this: Create the form and make the constructor require an IValidator class passed in the constructor. Add an OkayButton CancelButton and make the OkayButton disabled. Define your interface for IValidator. The Validator will implement it's own rules for what is valid and what is invalid. As the data is entered into the form, the data is passed into the validator such that OkayButton.Enabled = Validator.IsValid( entryBox.Text ); As long as the data is valid (or once it is valid) the button will light up. As long as it is invalid it remains disabled. By doing this, you have an extensible dialog box that can have an infinite number of validation rules without ever having to change a line of code in the control.
-
to show checkBox 'true' using List ViewThis is the C# forum. You don't state what you are using this in. Is it a web page, WPF, or Silverlight application? It makes a big deal as to how to do things based on where you display it.
-
Deploying new WCF service does not expose client ???!!!I built a brand new WCF Service which has 11 methods. Added the data layer (linq to sql) and added a test project. I have the service defined for basicHTTP and SecurityMode=None. When I do a Service Reference in the test project, I get all of my data object but no client for my service. I've looked over everything and can find nothing wrong with the coding of the service. I've looked over the web.config and can find nother wrong with that either. I'm coding the service under VS2010, C#, I've done a VIew in Browser and the service displays properly and the WSDL displays properly. Yet no matter what I do I cannot get client code (CentralServicesClient) to appear in the class. Has anyone expereinced this with VS2010??? I swear all Microsoft does is take something that is easy to do and works and then they break it and make it hard to deploy!!!
-
Service discovery within solution when deployed with servicesI have two services that are in a single solution. Each is a windows service. One is a WCF service with a named pipe endpoint. The other is a service which will consume the WCF service. I'm doing this in Visual Studio 2010 using all 4.0 framework components. My question is how do I discover the service? When I add Service Reference and hit Discover it says I have no services in my solution. I created the service by creating a Windows Service, creating a refernce to my service DLL's, and running the service via ServiceHost. Should I have created this project a different way?? (followed what was posted on MSDN for doing this)
-
Need a quick answer on Wcf Configuration Editor....I ran into an issue that I cannot do a WORKAROUND with my service under the 4.0 framework. I converted the service in IIS to 2.0, I converted the project to 3.5, and now I need to configure the service. It is correct to assume that I must use the 3.0 wcf configuration tool instead of the 4.0 config too?
-
top thisOMG -- so THAT is why I'm not raking in the big bucks. I write layered code that is reusable, maintainable, extensible, and uhhhhmmm works. ;)
-
How to bind the Stackpanel object into ListView -
Sanity Check : Anyone doing Linq to SQL under 4.0 framework and WCF?I converted my 2008 / .NET 2.0 data service to VS2010 with the 4.0 framework. I can do my normal test: http://localhost:4440/datareflector.svc and I get my wsdl screen. If I click the link I get all of my WSDL as expected. So nothing is wrong there. My data structure uses Linq to Sql to connect to he database and extract information. The applications' service reference has all of the data in it correctly. When I call the service I get a report that the service terminated. When I attach my code to the service and enter debug the results totally floor me: my code pattern is simple:
public things\[\] GetMyThings( Guid myIdentity ) { using ( MyContext context = new MyContext( connectionString ) ) { var mt = from t in context.ThingTable where t.Identity == myIdentity select t; return mt.ToArray(); } }\*
When I walk through this simplistic code, I can confirm that mt ends up populated with the rows and values expected and goes through the return code just fine. At the end of the walk (the bracket marked with the *) when I hit F11 I get the exception InvalidOperationException ' Attempting to access an object (context) that has been disposed. ' I cannot, for the life of me, figure this one out. About to wipe my machine and do a full reinstall just to see if that cleans up everything. This is an issue no one seems to have an answer for. Has ANYONE experienced this kind of issue?
-
Need help with this control alignment issueAfter doing a few more tests it turns out that the work area was 600x400 but the user control was 600x800. After resizing the user control to the area of the dock panel, everything displays properly.
-
How to bind the Stackpanel object into ListViewyou need to define the stackpanel in a column template.
-
Removing specific object from a container and add it to anotherIf you run that code in debug mode you WILL experience an exception. You cannot remove an item from a collection that is being enumerated. So what I do in that case is this:
List<int> itemsToRemove = new List<int>(); for ( int index = 0; index<LayoutRood.Children.Count; index++ ) { if ( LayoutRoot.Children\[index\] is Button ) itemsToRemove.Add(index); } // Next process the items to move foreach ( int element in itemsToRemove ) { Button oldElement = LayoutRoot.Children\[element\] as Button; LayoutRood.Children.RemoveAt(element); StackPanel1.Children.Add(oldElement); }
Take this one warning into account: you MIGHT get an exception that the element is already a member of another collection. The exception will point at your StackPanel1 add to the elements. If that happens then do the following:
Button newElement = new Button; newElement.Name = oldElement.Name; . . . // you get the idea // now add the new instance of the button to the collection
-
Need help with this control alignment issueI'm almost bald from pulling my hair out over this bug. I have a WPF window which as a section defined as follows:
<StackPanel Name="stackPaneln" Orientation="Horizontal" Margin="-1,29,0,54"> <DockPanel Name="navigation" > <StackPanel Name="stackPanel1" Width="162" HorizontalAlignment="Left" Height="486"> <Button Height="103" Name="configurationViewerRequest" Width="120" Margin="0,5" Click="configurationViewerRequest\_Click"> <StackPanel Orientation="Vertical"> <Image Source="Configuration\_icon\_by\_obsilion.png" Height="73" /> <TextBlock Text="Configuration" TextAlignment="Center" Margin="0,5,0,0" /> </StackPanel> </Button> <Button Height="100" Name="systemStatus" Width="120" Margin="0,5" Click="systemStatus\_Click"> <StackPanel Orientation="Vertical"> <Image Source="SystemMonitor.png" Height="73" /> <TextBlock Text="System Status" TextAlignment="Center" Margin="0,5,0,0" /> </StackPanel> </Button> <Button Height="103" Name="systemMonitor" Width="120" Margin="0,5" Click="systemMonitor\_Click"> <StackPanel Orientation="Vertical"> <Image Source="ViewInfo.png" Height="73" /> <TextBlock Text="System Monitor" TextAlignment="Center" Margin="0,5,0,0" /> </StackPanel> </Button> </StackPanel> </DockPanel> <DockPanel Name="destination" Margin="10,0,0,0" Width="608"> </DockPanel> </StackPanel>
The problem: When one of the buttons in the Navigation panel is clicked, the user control that provides the functionality is loaded into the 'destination' dock panel. So I have a user control which has a treeview and an editor window. In the editor window I put a label with content = '<----the navigation of over there' When the configuration button is clicked I create an instance of the editor, and do destination.Children.Add(controlEditor); Problem: the control is shifted all the way to the right of the window (aligned with x=0 of the Window!!! instead of the DockPanel!!!! Here is the xaml of the control I'm loading in case I screwed up there....
<UserControl x:Class="SnmpBrowser.ConfigurationManager"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compa -
DragMove not working with MouseUp eventSince the first days of windows event programming it has always been a heirarchy for event processing that the form first, container second, contained controls next, controls in a container in the contained controls last.... The only way you can get away from that is not going to be clean. On MouseEnter on your control, remove the DragMove event handler binding and put your mouse click event on. On MouseLeave on your control, remove the left button event handler and put DragMove back on.
-
WPF equivalent of anchoring controls?Thanks, I'll give it a try.
-
WPF equivalent of anchoring controls?In the WinForm days there was a lot of work done with anchoring to make controls adjust to resizing of the window. What is the equivalent approach in WPF applications? What are best practices for scaling controls? Implement with inline code or what? Thanks
-
multiple WCF client endpoints exposed as dropdown listI am building a fairly large network of agents and 'mothership' servers. I'm writing a WPF application which will connect to each mother and either configure/manage/view it's agents. I can have a large collection of mother's out there. What I want to do is keep client configurations in the config file. In the program I want to be able to scan the clients and for each endpoint build up a list of endpoint names. This way the consumer of the program can select a mother, then run requests against that service. It looks as if ConfigurationManager.GetSection() might do the trick, but it only returns an object. Has anyone written code to walk the list of client endpoints to build a list? Any help appreciated
-
Curios as to why this doesn't work...Well...according to the documentation all I need are two things. TwoWay link on the binding between the ItemSource object and the ListIndex, and the ObservableCollection. But I can add INotifyProperty and see if that helps.
-
WCF 2nd operation fails.It would be better if you listed specifics of your program. First of all, do you keep the data connection open all the time? If so the first thing to look at is making your connection to the database short lived. So every round trip requires creating a client, doing client.Open(), making the call and client.Close() followed by the async response handler. Make sure you are always closing your client and not leaving behind any connections that could cause problems.