Exemplo n.º 1
0
 protected void CopyTo(ProfileParameter target)
 {
     target.Id          = Id;
     target.Name        = Name;
     target.Description = Description;
     target.Flag        = Flag;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Erzeugt eine neue Verwaltung.
 /// </summary>
 /// <param name="type">Die konkrete Art der Erweiterung.</param>
 /// <param name="selector">Die Liste mit allen Erweiterungen.</param>
 /// <param name="details">Die Schaltfläche für die Pflege der Parameter.</param>
 public ProviderUI(PipelineTypes type, ComboBox selector, Button details)
 {
     // Remember
     m_TypePrefix = ProfileParameter.GetPrefixForExtensionParameter(type);
     Selector     = selector;
     Details      = details;
 }
Exemplo n.º 3
0
        public async Task GalleryAsync(Profile profile)
        {
            var parameter = new ProfileParameter
            {
                Current = profile,
                Images  = Images.ToList()
            };

            await _navigationService.NavigateToAsync <GalleryViewModel>(parameter);
        }
		public static NetshResult SetFirewallLoggingFilename(ProfileParameter profile, FilenameParameter parameter)
		{
			if (parameter.ParameterValue.FilefolderNeedsPermission())
			{
				var directory = new DirectoryInfo(Path.GetDirectoryName(parameter.ParameterValue.Value));
				var acl = directory.GetAccessControl();

				acl.AddAccessRule(new FileSystemAccessRule(@"NT SERVICE\mpssvc", FileSystemRights.Write, AccessControlType.Allow));
				directory.SetAccessControl(acl);
			}

			return SetFirewallLogging(profile, parameter.Name, parameter.ParameterValue.Value);
		}
        public override string ToString()
        {
            var result = ProfileParameter.ToString();

            foreach (var p in _parameters)
            {
                var item = p.ToString();
                // Ensure there is a ';' inbetween params
                if (!string.IsNullOrEmpty(item))
                {
                    result = result + ";" + item;
                }
            }
            return(result);
        }
Exemplo n.º 6
0
        public override string ToString()
        {
            var result = "";

            if (ProfileParameter.Show == true)
            {
                result = ProfileParameter.ToString();
            }
            if (_parameters.Any(p => p != null && !string.IsNullOrEmpty(p.ToString())))
            {
                result += (string.IsNullOrEmpty(result) ? "" : ";") + string.Join(";", _parameters.Where(p => p != null && !string.IsNullOrEmpty(p.ToString())));
            }
            if (string.IsNullOrEmpty(result))
            {
                result = "*";
            }
            return(result);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Liest oder setzt einen Parameter im aktuellen Geräteprofil.
        /// </summary>
        /// <param name="parameterName">Der Name des Parameters.</param>
        /// <exception cref="ArgumentNullException">Es wurde kein Name angegeben.</exception>
        private string this[string parameterName]
        {
            get
            {
                // Validate
                if (string.IsNullOrEmpty(parameterName))
                {
                    throw new ArgumentNullException("parameterName");
                }

                // Find the parameter
                ProfileParameter parameter = Profile.Parameters.Find(p => parameterName.Equals(p.Name));

                // Report
                if (null == parameter)
                {
                    return(null);
                }
                else
                {
                    return(parameter.Value);
                }
            }
            set
            {
                // Validate
                if (string.IsNullOrEmpty(parameterName))
                {
                    throw new ArgumentNullException("parameterName");
                }

                // Remove the parameter
                Profile.Parameters.RemoveAll(p => parameterName.Equals(p.Name));

                // Add a new one
                if (null != value)
                {
                    Profile.Parameters.Add(new ProfileParameter {
                        Name = parameterName, Value = value
                    });
                }
            }
        }
		public static NetshResult SetFirewallSettingUnicastResponseToMulticast(ProfileParameter profile, UnicastResponseToMulticastParameter parameter)
		{
			return SetFirewallSetting(profile, parameter.Name, parameter.ParameterValue.Value);
		}
		public static NetshResult SetFirewallLoggingMaxFilesize(ProfileParameter profile, MaxFilesizeParameter parameter)
		{
			return SetFirewallLogging(profile, parameter.Name, parameter.ParameterValue.Value);
		}
		public static NetshResult SetFirewallLoggingDroppedConnections(ProfileParameter profile, DroppedConnectionsParameter parameter)
		{
			return SetFirewallLogging(profile, parameter.Name, parameter.ParameterValue.Value);
		}
		public static NetshResult SetFirewallPolicy(ProfileParameter profile, InboundPolicyParameter parameterInbound, OutboundPolicyParameter parameterOutbound)
		{
			return SetFirewallProperty(profile, "firewallpolicy", parameterInbound.Value + "," + parameterOutbound.Value);
		}
Exemplo n.º 12
0
        public void MathValueTest()
        {
            ProfileParameter rpm = new ProfileParameter();

            rpm.Name                  = "Engine Speed";
            rpm.Conversion            = new Conversion();
            rpm.Conversion.Name       = "RPM";
            rpm.Conversion.Expression = "x";

            ProfileParameter maf = new ProfileParameter();

            maf.Name                  = "Mass Air Flow";
            maf.Conversion            = new Conversion();
            maf.Conversion.Name       = "g/s";
            maf.Conversion.Expression = "x";

            MathValue load = new MathValue();

            load.XParameter  = rpm.Name;
            load.XConversion = rpm.Conversion.Name;
            load.YParameter  = maf.Name;
            load.YConversion = maf.Conversion.Name;
            load.Format      = "0.00";
            load.Formula     = "(y*60)/x";

            LogProfile profile = new LogProfile();

            profile.ParameterGroups.Add(new ParameterGroup());
            profile.ParameterGroups[0].Parameters.Add(rpm);
            profile.ParameterGroups[0].Parameters.Add(maf);

            //MockDevice mockDevice = new MockDevice();
            //MockLogger mockLogger = new MockLogger();
            //Vehicle vehicle = new Vehicle(
            //    new MockDevice(),
            //    new Protocol(),
            //    mockLogger,
            //    new ToolPresentNotifier(mockDevice, mockLogger));
            //Logger logger = new Logger(vehicle, profile, mathValueConfiguration);

            //MathValueConfigurationLoader loader = new MathValueConfigurationLoader();
            //loader.Initialize();
            MathValueConfiguration mathValueConfiguration = new MathValueConfiguration();

            mathValueConfiguration.MathValues = new List <MathValue>();
            mathValueConfiguration.MathValues.Add(load);

            DpidValues dpidValues = new DpidValues();

            dpidValues.Add(rpm, new ParameterValue()
            {
                RawValue = 1000
            });
            dpidValues.Add(maf, new ParameterValue()
            {
                RawValue = 100
            });

            MathValueProcessor   processor  = new MathValueProcessor(profile, mathValueConfiguration);
            IEnumerable <string> mathValues = processor.GetMathValues(dpidValues);

            Assert.AreEqual(1, mathValues.Count(), "Number of math values.");
            string loadValue = mathValues.First();

            Assert.AreEqual("6.00", loadValue, "Load value.");
        }
		private static NetshResult SetFirewallProperty(ProfileParameter profile, string property, string parameter)
		{
			return RunCommand("set " + profile.Value + " " + property, parameter);
		}
		public static NetshResult SetFirewallSettingInboundNotification(ProfileParameter profile, InboundUserNotificationParameter parameter)
		{
			return SetFirewallSetting(profile, parameter.Name, parameter.ParameterValue.Value);
		}
		protected static NetshResult SetFirewallLogging(ProfileParameter profile, string parametername, string parametervalue)
		{
			return SetFirewallProperty(profile, "logging", parametername + " " + parametervalue);
		}
		public static NetshResult SetFirewallState(ProfileParameter profile, StateParameter parameter)
		{
			return SetFirewallProperty(profile, "state", parameter.Value);
		}
		private static NetshResult SetFirewallSetting(ProfileParameter profile, string setting, string parameter)
		{
			return SetFirewallProperty(profile, "settings", setting + " " + parameter);
		}
		public static NetshResult SetFirewallSettingRemoteManagement(ProfileParameter profile, RemoteManagementParameter parameter)
		{
			return SetFirewallSetting(profile, parameter.Name, parameter.ParameterValue.Value);
		}
		public static NetshResult SetFirewallSettingLocalRules(ProfileParameter profile, LocalFirewallRulesParameter parameter)
		{
			return SetFirewallSetting(profile, parameter.Name, parameter.ParameterValue.Value);
		}