/// class PD.Manage.Modules.SyncCreateDialogCommand

PD.Manage.Modules.SyncCreateDialogCommand =
PD.Commands.Command.extend({

    //===================================
    // PUBLIC METHODS
    //===================================

    setDefaults: function () {
        this.props("id", "sync/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("plus.png"));
        this.props("label", "New");
        this.props("tooltip", "Create a new Active Directory synchronization.");
    },

    execute: function (e) {
        this._super(e);
        this._openDialog();
    },

    //===================================
    // PRIVATE METHODS
    //===================================

    _openDialog: function () {

        ProspectDirector.Web.UI.FeatureSets.NHibTargetEditorDialog.open({
            config: {
                title: "New Active Directory Sync",
                height: 500,
                width: 500
            },
            data: {
                targetArbiter: "ProspectDirector.Web.Manage.Modules.Security.SyncSettingsArbiter",
                targetType: "ProspectDirector.Web.Manage.Modules.Security.SyncSettingsUIO",
                layoutType: ProspectDirector.Web.UI.FeatureSets.Layouts.TabStripLayout
            },
            callbacks: {
                ok: function (sender, e) {
                    PD.context.get_default().get_events().publish("sync/create", {
                        id: e.target.id
                    });
                }
            }
        });

    }

});