Example #1
0
 protected override void ProcessRecord()
 {
     if (_dictionary.ContainsKey(PARAM_Name))
     {
         string Name = _dictionary[PARAM_Name].Value as string;
         if (!string.IsNullOrEmpty(Name))
         {
             NetworkProfile profile = _networkProfileList.First(x => x.Name == Name);
             if (Interfaces != null)
             {
                 profile.Interfaces = Interfaces;
             }
             if (Proxy != null)
             {
                 profile.Proxy = Proxy;
             }
             if (StaticRoutes != null)
             {
                 profile.StaticRoutes = StaticRoutes;
             }
             DataSerializer.Serialize <NetworkProfile>(
                 profile, Path.Combine(Item.WorkDirectory, Name + ".json"));
         }
     }
 }
Example #2
0
        /// <summary>
        /// Handles the DoWork event of the backgroundWorker control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.</param>
        public void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            DataModel.BlockAllOperation = true;

            try
            {
                bool           runDeviceConfig = true;
                NetworkProfile profile         = (NetworkProfile)e.Argument;
                if (profile == null)
                {
                    // autodetect
                    profile         = NetworkProfileHelper.AutoDetectNetworkProfile(DataModel.NetworkProfileList);
                    runDeviceConfig = false;
                }

                if (profile != null)
                {
                    UseCaseProfile.Run(profile, backgroundWorker, runDeviceConfig);
                }

                e.Result = profile;
            }
            finally
            {
                DataModel.BlockAllOperation = false;
            }
        }
Example #3
0
    public override void Handle(byte[] PacketBytes)
    {
        using (MemoryStream MemoryStream = new MemoryStream(PacketBytes))
        {
            using (BinaryReader Reader = new BinaryReader(MemoryStream))
            {
                MemoryStream.Position = 2;
                int ClientId = Helper.ReadInt(Reader);
                Debug.Log("Получены данные от клиента " + ClientId);

                EnemyPlayerInfo EnemyInfo = NetworkProfile.GetEnemyByKey(ClientId);

                EnemyInfo.X     = Helper.ReadFloat(Reader);
                EnemyInfo.Y     = Helper.ReadFloat(Reader);
                EnemyInfo.Z     = Helper.ReadFloat(Reader);
                EnemyInfo.Yaw   = Helper.ReadFloat(Reader);
                EnemyInfo.Pitch = Helper.ReadFloat(Reader);
                Debug.Log("X: " + EnemyInfo.X);
                Debug.Log("Y: " + EnemyInfo.Y);
                Debug.Log("Z: " + EnemyInfo.Z);
                Debug.Log("Yaw: " + EnemyInfo.Yaw);
                Debug.Log("Pitch: " + EnemyInfo.Pitch);

                Debug.Log("Данные игрока " + ClientId + " обновлены");
            }
        }
    }
 internal VirtualMachineScaleSetVmData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, string instanceId, Models.Sku sku, Models.Plan plan, IReadOnlyList <VirtualMachineExtensionData> resources, IReadOnlyList <string> zones, bool?latestModelApplied, string vmId, VirtualMachineScaleSetVmInstanceView instanceView, HardwareProfile hardwareProfile, StorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, OSProfile osProfile, SecurityProfile securityProfile, NetworkProfile networkProfile, VirtualMachineScaleSetVmNetworkProfileConfiguration networkProfileConfiguration, DiagnosticsProfile diagnosticsProfile, WritableSubResource availabilitySet, string provisioningState, string licenseType, string modelDefinitionApplied, VirtualMachineScaleSetVmProtectionPolicy protectionPolicy, string userData) : base(id, name, type, systemData, tags, location)
 {
     InstanceId                  = instanceId;
     Sku                         = sku;
     Plan                        = plan;
     Resources                   = resources;
     Zones                       = zones;
     LatestModelApplied          = latestModelApplied;
     VmId                        = vmId;
     InstanceView                = instanceView;
     HardwareProfile             = hardwareProfile;
     StorageProfile              = storageProfile;
     AdditionalCapabilities      = additionalCapabilities;
     OSProfile                   = osProfile;
     SecurityProfile             = securityProfile;
     NetworkProfile              = networkProfile;
     NetworkProfileConfiguration = networkProfileConfiguration;
     DiagnosticsProfile          = diagnosticsProfile;
     AvailabilitySet             = availabilitySet;
     ProvisioningState           = provisioningState;
     LicenseType                 = licenseType;
     ModelDefinitionApplied      = modelDefinitionApplied;
     ProtectionPolicy            = protectionPolicy;
     UserData                    = userData;
 }
 internal VirtualMachineData(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, AzureLocation location, Models.Plan plan, IReadOnlyList <VirtualMachineExtensionData> resources, ResourceIdentity identity, IList <string> zones, Models.ExtendedLocation extendedLocation, HardwareProfile hardwareProfile, StorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, OSProfile osProfile, NetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, WritableSubResource availabilitySet, WritableSubResource virtualMachineScaleSet, WritableSubResource proximityPlacementGroup, VirtualMachinePriorityTypes?priority, VirtualMachineEvictionPolicyTypes?evictionPolicy, BillingProfile billingProfile, WritableSubResource host, WritableSubResource hostGroup, string provisioningState, VirtualMachineInstanceView instanceView, string licenseType, string vmId, string extensionsTimeBudget, int?platformFaultDomain, ScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, ApplicationProfile applicationProfile) : base(id, name, type, tags, location)
 {
     Plan                    = plan;
     Resources               = resources;
     Identity                = identity;
     Zones                   = zones;
     ExtendedLocation        = extendedLocation;
     HardwareProfile         = hardwareProfile;
     StorageProfile          = storageProfile;
     AdditionalCapabilities  = additionalCapabilities;
     OsProfile               = osProfile;
     NetworkProfile          = networkProfile;
     SecurityProfile         = securityProfile;
     DiagnosticsProfile      = diagnosticsProfile;
     AvailabilitySet         = availabilitySet;
     VirtualMachineScaleSet  = virtualMachineScaleSet;
     ProximityPlacementGroup = proximityPlacementGroup;
     Priority                = priority;
     EvictionPolicy          = evictionPolicy;
     BillingProfile          = billingProfile;
     Host                    = host;
     HostGroup               = hostGroup;
     ProvisioningState       = provisioningState;
     InstanceView            = instanceView;
     LicenseType             = licenseType;
     VmId                    = vmId;
     ExtensionsTimeBudget    = extensionsTimeBudget;
     PlatformFaultDomain     = platformFaultDomain;
     ScheduledEventsProfile  = scheduledEventsProfile;
     UserData                = userData;
     CapacityReservation     = capacityReservation;
     ApplicationProfile      = applicationProfile;
 }
        public List <NetworkProfile> List()
        {
            List <NetworkProfile> result       = new List <NetworkProfile>();
            RegistryKey           localMachine = Registry.LocalMachine;

            using (RegistryKey parent = localMachine.OpenSubKey(PATH))
            {
                string[] profiles = parent.GetSubKeyNames();
                foreach (string id in profiles)
                {
                    RegistryKey    key     = parent.OpenSubKey(id);
                    NetworkProfile profile = new NetworkProfile(id);
                    profile.Category = (int)key.GetValue("Category");
                    if (key.GetValue("CategoryType") != null)
                    {
                        profile.CategoryType = (int)key.GetValue("CategoryType");
                    }
                    profile.DateCreated       = BinDateConverter.Parse((byte[])key.GetValue("DateCreated"));
                    profile.DateLastConnected = BinDateConverter.Parse((byte[])key.GetValue("DateLastConnected"));
                    profile.Description       = (string)key.GetValue("Description");
                    profile.Managed           = (int)key.GetValue("Managed");
                    profile.NameType          = (int)key.GetValue("NameType");
                    profile.ProfileName       = (string)key.GetValue("ProfileName");
                    key.Close();
                    result.Add(profile);
                }
            }
            return(result);
        }
        public async ValueTask <Response <NetworkProfile> > GetAsync(string resourceGroupName, string networkProfileName, string expand = null, CancellationToken cancellationToken = default)
        {
            if (resourceGroupName == null)
            {
                throw new ArgumentNullException(nameof(resourceGroupName));
            }
            if (networkProfileName == null)
            {
                throw new ArgumentNullException(nameof(networkProfileName));
            }

            using var message = CreateGetRequest(resourceGroupName, networkProfileName, expand);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            {
                NetworkProfile value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                if (document.RootElement.ValueKind == JsonValueKind.Null)
                {
                    value = null;
                }
                else
                {
                    value = NetworkProfile.DeserializeNetworkProfile(document.RootElement);
                }
                return(Response.FromValue(value, message.Response));
            }
Example #8
0
        ///GENMHASH:2FE8C4C2D5EAD7E37787838DE0B47D92:F59DCE21697E0967B005EDC164141A79
        protected override VirtualMachineImpl WrapModel(string name)
        {
            var osDisk         = new OSDisk();
            var storageProfile = new StorageProfile();

            storageProfile.OsDisk    = osDisk;
            storageProfile.DataDisks = new List <DataDisk>();
            var networkProfile = new NetworkProfile();

            networkProfile.NetworkInterfaces = new List <NetworkInterfaceReferenceInner>();

            VirtualMachineInner inner = new VirtualMachineInner();

            inner.StorageProfile  = storageProfile;
            inner.OsProfile       = new OSProfile();
            inner.HardwareProfile = new HardwareProfile();
            inner.NetworkProfile  = networkProfile;

            return(new VirtualMachineImpl(
                       name,
                       inner,
                       base.Manager,
                       this.storageManager,
                       this.networkManager,
                       this.rbacManager));
        }
 internal VirtualMachineData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, ExtendedLocation extendedLocation, string kind, SystemAssignedServiceIdentity identity, string resourcePoolId, string templateId, string vCenterId, PlacementProfile placementProfile, OSProfile osProfile, HardwareProfile hardwareProfile, NetworkProfile networkProfile, StorageProfile storageProfile, GuestAgentProfile guestAgentProfile, string moRefId, string inventoryItemId, string moName, string folderPath, string instanceUuid, string smbiosUuid, FirmwareType?firmwareType, string powerState, string customResourceName, string uuid, IReadOnlyList <ResourceStatus> statuses, string provisioningState, string vmId) : base(id, name, type, systemData, tags, location)
 {
     ExtendedLocation   = extendedLocation;
     Kind               = kind;
     Identity           = identity;
     ResourcePoolId     = resourcePoolId;
     TemplateId         = templateId;
     VCenterId          = vCenterId;
     PlacementProfile   = placementProfile;
     OSProfile          = osProfile;
     HardwareProfile    = hardwareProfile;
     NetworkProfile     = networkProfile;
     StorageProfile     = storageProfile;
     GuestAgentProfile  = guestAgentProfile;
     MoRefId            = moRefId;
     InventoryItemId    = inventoryItemId;
     MoName             = moName;
     FolderPath         = folderPath;
     InstanceUuid       = instanceUuid;
     SmbiosUuid         = smbiosUuid;
     FirmwareType       = firmwareType;
     PowerState         = powerState;
     CustomResourceName = customResourceName;
     Uuid               = uuid;
     Statuses           = statuses;
     ProvisioningState  = provisioningState;
     VmId               = vmId;
 }
Example #10
0
        /// <summary>
        /// Handles the Click event of the toolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void toolStripMenuItem_Click(object sender, EventArgs e)
        {
            pictureBox.Image = ((ToolStripMenuItem)sender).Image;

            // set the image
            NetworkProfile profile = (NetworkProfile)Tag;

            profile.ImageName = (string)((ToolStripMenuItem)sender).Tag;
        }
Example #11
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Containers == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Containers");
     }
     if (OsType == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "OsType");
     }
     if (Containers != null)
     {
         foreach (var element in Containers)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (ImageRegistryCredentials != null)
     {
         foreach (var element1 in ImageRegistryCredentials)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (IpAddress != null)
     {
         IpAddress.Validate();
     }
     if (Volumes != null)
     {
         foreach (var element2 in Volumes)
         {
             if (element2 != null)
             {
                 element2.Validate();
             }
         }
     }
     if (Diagnostics != null)
     {
         Diagnostics.Validate();
     }
     if (NetworkProfile != null)
     {
         NetworkProfile.Validate();
     }
     if (DnsConfig != null)
     {
         DnsConfig.Validate();
     }
 }
Example #12
0
        /// <summary>
        /// Saves the configuration.
        /// </summary>
        public void SaveConfiguration(NetworkProfile profile)
        {
            if (profile == null)
            {
                return;
            }

            WifiProfileSSID            = cbWifiProfile.Text;
            profile.AssociatedWifiSSID = WifiProfileSSID;
        }
Example #13
0
        /// <summary>
        /// Converts to.
        /// </summary>
        /// <param name="profile">The profile.</param>
        public static WinsConfiguration ValueOf(NetworkProfile profile)
        {
            WinsConfiguration config = new WinsConfiguration();

            config.Enabled         = profile.NetworkCardInfo.WinsEnabled;
            config.PrimaryServer   = profile.NetworkCardInfo.WinsPrimaryServer;
            config.SecondaryServer = profile.NetworkCardInfo.WinsSecondaryServer;

            return(config);
        }
Example #14
0
 void Start()
 {
     AnimationManager = GetComponent <AnimationManager>();
     SoundManager     = GetComponent <SoundManager>();
     EnemyInfo        = NetworkProfile.GetLastEnemyPlayer();//NetworkProfile.GetEnemyByKey(this.IdClient);
     RigidBody        = GetComponent <Rigidbody>();
     TextMeshPro      = Nickname.GetComponent <TextMeshPro>();
     TextMeshPro.text = EnemyInfo.Nickname;
     ClientId         = EnemyInfo.ClientId;
 }
Example #15
0
 internal ClusterResourceProperties(ProvisioningState?provisioningState, NetworkProfile networkProfile, int?version, string serviceId, PowerState?powerState, bool?zoneRedundant, string fqdn)
 {
     ProvisioningState = provisioningState;
     NetworkProfile    = networkProfile;
     Version           = version;
     ServiceId         = serviceId;
     PowerState        = powerState;
     ZoneRedundant     = zoneRedundant;
     Fqdn = fqdn;
 }
Example #16
0
    public void OnRefreshClick()
    {
        SessionListPacket SessionListPacket = new SessionListPacket();

        NetworkManager.SendPacket(SessionListPacket);

        UpdateUISessionList();

        int SessionCount = NetworkProfile.GetSessionCount();

        Debug.Log("Кол-во сесский в словаре: " + SessionCount);
    }
Example #17
0
        /// <summary>
        /// Selects the profile.
        /// </summary>
        /// <param name="networkProfile">The network profile.</param>
        public static bool SelectProfile(NetworkProfile networkProfile)
        {
            if (networkProfile == null)
            {
                MyMessageBox.ShowMessage("No profile selected!");
                return(false);
            }
            DataModel.SelectedNetworkProfile = networkProfile;
            Debug.WriteLine("Selected profile " + networkProfile.Name);

            return(true);
        }
        public override void ExecuteCmdlet()
        {
            var networkProfile = this.VM.NetworkProfile;

            if (networkProfile == null)
            {
                networkProfile = new NetworkProfile
                {
                    NetworkInterfaces = new List <NetworkInterfaceReference>()
                };
            }

            if (networkProfile.NetworkInterfaces == null)
            {
                networkProfile.NetworkInterfaces = new List <NetworkInterfaceReference>();
            }

            if (!this.Primary.IsPresent)
            {
                networkProfile.NetworkInterfaces.Add(new NetworkInterfaceReference
                {
                    ReferenceUri = this.Id,
                });

                if (networkProfile.NetworkInterfaces.Count > 1)
                {
                    // run through the entire list of networkInterfaces and if Primary is not set, set them to false
                    foreach (var nic in networkProfile.NetworkInterfaces)
                    {
                        nic.Primary = nic.Primary ?? false;
                    }
                }
            }
            else
            {
                foreach (var networkInterfaceReference in networkProfile.NetworkInterfaces)
                {
                    networkInterfaceReference.Primary = false;
                }

                networkProfile.NetworkInterfaces.Add(
                    new NetworkInterfaceReference
                {
                    ReferenceUri = this.Id,
                    Primary      = true
                });
            }

            this.VM.NetworkProfile = networkProfile;

            WriteObject(this.VM);
        }
Example #19
0
        /// <summary>
        /// Saves the current profile.
        /// </summary>
        public static void SaveProfile(NetworkProfile profile = null)
        {
            if (profile == null)
            {
                FormProfile viewProfile = ViewModel.SelectedView as FormProfile;

                if (viewProfile == null)
                {
                    MyMessageBox.ShowAlert("No profile selected!");
                    return;
                }

                // ANS-10: check if any nic is selected
                if (viewProfile.SelectedNetworkCard == null)
                {
                    MyMessageBox.ShowAlert("No network card is selected, profile is not saved!");
                    return;
                }

                // check if it is possibile do operation
                if (UseCaseApplication.CheckIsOperationNotAllowedNow())
                {
                    return;
                }


                viewProfile.StoreFormOnData();
                profile = viewProfile.Profile;
            }
            if (profile.IsNew)
            {
                profile.Id = CreateNewProfileId();
                // if not exist add it
                DataModel.NetworkProfileList.Add(profile);
            }
            else
            {
                // save profile
                for (int i = 0; i < DataModel.NetworkProfileList.Count; i++)
                {
                    if (profile.Id == DataModel.NetworkProfileList[i].Id)
                    {
                        // found e replace
                        DataModel.NetworkProfileList[i] = profile;
                        break;
                    }
                }
            }
            // list refresh
            Refresh();
        }
Example #20
0
        /// <summary>
        /// Finds the and close profile.
        /// </summary>
        /// <param name="profile">The profile.</param>
        public static bool FindAndCloseProfile(NetworkProfile profile)
        {
            foreach (FormProfile form in ViewModel.ProfileViewList)
            {
                if (form.Profile.Id.Equals(profile.Id))
                {
                    form.Close();
                    ViewModel.ProfileViewList.Remove(form);
                    return(true);
                }
            }

            return(false);
        }
Example #21
0
        /// <summary>
        /// Shows the specified profile. Set the profile as selectedProfile
        /// </summary>
        /// <param name="profile">The profile.</param>
        public static void Show(NetworkProfile profile)
        {
            // set the selected profile in model
            if (SelectProfile(profile))
            {
                // selected the current ribbon
                ViewModel.MainView.ribbon.ActiveTab   = ViewModel.MainView.rtOperations;
                ViewModel.MainView.rpProfile.Selected = true;

                // show
                Debug.WriteLine("Show profile " + profile.Name);
                UseCaseView.ShowProfile(profile);
            }
        }
Example #22
0
        protected PathClientService(IServiceAddress address, IServiceAddress managerAddress, IServiceConnector connector)
        {
            this.address = address;
            this.managerAddress = managerAddress;
            this.connector = connector;

            NetworkConfigSource netConfig = new NetworkConfigSource();
            netConfig.AddNetworkNode(managerAddress);

            network = new NetworkProfile(connector);
            network.Configuration = netConfig;

            log = Logger.Network;
        }
Example #23
0
        /// <summary>
        /// Shows the new profile.
        /// </summary>
        public static void ShowNewProfile()
        {
            // check if it is possibile to do operation
            if (UseCaseApplication.CheckIsOperationNotAllowedNow())
            {
                return;
            }

            NetworkProfile profile = new NetworkProfile();

            profile.Name = UseCaseProfile.NEW_NIC_NAME;

            ShowProfile(profile);
        }
Example #24
0
        /// <summary>
        /// Existses the specified profile.
        /// </summary>
        /// <param name="profile">The profile.</param>
        /// <returns></returns>
        public static bool Exists(NetworkProfile profile)
        {
            if (profile.Id >= DataModel.NetworkProfileList.Count)
            {
                return(false);
            }
            NetworkProfile net = DataModel.NetworkProfileList[profile.Id];

            if (net == null)
            {
                return(false);
            }
            return(true);
        }
        public void Update(NetworkLocation record)
        {
            if (record == null || record.ProfileId == null || record.SignatureId == null)
            {
                return;
            }
            NetworkProfile   profile   = new NetworkProfile(record.ProfileId);
            NetworkSignature signature = new NetworkSignature(record.SignatureId);

            profile.Category    = record.Category;
            profile.Description = signature.Description = record.Description;
            profile.ProfileName = signature.FirstNetwork = record.Name;
            networkProfileMapper.Update(profile);
            networkSignatureMapper.Update(signature);
        }
Example #26
0
 private void FixedUpdate()
 {
     //Создание игрового объекта на сцене
     if (NetworkProfile.IsSessionHaveNewPlayer())
     {
         EnemyPlayerInfo Enemy = NetworkProfile.GetLastEnemyPlayer();
         if (Enemy.StartPosition != -1)
         {
             InstantiateEnemyPlayer(Enemy.StartPosition);
         }
         else
         {
             InstantiateExistedEnemyPlayer(Enemy.X, Enemy.Y, Enemy.Z, Enemy.Pitch, Enemy.Yaw);
         }
     }
 }
Example #27
0
        /// <summary>
        /// Handles the RunWorkerCompleted event of the backgroundWorker control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.ComponentModel.RunWorkerCompletedEventArgs"/> instance containing the event data.</param>
        private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            NetworkProfile profile = (NetworkProfile)e.Result;

            lblStatus.Text = "Completed";
            if (profile != null)
            {
                MessageBox.Show("Applied profile " + profile.Name, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("No profile applyed!!! ", "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            lblStatus.Text    = "Ready";
            progressBar.Value = 0;
        }
Example #28
0
        /// <summary>
        /// Refreshes the wifi combo.
        /// </summary>
        protected void RefreshWifiCombo(NetworkProfile profile)
        {
            WindowsNetworkCard config = profile.NetworkCardInfo;

            if (config == null)
            {
                return;
            }

            // get the correct type from dataModel, cause _configuration.CardType is not affidable
            WindowsNetworkCard     wnc  = DataModel.FindNetworkCard(config.Id);
            WindowsNetworkCardType type = WindowsNetworkCardType.UNKNOWN;

            if (wnc != null)
            {
                type = wnc.CardType;
            }

            // for wifi card
            if (WindowsNetworkCardType.WIRELESS == type)
            {
                WifiProfile currentWifiProfile = WifiProfileManager.GetActiveWifiProfileForCard(config);

                List <WifiProfile> listWifiProfile = WifiProfileManager.GetWifiProfilesForCard(config);

                cbWifiProfile.Items.Clear();
                cbWifiProfile.Items.Add("");
                foreach (WifiProfile item in listWifiProfile)
                {
                    cbWifiProfile.Items.Add(item.SSID);
                }

                // if nic is disable, no wireless profile found. Add the selected profile
                if (listWifiProfile.Count == 0)
                {
                    cbWifiProfile.Items.Add(WifiProfileSSID);
                }

                cbWifi.Checked     = WifiProfileSelected;
                cbWifiProfile.Text = WifiProfileSSID;
            }
            else
            {
                cbWifi.Checked     = false;
                cbWifiProfile.Text = "";
            }
        }
Example #29
0
 /// <summary>
 /// Virtual Machine property
 /// </summary>
 /// <param name="_multiVM"></param>
 /// <param name="_hasDataDisk"></param>
 /// <param name="_useAvSet"></param>
 /// <param name="_useDiagAcc"></param>
 public Property_VirtualMachine(bool _multiVM, bool _hasDataDisk, bool _useAvSet, bool _useDiagAcc)
 {
     osProfile       = new OsProfile(_multiVM);
     hardwareProfile = new HardwareProfile();
     storageProfile  = new StorageProfile(_hasDataDisk);
     networkProfile  = new NetworkProfile(_multiVM);
     // Diagnostic Account
     if (_useDiagAcc)
     {
         diagnosticsProfile = new DiagnosticsProfile();
     }
     // Availability Set
     if (_useAvSet)
     {
         availabilitySet = new AvailabilitySet();
     }
 }
Example #30
0
        /// <summary>
        /// Duplicates the profile.
        /// </summary>
        /// <param name="profile">The profile.</param>
        public static void DuplicateProfile(NetworkProfile profile)
        {
            // check if it is possibile to do operation
            if (UseCaseApplication.CheckIsOperationNotAllowedNow())
            {
                return;
            }

            NetworkProfile newProfile = new NetworkProfile();

            newProfile = NetworkProfile.Copy(profile);

            newProfile.Id   = UseCaseProfile.CreateNewProfileId();
            newProfile.Name = "Copy of " + newProfile.Name;

            DataModel.NetworkProfileList.Add(newProfile);

            Refresh();
        }
Example #31
0
        /// <summary>
        /// Views the data on form.
        /// </summary>
        public override void ViewDataOnForm()
        {
            NetworkProfile profile = Profile;

            RefreshNetworkAdapter();

            txtName.Text = profile.Name;
            TabText      = "Profile: " + profile.Name;

            // load the image profile
            pictureBox.Image = UseCaseApplication.GetImage(profile.ImageName);

            ipControl.DisplayConfiguration(profile.NetworkCardInfo);
            dnsConfiguration.DisplayConfiguration(profile.NetworkCardInfo);

            winsControl.DisplayConfiguration(WinsConfiguration.ValueOf(profile));

            proxyPanel.Configuration = profile.ProxyConfig;
            serviceListView.Items    = profile.ServiceList;
            applicationsListView.SetItems(profile.ExecList);
            driveMapListView.SetItems(profile.DriveMapList);
            lblSelectedPrinter.Text = profile.DefaultPrinter;

            cbPrinterList.Items.Clear();
            int indexPrinter = 0;
            int i1           = 0;

            cbPrinterList.Items.Add("");
            foreach (String item in PrinterSettings.InstalledPrinters)
            {
                i1++;
                cbPrinterList.Items.Add(item);

                if (item.ToLower().Equals(profile.DefaultPrinter.ToLower()))
                {
                    indexPrinter = i1;
                }
            }
            cbPrinterList.SelectedIndex = indexPrinter;

            // disabled nic
            networkCardListView.SelectedItems = profile.DisabledNetworkCards;
        }
        public void SetUp()
        {
            adminService = new FakeAdminService(NetworkStoreType.Memory);
            adminService.Start();

            NetworkProfile networkProfile = new NetworkProfile(new FakeServiceConnector(adminService));
            NetworkConfigSource netConfig = new NetworkConfigSource();
            netConfig.AddNetworkNode(FakeServiceAddress.Local);
            networkProfile.Configuration = netConfig;
            networkProfile.StartService(FakeServiceAddress.Local, ServiceType.Manager);
            networkProfile.StartService(FakeServiceAddress.Local, ServiceType.Root);
            networkProfile.RegisterRoot(FakeServiceAddress.Local);
            networkProfile.StartService(FakeServiceAddress.Local, ServiceType.Block);
            networkProfile.RegisterBlock(FakeServiceAddress.Local);
            networkProfile.Refresh();

            networkProfile.AddPath(FakeServiceAddress.Local, PathName, PathTypeName);
            networkProfile.Refresh();

            HeapTokenStore tokenStore = new HeapTokenStore();
            HeapConsumerStore consumerStore = new HeapConsumerStore();
            consumerStore.Add(Consumer);

            provider = new FakeOAuthProvider();
            provider.TokenStore = tokenStore;
            provider.ConsumerStore = consumerStore;
            provider.TokenGenerator = new GuidTokenGenerator();
            provider.RequestIdValidator = new HeapRequestIdValidator(20);
            provider.VerificationProvider = new MD5HashVerificationProvider();

            authenticator = new OAuthAuthenticator();

            clientService = new RestPathClientService(new HttpServiceAddress(PathServiceAddress), FakeServiceAddress.Local,
                                                      new FakeServiceConnector(adminService));
            clientService.Authenticator = authenticator;
            clientService.Init();

            StartListner();
        }
Example #33
0
 partial void OnNetworkProfileChanging(NetworkProfile value);
Example #34
0
 public static NetworkProfile CreateNetworkProfile(global::System.Collections.ObjectModel.ObservableCollection<NetworkAdapter> networkAdapters)
 {
     NetworkProfile networkProfile = new NetworkProfile();
     if ((networkAdapters == null))
     {
         throw new global::System.ArgumentNullException("networkAdapters");
     }
     networkProfile.NetworkAdapters = networkAdapters;
     return networkProfile;
 }