VS not finding implementation - visual-studio-2012

I have several questions regarding Visual Studio:
two developers using VS2012 and VS2013 are working on the same project but the one with the lower version studio cannot use ctrl+F12 to find the implementation of a function.
Those implementations are separated from the interfaces in another library-project.
Second question is strictly concerning VS2013:
two different solutions both are MVC, the first one is version 5.2.2.0 and the other is - 4.0.0.0
in the second project I am able to find a view by using F12 on in the controller (e.g. return View(model); or return View("CustomFormat", model);)
However I am not able to do it in my first project.
Any information on why it is the way it is or how to fix it, would be appreciated.
TLDR;
Q1: Why doesn't ctrl+F12 work in VS2012 when decoupled implementation from declaration (but it does work in VS2013)
Q2: Why doesn't F12 when pressed on 'View' return View(model); find the View itself regarding using 2 different MVC version projects (one is 5 and the other is 4)

Related

Sharepoint 2010 - programmatically making changes to advanced search box

I've got some code that loops through webparts on a page looking for an Advanced Search box in order to change some properties. Very simple stuff, essentially:
if (webpart is AdvancedSearchBox) {
do stuff;
}
I have seen this class referenced on blogs in code pertaining to SharePoint 2010 (http://weblogs.asp.net/spano/archive/2012/07/20/customizing-a-sharepoint-2010-search-center.aspx for example), but I can't for the life of me find the class itself. The only official reference I can find refers to 2007 - http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.webcontrols.advancedsearchbox(v=office.12).aspx, and no matter what assemblies I include, Intellisense just does not recognise it.
I hope I'm missing something obvious - does anyone know where this class is, or whether it's deprecated? The web part itself is already in use in our solution, so it definitely exists somewhere.
Many thanks in advance!
Solved it. What was needed in order to use the class was all of the following:
Microsoft.office.server.search.dll added as reference
Both of the following using directives:
using Microsoft.Office.Server.Search
using Microsoft.Office.Server.Search.WebControls
And a Visual Studio restart
I think it was the last point that stumped me - until the restart, VS wasn't recognising the class name at all.
With thanks to Pradip T on Technet. http://social.technet.microsoft.com/Forums/sharepoint/en-US/295b0962-0cdf-41e4-96c9-d07876982c4d/sharepoint-2010-advancedsearchbox-class-or-similar

Simple mvvmcross monotouch with xib support (and monomac)

I tried the simpledroid with INotifyPropertyChanged and ICommand successfully.
I want to do the same with monotouch and xib designer,but without TouchDialog. Is there a way to implement without inheriting from mvx class as in monodroid?
Is it possible to do the same with MonoMac without Dialog as Portable Library in MonoMac or XaMac in supported now?
I understand what is your goal.
I think you want to start learning MvvmCross for Monotouch with a basic application example as you probably did with SimpleDroid. I tried to do the same without success.
Why ? Because SimpleDialogTouch is an "Advanced" example in my opinion. When you learn Monotouch, you use xib to design your view. But the sample tells you to learn a new tool "Monotouch Dialog" which is a way to display controls programmatically.
You get those errors because the sample implements the ViewModel only for Dialog and not for xib or classic binding.
Finally, you will have to dig into MvvmCross to build your own SimpleTouch implementation. The problem is that you don't have a lot of documentation, but Stuart is the best supporter for a beginner or you can switch to advanced Mvx features if you don't need to understand the underground of MvvmCross. There are a lot of samples, tutorials and posts to tweak Mvx.
Hope that helps.
Is there a way to implement without inheriting from mvx class as in monodroid?
I don't believe this is supported in the current source.
There is an effort underway to separate out the databinding code in MvvmCross so it can be used more easily with other frameworks - e.g. we might try porting MvvmLight across too. This is where my effort is currently focused.
If you need this now, then I think you could fairly easily create this simple binding yourself if you wanted to - but you'd have to take a look at what the SimpleDialog version does - it's not too big a code to copy across to the XIB version - https://github.com/slodge/MvvmCross/blob/vnext/Cirrious/Cirrious.MvvmCross.Dialog.Touch/Simple/MvxSimpleTouchDialogViewController.cs
But... why not just implement a proper portable MvxViewModel instead?
Is it possible to do the same with MonoMac without Dialog as Portable Library in MonoMac or XaMac in supported now?
Portable libraries are not supported in any release from Xamarin yet - there is an unofficial installer that Jeff very kindly provided - but it's not a release...
For MvvmCross MonoMac/XaMac support, there is one non-PCL version from #deapsquatter around, but I don't believe this has data-binding yet.
I will be working on a PCL and data-binding release for MonoMac or XaMac - but it's on a spare time basis - no-one's come forward with a customer project to fund that work yet. If you or anyone wants to assist with this port, then you are very welcome... but it will be quite technical work - there are changes I intend to make 'under the covers' - so the easiest place for others to help will probably be in later work - adding more views, more bindings, doing QA, making samples, etc.
Note: "Simple" bindings are not the future for MvvmCross and may get dropped from a future release. However, this will only happen after I've separated out the Binding code so that it can be used with other libraries - the first of which will probably be a simple binding example.
I personally don't see much difference or advantage in using these so-called Simple bindings... but maybe I'm missing something...

C# Accessing classes in a WinForms project from a classes in a Class Library

I have two c# projects within a solution.
The first project is a winforms project with several classes and is called QuantumGUI. The second project is a class library project with several classes and is called QuantumDAL.
My objective is from a class in QuantumDAL to access and set variables in a QuantumGUI class or and in Form.cs.
I have tried adding a reference to QuantumGUI in my QuantumDAL project but received the following error: “A Reference to ‘QuantumGUI’ could not be added. Adding the project as a reference would cause a circular dependency”.
I received a similar error message trying to add Project Dependencies. When you think about it, the error message makes sense.
I’ve tried other, what I consider possible ways of doing this but came up empty. I believe there must be a clever way of getting this done.
If I’m going about this in a wrong way, is there a way to have a “global” class that can be accessed by code in both projects?
Thank you for taking the time to look at this.
There are two problems with what you're trying to do:
First, as the IDE is warning you, you're about to create a circular dependency. This means that the compiler would need to build project A before it can build project B, but it would need to build project B before it can build project A. Neither project can go "first".
The second problem is that your WinForms project is most likely an executable, and you cannot add references to *.exe files via the IDE. You can add those references via the command-line, but the fact that Visual Studio is trying to stop you from doing it should be a red flag that it's a really bad idea.
The correct way to do what you want is to refactor the common classes into a third class library that you reference from both other projects. If needed, you can wire up events (in particular, look at the INotifyPropertyChanged interface and its event) that notify interested observer objects when things change.

Override/Implement Members in MonoDevelop

I am working through the pluralsight videos on MonoTouch. At one point, the trainer right clicks on the name of a derived class, and in the 'refactor' menu there is a function to override/implement members of that class. When I click however (latest version), I see only 'rename.'
The person in this link had the same issue some time ago and has included screenshots - but noone replied to them in the MonoTouch discussion group:
http://monotouch.2284126.n4.nabble.com/Right-Click-Class-name-gt-Refactor-gt-Override-Implement-members-tt4655504.html#none
Has anyone experienced (and resolved!) this?
Some of the refactoring features were reorganized or removed (for now) in the rewrite of the code code completion engine that took place for MD 3.0.
You can still access this particular feature two ways:
1) After typing the "override" keyword, MD offers the members you can override/implement. Selecting one will cause it to be stubbed out.
2) You can override many members at once using the "Edit->Show Code Generation Window" command in the class body. This command doesn't have a keybinding on Mac by default, but you can assign one in Preferences.
MonoDevelop 3.0 (and later) removed some features (including a few about refactoring) since they were not as stable, fully functional (complete) or buggy.
The same features (or similar ones) are likely to come back in future releases.

What can I do to make my sub-derived custom control appear in the Blend Assets library?

I am creating a series of window mockup templates based on the excellent Mockups library available on CodePlex.
I'm using their BaseMockup as the base for my control as well, and I followed the same outline of the steps listed here for sub-deriving from existing controls (Create a new empty class, add your default style to /Themes/generic.xaml, etc.)
The control is working great - the only thing is that it doesn't show up in the Assets library. I think this is because it's sub-derived, or because I need some attribute (the equivalent of the ToolboxItemAttribute for WinForms controls? ... which didn't work) to get it hooked up.
When I modify the code to derive directly from Control, it shows up - no custom attribute necessary. Of course that defeats the purpose of what I'm trying to do though...
The only thing I can find are several articles telling me to muck with registry keys, and none of them are clear or suggest a definitive way to do this with Blend 4. That last one advertises as a Blend 4 tips article, but admits at the end that it plagiarizes the content from the other two (for Blend 3).
Is that my only option - register my DLL? Is there a better way to do this?
A while ago I wrote a blogpost about this. I've included a .reg file and a .bat file for setting up the register and some directories. I think that's what you are looking for.
I believe you do need to muck with registry keys. Specifically,
32 bit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NET Framework\v4.0.30319\AssemblyFoldersEx
64 bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NET Framework\v4.0.30319\AssemblyFoldersEx
Create a new key with the name of your control assembly. Then edit the Default string value under this key and set the value to the directory where the control assemblies are installed. See here for a full example (using the Silverlight paths).
Found it - there is an analogue attribute after all, it's ToolboxBrowsableAttribute.
You have to go through a little more rigmarole to get it set up, but it works great - no registry mucking necessary. It requires creating a designer metadata provider class, attributing your assembly so it's designer-discoverable, and then adding the attributes to your sub-derived controls inside your metadata provider.
Make sure you choose the appropriate version of the page for your version of Visual Studio, because the interface changes a good bit between 2008 and 2010.
This article on CodeProject has some good, real-world examples of setting this up. They're all in the 2008 style though, so bear that in mind if you're using 2010.

Resources