Describes the registration of a device profile on a machine.
Inheritance: Registration
 /// <summary>
 /// Get a device registration by identifier
 /// </summary>
 /// <param name="ID">Registration to get</param>
 /// <param name="Registration">The registration if found, null otherwise.</param>
 /// <returns>True if found, false otherwise.</returns>
 public bool GetID(string ID, out RegistrationDevice Registration) {
     Registration = null;
     return false;
     }
 /// <summary>
 /// Get a device registration by fingerprint
 /// </summary>
 /// <param name="UDF">Registration to get</param>
 /// <param name="Registration">The registration if found, null otherwise.</param>
 /// <returns>True if found, false otherwise.</returns>
 public bool GetUDF (string UDF, out RegistrationDevice Registration) {
     Registration = null;
     return false;
     }
        /// <summary>
        /// Fetch the latest version of the profile version
        /// </summary>
        void Fill() {

            PersonalProfiles = new Dictionary<string, RegistrationPersonal>();
            ApplicationProfiles = new Dictionary<string, RegistrationApplication>();
            ApplicationProfilesDefault = new Dictionary<string, string>();
            DeviceProfiles = new Dictionary<string, RegistrationDevice>();

            var ProfileKeys = Register.GetSubKeys(Constants.RegistryPersonal);
            var DeviceKeys = Register.GetKeys(Constants.RegistryDevice);
            var ApplicationKeys = Register.GetKeys(Constants.RegistryApplication);
            string DefaultDevice = null;


            foreach (var KeySet in ProfileKeys) {
                var Filename = KeySet.GetValueString("");

                if (Filename != "") {
                    var Profile = new RegistrationPersonal(KeySet.Key, Filename);
                    if (Profile != null) {
                        PersonalProfiles.Add(KeySet.Key, Profile);

                        // add Archive
                        var Archive = KeySet.GetValueString("Archive");
                        Profile.Archive = Archive;

                        // add Portals
                        var Portals = KeySet.GetValueMultiString("Portals");
                        Profile.Portals = Portals?.ToList();

                        if (KeySet.Default) {
                            _Personal = Profile;
                            }
                        }
                    }
                }

            foreach (var Key in ApplicationKeys) {
                if (Key.Key.Length > 10) {
                    var Profile = new RegistrationApplication(Key.Key, Key.Value);
                    if (Profile != null) {
                        ApplicationProfiles.Add(Key.Key, Profile);
                        }
                    }
                else {
                    ApplicationProfilesDefault.Add(Key.Key, Key.Value);
                    }
                }


            foreach (var Key in DeviceKeys) {
                if (Key.Key != "") {
                    var Profile = new RegistrationDevice(Key.Key, Key.Value);
                    if (Profile != null) {
                        DeviceProfiles.Add(Key.Key, Profile);
                        }
                    }
                else {
                    DefaultDevice = Key.Value;
                    }
                }

            if (DefaultDevice != null) {
                DeviceProfiles.TryGetValue(DefaultDevice, out _Device);
                }

            return;
            }
        /// <summary>
        /// Add the associated profile to the machine store.
        /// </summary>
        /// <param name="SignedDeviceProfile">Profile to add.</param>
        /// <returns>The registration created</returns>
        public RegistrationDevice Add(SignedDeviceProfile SignedDeviceProfile) {
            var Registration = new RegistrationDevice(SignedDeviceProfile);

            Add(Registration);
            return Registration;
            }
        /// <summary>
        /// Add the associated registration to the machine store.
        /// </summary>
        /// <param name="Registration">Profile to add.</param> 
        public void Add(RegistrationDevice Registration) {
            if (!DeviceProfiles.ContainsKey(Registration.UDF)) {
                DeviceProfiles.Add(Registration.UDF, Registration);
                }
            // If no existing default, register as the default
            if (Device == null) {
                Device = Registration;
                }

            }
示例#6
0
 void Report(RegistrationDevice Registration) {
     Report(Registration.Device);
     }
 /// <summary>
 /// Construct a profile entry from a device profile registration.
 /// </summary>
 /// <param name="Registration">The profile registration to use</param>
 public Profile(RegistrationDevice Registration) {
     }