Search Results

Search found 9 results on 1 pages for 'graemef'.

Page 1/1 | 1 

  • Why does 1080p through a VGA cable fit my HDTV but is oversized when through an HDMI cable?

    - by GraemeF
    I have put together a new PC with a XFX GeForce GTX 260 graphics card and have it connected to my HDTV. First, I used an old VGA cable with a DVI to VGA adapter and plugged it in to my HDTV's VGA port. Running at 1920x1080 it fit the screen perfectly. Now, to avoid running another cable across the room, I have connected it with a DVI to HDMI cable to my TV's HDMI port, and the desktop at 1920x1080 is cropped by the edge of the screen. I have "fixed" the cropping by using NVIDIA's "Adjust desktop size and position" tool, which created a screen resolution of 1814x1022 to fit the screen, but this is no longer the TV's native resolution and confuses some software (e.g. WoW). Why does VGA work as expected, but HDMI is scaled up? Can it be avoided?

    Read the article

  • Why does my audio keep reverting to stereo?

    - by GraemeF
    I have an ASUS P7P55D LE motherboard with onboard sound and I am running Windows 7 64-bit, and I am using the SPDIF output from my motherboard to my receiver. On my receiver I can see which audio channels are in use (i.e. stereo or 5.1) In the audio interface properties I can test DTS Audio and Dolby Digital outputs and both work fine, but when I try to play a game with 5.1 sound (I've tried Left 4 Dead and Dragon Age Origins) it reverts to stereo. I was getting this behaviour with the default Microsoft drivers so I installed the latest from the ASUS website but there is no difference. I notice that in the Advanced tab the Default Format only allows me to choose from various 2 channel formats so maybe that is something to do with it? How can I get 5.1 output all of the time?

    Read the article

  • How do I boot to the Recovery Partition on an eMachines D620 notebook?

    - by GraemeF
    I installed the Windows 7 RC on my wife's laptop and now need to reinstall Vista for her. I was very careful to leave the recovery partition intact so that I could do this, but I don't see a way to boot to it. In the Disk Management console I can see the "9.77GB Healthy (Recovery Partition)" partition but I can't do anything with it - the context menu only contains the Help option. Any ideas?

    Read the article

  • How do I unit test a finalizer?

    - by GraemeF
    I have the following class which is a decorator for an IDisposable object (I have omitted the stuff it adds) which itself implements IDisposable using a common pattern: public class DisposableDecorator : IDisposable { private readonly IDisposable _innerDisposable; public DisposableDecorator(IDisposable innerDisposable) { _innerDisposable = innerDisposable; } #region IDisposable Members public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion ~DisposableDecorator() { Dispose(false); } protected virtual void Dispose(bool disposing) { if (disposing) _innerDisposable.Dispose(); } } I can easily test that innerDisposable is disposed when Dispose() is called: [Test] public void Dispose__DisposesInnerDisposable() { var mockInnerDisposable = new Mock<IDisposable>(); new DisposableDecorator(mockInnerDisposable.Object).Dispose(); mockInnerDisposable.Verify(x => x.Dispose()); } But how do I write a test to make sure innerDisposable does not get disposed by the finalizer? I want to write something like this but it fails, presumably because the finalizer hasn't been called by the GC thread: [Test] public void Finalizer__DoesNotDisposeInnerDisposable() { var mockInnerDisposable = new Mock<IDisposable>(); new DisposableDecorator(mockInnerDisposable.Object); GC.Collect(); mockInnerDisposable.Verify(x => x.Dispose(), Times.Never()); }

    Read the article

  • How do I use constructor dependency injection to supply Models from a collection to their ViewModels

    - by GraemeF
    I'm using constructor dependency injection in my WPF application and I keep running into the following pattern, so would like to get other people's opinion on it and hear about alternative solutions. The goal is to wire up a hierarchy of ViewModels to a similar hierarchy of Models, so that the responsibility for presenting the information in each model lies with its own ViewModel implementation. (The pattern also crops up under other circumstances but MVVM should make for a good example.) Here's a simplified example. Given that I have a model that has a collection of further models: public interface IPerson { IEnumerable<IAddress> Addresses { get; } } public interface IAddress { } I would like to mirror this hierarchy in the ViewModels so that I can bind a ListBox (or whatever) to a collection in the Person ViewModel: public interface IPersonViewModel { ObservableCollection<IAddressViewModel> Addresses { get; } void Initialize(); } public interface IAddressViewModel { } The child ViewModel needs to present the information from the child Model, so it's injected via the constructor: public class AddressViewModel : IAddressViewModel { private readonly IAddress _address; public AddressViewModel(IAddress address) { _address = address; } } The question is, what is the best way to supply the child Model to the corresponding child ViewModel? The example is trivial, but in a typical real case the ViewModels have more dependencies - each of which has its own dependencies (and so on). I'm using Unity 1.2 (although I think the question is relevant across the other IoC containers), and I am using Caliburn's view strategies to automatically find and wire up the appropriate View to a ViewModel. Here is my current solution: The parent ViewModel needs to create a child ViewModel for each child Model, so it has a factory method added to its constructor which it uses during initialization: public class PersonViewModel : IPersonViewModel { private readonly Func<IAddress, IAddressViewModel> _addressViewModelFactory; private readonly IPerson _person; public PersonViewModel(IPerson person, Func<IAddress, IAddressViewModel> addressViewModelFactory) { _addressViewModelFactory = addressViewModelFactory; _person = person; Addresses = new ObservableCollection<IAddressViewModel>(); } public ObservableCollection<IAddressViewModel> Addresses { get; private set; } public void Initialize() { foreach (IAddress address in _person.Addresses) Addresses.Add(_addressViewModelFactory(address)); } } A factory method that satisfies the Func<IAddress, IAddressViewModel> interface is registered with the main UnityContainer. The factory method uses a child container to register the IAddress dependency that is required by the ViewModel and then resolves the child ViewModel: public class Factory { private readonly IUnityContainer _container; public Factory(IUnityContainer container) { _container = container; } public void RegisterStuff() { _container.RegisterInstance<Func<IAddress, IAddressViewModel>>(CreateAddressViewModel); } private IAddressViewModel CreateAddressViewModel(IAddress model) { IUnityContainer childContainer = _container.CreateChildContainer(); childContainer.RegisterInstance(model); return childContainer.Resolve<IAddressViewModel>(); } } Now, when the PersonViewModel is initialized, it loops through each Address in the Model and calls CreateAddressViewModel() (which was injected via the Func<IAddress, IAddressViewModel> argument). CreateAddressViewModel() creates a temporary child container and registers the IAddress model so that when it resolves the IAddressViewModel from the child container the AddressViewModel gets the correct instance injected via its constructor. This seems to be a good solution to me as the dependencies of the ViewModels are very clear and they are easily testable and unaware of the IoC container. On the other hand, performance is OK but not great as a lot of temporary child containers can be created. Also I end up with a lot of very similar factory methods. Is this the best way to inject the child Models into the child ViewModels with Unity? Is there a better (or faster) way to do it in other IoC containers, e.g. Autofac? How would this problem be tackled with MEF, given that it is not a traditional IoC container but is still used to compose objects?

    Read the article

  • How do I see items embedded/attached to my Gallio test log in CruiseControl.NET?

    - by GraemeF
    I can use the following code to attach a log file to my Gallio 3.2 acceptance test report: TestLog.AttachPlainText("Attached log file", File.ReadAllText(path)); When I run my tests locally I can see the log file contents by viewing the report in my web browser. However, if I run the tests under CCNET 1.4.4 I get the following error when I try to browse to an attached file in the report via the web dashboard: Exception Message The attachment was not inlined into the XML report. Exception Full Details System.InvalidOperationException: The attachment was not inlined into the XML report. at CCNet.Gallio.WebDashboard.Plugin.GallioAttachmentBuildAction.CreateResponseFromAttachment(XPathNavigator attachmentNavigator) at CCNet.Gallio.WebDashboard.Plugin.GallioAttachmentBuildAction.Execute(ICruiseRequest cruiseRequest) at ThoughtWorks.CruiseControl.WebDashboard.MVC.Cruise.ServerCheckingProxyAction.Execute(ICruiseRequest cruiseRequest) at ThoughtWorks.CruiseControl.WebDashboard.MVC.Cruise.BuildCheckingProxyAction.Execute(ICruiseRequest cruiseRequest) at ThoughtWorks.CruiseControl.WebDashboard.MVC.Cruise.ProjectCheckingProxyAction.Execute(ICruiseRequest cruiseRequest) at ThoughtWorks.CruiseControl.WebDashboard.MVC.Cruise.CruiseActionProxyAction.Execute(IRequest request) at ThoughtWorks.CruiseControl.WebDashboard.MVC.Cruise.CachingActionProxy.Execute(IRequest request) at ThoughtWorks.CruiseControl.WebDashboard.MVC.Cruise.ExceptionCatchingActionProxy.Execute(IRequest request) I get similar results when I try to embed the file instead with: TestLog.EmbedPlainText("Embedded log file", File.ReadAllText(path)); Is it possible to get this working?

    Read the article

1