public AddRegistrationPropertyCommand(CommandAttribute commandAttribute, ElementCollectionViewModel collection, IApplicationModel applicationModel, DefaultCollectionElementAddCommand defaultAddPropertyCommand, IUIServiceWpf uiService)
            : base(commandAttribute, collection, defaultAddPropertyCommand, uiService)
        {
            this.collection = collection as InjectionMemberCollectionViewModel;

            this.applicationModel = applicationModel;
        }
 /// <summary>
 /// Initializes an instance of CommandModel from <see cref="CommandAttribute"/>.
 /// </summary>
 /// <param name="commandAttribute"></param>
 /// <param name="uiService"></param>
 protected CommandModel(CommandAttribute commandAttribute, IUIServiceWpf uiService)
     : this(uiService)
 {
     Title = commandAttribute.Title;
     HelpText = string.Empty;
     Placement = commandAttribute.CommandPlacement;
     ChildCommands = Enumerable.Empty<CommandModel>();
     KeyGesture = commandAttribute.KeyGesture;
 }
 public ExportAdmTemplateCommand(CommandAttribute commandAttribute,
                                 ApplicationViewModel applicationViewModel,
                                 IUIServiceWpf uiService,
                                 ElementViewModel element,
                                 AssemblyLocator assemblyLocator)
     : base(commandAttribute, uiService)
 {
     this.applicationViewModel = applicationViewModel;
     this.element = element;
     this.attributeRetriever = new ConfigurationManageabilityProviderAttributeRetriever(assemblyLocator);
 }
        protected TemplatedInjectionMemberCommandContainerBase(CommandAttribute commandAttribute, ElementCollectionViewModel collection, DefaultCollectionElementAddCommand defaultAddCommand, IUIServiceWpf uiService)
            : base(commandAttribute, uiService)
        {
            this.collection = collection as InjectionMemberCollectionViewModel;
            this.registerElement = collection.ParentElement as RegisterElementViewModel;

            this.defaultAddCommand = defaultAddCommand;

            this.registerElementRegistrationTypeChangedHandler = new EventHandler<EventArgs>(registerElement_RegistrationTypeChanged);
            this.registerElement.RegistrationTypeChanged += registerElementRegistrationTypeChangedHandler;
        }
        public SelectValidatedTypeReferenceMembersCommand(TypeMemberChooser typeMemberChooser, ElementViewModel context, CommandAttribute attribute, IUIServiceWpf uiService)
            : base(attribute, uiService)
        {
            if (context.ConfigurationType != typeof(ValidationRulesetData)) throw new InvalidOperationException();

            this.validatedTypeReferenceElement = context.AncestorElements().Where(x => x.ConfigurationType == typeof(ValidatedTypeReference)).First();
            this.fieldCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedFieldReferenceCollection)).First();
            this.propertyCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedPropertyReferenceCollection)).First();
            this.methodsCollectionElement = (ElementCollectionViewModel)context.ChildElements.Where(x => x.ConfigurationType == typeof(ValidatedMethodReferenceCollection)).First();

            this.typeMemberChooser = typeMemberChooser;
        }
        public ConfigurationSourceElementDeleteCommand(CommandAttribute commandAttribute, ElementViewModel elementViewModel, IUIServiceWpf uiService)
            : base(commandAttribute, uiService)
        {
            Guard.ArgumentNotNull(elementViewModel, "elementViewModel");

            this.elementViewModel = elementViewModel;
            if (!typeof(ConfigurationSourceElement).IsAssignableFrom(elementViewModel.ConfigurationType))
            {
                throw new ArgumentException(
                    Resources.CommandConfigurationSourceElementDeleteOnWrongType);
            }
        }
        protected override void Arrange()
        {
            base.Arrange();

            uiServiceMock = new Mock<IUIServiceWpf>();

            attrib = new CommandAttribute(typeof(TestableCommandModel))
                             {
                                 CommandPlacement = CommandPlacement.FileMenu,
                                 Title = "TestTitle",
                                 KeyGesture = "Ctrl+A"
                             };
        }
 public ExportKeyCommand(CommandAttribute commandAttribute, ElementViewModel subject, IUIServiceWpf uiService)
     :base(commandAttribute, uiService)
 {
     this.uiService = uiService;
     this.keyProperty = subject.Properties.OfType<ICryptographicKeyProperty>().FirstOrDefault();
 }
 ///<summary>
 /// Initializes a new instance of <see cref="HiddenCommand"/>.
 ///</summary>
 ///<param name="attribute">The command attribute providing context for this command.</param>
 ///<param name="uiService">The user-interface service used to display messages and windows to the user.</param>
 public HiddenCommand(CommandAttribute attribute, IUIServiceWpf uiService) :
     base(attribute, uiService)
 {
     this.Browsable = false;
 }
            public TestableCommandModel(CommandAttribute attribute, IUIServiceWpf uiService)
                : base(attribute, uiService)
            {

            }