コード例 #1
0
		private static string GetResponse(string args)
		{
			var profile = args.DeserializeProfile();
			var settings = (ConnectionSettings) profile.Settings;
			var errors = new PluginProfileErrorCollection();

			settings.ValidateConnection(errors);
			if (errors.Any())
			{
				return errors.Serialize();
			}

			CheckConnection(settings, errors);
			return errors.Any() ? errors.Serialize() : string.Empty;
		}
コード例 #2
0
        private static string GetResponse(string args)
        {
            var profile  = args.DeserializeProfile();
            var settings = (ConnectionSettings)profile.Settings;
            var errors   = new PluginProfileErrorCollection();

            settings.ValidateConnection(errors);
            if (errors.Any())
            {
                return(errors.Serialize());
            }

            CheckConnection(settings, errors);
            return(errors.Any() ? errors.Serialize() : string.Empty);
        }
コード例 #3
0
		public PluginCommandResponseMessage Execute(string args, UserDTO user)
		{
			var errors = new PluginProfileErrorCollection();
			var profile = args.DeserializeProfile();
			var settings = (BugzillaProfile) profile.Settings;

			var properties = GetBugzillaProperties(settings, errors);

			return errors.Any()
			       	? new PluginCommandResponseMessage
			       	  	{PluginCommandStatus = PluginCommandStatus.Fail, ResponseData = errors.Serialize()}
			       	: new PluginCommandResponseMessage
			       	  	{PluginCommandStatus = PluginCommandStatus.Succeed, ResponseData = properties.Serialize()};
		}
コード例 #4
0
        public PluginCommandResponseMessage Execute(string args)
        {
            var mashup = args.Deserialize <T>();

            NormalizeMashup(mashup);
            PluginProfileErrorCollection errors = ExecuteOperation(mashup);

            return(new PluginCommandResponseMessage
            {
                PluginCommandStatus = errors.Any()
                                                                      ? PluginCommandStatus.Fail
                                                                      : PluginCommandStatus.Succeed,
                ResponseData = errors.Serialize()
            });
        }
コード例 #5
0
        public PluginCommandResponseMessage Execute(string args)
        {
            var errors   = new PluginProfileErrorCollection();
            var profile  = args.DeserializeProfile();
            var settings = (BugzillaProfile)profile.Settings;

            var properties = GetBugzillaProperties(settings, errors);

            return(errors.Any()
                                ? new PluginCommandResponseMessage
            {
                PluginCommandStatus = PluginCommandStatus.Fail, ResponseData = errors.Serialize()
            }
                                : new PluginCommandResponseMessage
            {
                PluginCommandStatus = PluginCommandStatus.Succeed, ResponseData = properties.Serialize()
            });
        }
コード例 #6
0
        private string OnExecute(string args)
        {
            var profile = args.DeserializeProfile();
            var errors  = new PluginProfileErrorCollection();

            try
            {
                OnCheckConnection(errors, (TVcsPluginProfile)profile.Settings);
            }
            catch (StructureMapException e)
            {
                ObjectFactory.GetInstance <ICheckConnectionErrorResolver>().HandleConnectionError(e.InnerException, errors);
            }
            catch (Exception e)
            {
                ObjectFactory.GetInstance <ICheckConnectionErrorResolver>().HandleConnectionError(e, errors);
            }

            OnExecuted((TVcsPluginProfile)profile.Settings);
            return(errors.Serialize());
        }