How to exclude private members from StyleCop rule SA1600 - customization

Does anyone know how to change the StyleCop rule SA1600 that says elements must be documented so that it only applies to properties and not to private members?
Our ORM (DevExpress XPO) requires that you have private members for all public properties (because you have to call a function in the setter to persist it as well as storing it in the private member), and commenting both the public property and the private member with the same thing is killing me considering that some of the tables have upwards of 50 fields.

Right click on your project node in Visual Studio, select StyleCop Settings. On the Rules tab, select the Documentation Rules node. In the right-hand pane, select the Ignore privates checkbox, and\or unselect the Include fields box. Either of these will achieve the desired effect.

Related

Sitecore Change Page Layout with renderings

I've two layouts for the website, one for public (default) and other for private area, that I created.
When I create a new page (it uses the Public Layoyt by default) and if I want it to be with private layout I need to change in the Presentation > Details.
The problem comes after, I have default renderings in the Private Layout that aren't inserted on it.
So, my questions are:
Is there any possibility to ask the user when he creates a new page to ask for the layout?
Is possible for the Default Renderings in Private Layout to come together when changing the layout?
Am I doing right with having two layouts in the same instance of sitecore?
Thanks in advance!
Sounds to me like you should probably look into, creating 2 separate Page Templates.
Public Page
Private Page
These may inherit from common base templates.
Now, on each of these, configure Standard Values with the default presentation details you require - for the public and private layout respectively.
Alternatively (since I don't know exactly what you're trying to achieve) - Sitecore has something called Layout Presets. Described in section 3.6 here.
https://sdn.sitecore.net/upload/sitecore6/64/presentation_component_cookbook-a4.pdf
(very old document, but I do believe this still applies to current Sitecore releases)
One more alternative would be to create 2 branch templates
Public Page
Private Page
Works similar to how you would do it from 2 separate page templates, but removes the need for having templates that are there purely for presentation.
Then set your default presentation for each type of page on the branch template item. You can also set things like security options etc... just like you might with the standard values of a page template.
As an advantage over page templates, you can also create a child structure if needed - so if you had a /assets folder that you needed for each page type, a branch template is great for that.

Sitecore ECM: Subscription module

I need to insert a Subscription form into a CMS Web page.
I though to re-use the default source code already developed and coming with the ECM package after the installation.
In the Layout/EmailCampaign folder there is an user control: Subscription Form.ascx
In the OnInit method, they are calling another method to retrieve some parameters.
Parameters like Require Authentication, Show List, Target Audience List.
Is there somebody who knows where do I have to define those parameters ? They are all the time empty or null.
Thank you,
Hmm or maybe it's done on the Target Audience you associate to the control. You may be able to add the required parameters when added the control to a layout/sub-layout or when adding through presentation settings.
I believe these are configured when you add the control as a component. You can change the settings when you edit the related item for the component when added to the page.
The parameters you mention, usually comes from the data-template:
/sitecore/templates/Email Campaign/Subscription Sublayout Parameters
And you set them where you assign Layout Details to the presentation item:
This applies to my Sitecore 6.5 installation, in the administration content editor:
Choose your item, click Presentation, in the Layout section, choose Details, choose Edit, choose the tab Controls, locate the sublayout that represents your subscribtion form and choose Edit.
In the following popup you will be able to set the values of the parameters that you mention.
If you don't see the three parameters Target audience list, Require authentication and Show list here, you might have forgotten to assign the datatemplate :
/sitecore/templates/Email Campaign/Subscription Sublayout Parameters
...to your parameter template on your Sublayout item.
I suspect the last section to be your real problem, due to the fact that you get null values

EMF: Restricting choices to predefined values

I am using EMF to allow users to create instances of a particular type of model.
An instance of a model can have 0-* Things but I'd like to be able to predefine the available Things that the user can add to the instance so that they can't just create their own.
How would I go about creating the Things using the ecore model?
If a Thing was just a String then it would be fine - I could use Enums. But a Thing is a type of it's own and consists of other stuff (like a name, version etc.) and I don't know how to give a predefined set of these to the user to choose.
Any ideas?
You have the possibility to use constraints or *EOperation*s.
For a better usability you should use a own dialog implementation. An example of a own implementation with given choices you can find here:
How can I control which instances are available as choices when editing a property in the properties view?
You should also implement a own property source to support the properties editor:
Recipe: Create your own property editor in a generated application

Make Public Report Default

Using Apex version 4.1.1.00.23.
When saving a report and choosing Actions, Save Report, the resulting window has a "Public" check box to make the report Public. Is it possible to have the Public check box already checked ( resulting in Public being the default option)?
I read that it is not possible to have the option to only have Public reports without also having Private reports. Is this true?
Thanks!
It is not possible to have public reports without the private ones simply because of the way saving is set up. If you were to influence that, then yes, it would be possible.
You can not easily influence the 'Public' checkbox. The reason for this is that the html-region which pops up when you select an option from the actions list (such as 'save' in this case) is retrieved through an ajax call. This way it is not even possible to use some javascript/jquery to influence this as the item is not there as long as the option has not been selected.
If you really want to influence it anyway, there is one option only: study the ajax calls and reproduce them. For example, i've been doing this for filters. You will need to look through the ir javascript file, found in /i/javascript/apex_interactive_reports_4_1.js
Firstly, you need need a hook for the successful callback for the IR ajax. There are however no framework events. What i did is 'override' gReport._Finished_Loading: checking the executed action, trigger the original code, then hook in my own functions.
Once there, you could influence what happens: hide the checkbox, always check it, add items or change some. For example, with always checking the checkbox and hiding it you'd always generate public reports.
You could also study the save report ajax call, and mimic this behaviour, using your own small interface for providing parameters.

Is there a method/function list feature in Resharper?

With R# is there a way to view/nav the set of methods in the current class?
I know you can use VS' native top-right drop-down but I'd like a shortcut.
This seems like an obvious feature for R# as it's something I miss most in VS compared to other programmer's editors.
Thanks,
Matt
(ps. sorry if this post appears twice but first attempt didn't seem to post successfully)
Two ways I use to navigate methods using R# are:
ReSharper->Go To->File member... (Alt + \, for me)
ReSharper->Windows->File Structure Window
The former invokes a popup with autocomplete where you can type the name of the method, or you can scroll through the list. The latter option is a window that provides an overview of the members in your class in the order they come in the file.
I posted similar thread few months ago:
Resharper: how to see only particular group of members
Vote for particular members browsing feature if you'd like:
http://www.jetbrains.net/devnet/docs/DOC-279
Resharper 2017.2 introduces navigation filters this allows you to filter methods "globally".
Resharper -> Navigate -> Search everywhere/Go to Type (Ctrl + T)
Type in /mm in the search box (this is the method filter mask).