Tag Archives: style

Resharper Style-Cop free plugin

Why Should We Use StyleCop?

StyleCop contributes to this maintainability by encouraging consistency of style, which in turn makes it easier for developers to pick up existing code and work with it productively, and by encouraging plenty of documentation for future developers to read thereby improving the long-term maintainability of the source.

Historically, different development groups have used drastically different coding styles. Many teams have used inconsistent coding styles within a single product or even a single source file. StyleCop was originally written to provide a simple and efficient way to enforce a common coding style for C# code throughout Microsoft.

Over time, StyleCop evolved to include new rules that go beyond style checks. StyleCop has become a good complement to FxCop (Code Analysis). FxCop analyzes compiled .NET binaries, while StyleCop analyzes the original source code. This allows StyleCop to investigate issues in code that are thrown away by the compiler. StyleCop could also be used to investigate issues in non-compiled languages such as JavaScript or XML.

StyleCop provides an extensibility mechanism allowing parsers and analyzers for any language to be plugged into the system. Individual developers or teams can write and deploy their own rules, or integrate support for new languages. The StyleCop SDK provides support for writing StyleCop add-ins.

via StyleCop.

WPF: Simple gray-out image effect if disabled.

After searching for a simple gray-scale effect (like win-forms) I’ve come to the conclusion that it’s not so simple.

Instead, changing the opacity seems very simple, so – why not?!

The idea is to ‘disable’ the image if it’s parent becomes disabled.

The XAML

    <Window.Resources>
        <Style TargetType="{x:Type Image}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UIElement}, AncestorLevel=1}, Path=IsEnabled}"
                             Value="False">
                    <Setter Property="Opacity"
                            Value="0.5" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>

A Developer’s Introduction to Windows Workflow Foundation (WF4) in .NET 4

A very good tutorial/article about WF4 (not so many out there these days).

 

A Developer’s Introduction to Windows Workflow Foundation (WF) in .NET 4.

 

TOC

Overview

 

What’s New in WF4

Designers

Data Flow

Flowchart

Programming Model

Windows Communication Foundation (WCF) Integration

 

Getting Started with Workflow

Workflow Structure

Workflow Templates and the Workflow Designer

Data flow in workflows

Variables – storing data

Arguments – passing data

Expressions – acting on data

Building your first workflow

Tour of the workflow activity palette

Activity Primitives and Collection Activities

Control flow activities

Migration

Flowchart

Messaging Activities

Transactions and Error Handling

Creating and executing workflows

Options for designing workflows

Options for executing workflows

Workflow Extensions

Persistence

Tracking

Creating custom activities

Activity class hierarchy

Composing activities using Activity designer

Writing custom Activity classes

Additional activity concepts

Activity designers

Rehosting the workflow designer

Workflow Services

Conclusion

About the Author

Additional Resources

 

Magento default “Don’t have a PayPal account?” LANDINGPAGE

Problem description:
I’m using PayPal Website Payments Standard. Whenever the user lands on PayPal with the variables I sent, it shows a PayPal Login form and at the bottom it shows “Don’t have a PayPal account? Use your credit card or bank account (where available).”
I want it to default to always ask for credit card and maybe say “Have PayPal? Use that!”. Any ideas?” (*2)
The solution (*1):
Edit:
/app/code/core/Mage/Paypal/Model/Api/Nvp.php
Find the function
public function callSetExpressCheckout().
Before the end there is a line:
$response = $this->call(self::SET_EXPRESS_CHECKOUT, $request);
Add the following line before that line:
$request[“LANDINGPAGE”] = ‘Billing’;
This should do it, hope it helps.
Resources

(*1) Magento – Paypal Standard Landing Pages Question – How do I? Questions – eCommerce Software for Growth