예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OperatingSystems oOperatingSystem = new OperatingSystems(0, dsn);
            Classes          oClass           = new Classes(0, dsn);

            if (Request.QueryString["u"] != null && Request.QueryString["u"] == "GET")
            {
                XmlDocument oDoc = new XmlDocument();
                oDoc.Load(Request.InputStream);
                Response.ContentType = "application/xml";
                StringBuilder sb       = new StringBuilder("<values>");
                string        strValue = Server.UrlDecode(oDoc.FirstChild.InnerXml);
                int           intOs    = Int32.Parse(strValue);
                DataSet       ds       = oOperatingSystem.GetServicePack(intOs);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    sb.Append("<value>");
                    sb.Append(dr["id"].ToString());
                    sb.Append("</value><text>");
                    sb.Append(dr["name"].ToString());
                    sb.Append("</text>");
                }
                sb.Append("</values>");
                Response.Write(sb.ToString());
                Response.End();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
     {
         intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
     }
     else
     {
         Reload();
     }
     oServerName       = new ServerName(intProfile, dsn);
     oOperatingSystems = new OperatingSystems(intProfile, dsn);
     btnClose.Attributes.Add("onclick", "return HidePanel();");
     if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
     {
         intComponent = Int32.Parse(Request.QueryString["id"]);
     }
     if (!IsPostBack)
     {
         Load(null);
         if (intComponent > 0)
         {
             lblName.Text = oServerName.GetComponent(intComponent, "name");
         }
     }
 }
예제 #3
0
 public Computers(Guid serialNumber, string description, DateTime dateOfBuying, DateTime warranty,
                  double price, Manufacturer manufacturer, OperatingSystems operatingSystem, bool ifPortable, bool hasBattery) : base(serialNumber,
                                                                                                                                      description, dateOfBuying, warranty, price, manufacturer, hasBattery)
 {
     OperatingSystem = operatingSystem;
     IfPortable      = ifPortable;
 }
예제 #4
0
 // to enable unit testing
 internal OSSkipConditionAttribute(
     OperatingSystems operatingSystem, IRuntimeEnvironment runtimeEnvironment, params string[] versions)
 {
     _excludedOperatingSystem = operatingSystem;
     _excludedVersions        = versions ?? Enumerable.Empty <string>();
     _runtimeEnvironment      = runtimeEnvironment;
 }
예제 #5
0
        public static int Insert(OperatingSystems data)
        {
            object rs = DataProvider.Instance.ExecuteNonQueryWithOutput(
                "@OperatingSystemID", "OperatingSystem_Insert", data.OperatingSystemID, data.Name, data.Version, data.Description);

            return(rs != null?Convert.ToInt32(rs) : 0);
        }
예제 #6
0
        public ProjectExplorerViewModel(
            IWin32Window view,
            ApplicationSettingsRepository settingsRepository,
            IJobService jobService,
            IEventService eventService,
            IGlobalSessionBroker sessionBroker,
            IProjectModelService projectModelService,
            ICloudConsoleService cloudConsoleService)
        {
            this.View = view;
            this.settingsRepository  = settingsRepository;
            this.jobService          = jobService;
            this.sessionBroker       = sessionBroker;
            this.projectModelService = projectModelService;
            this.cloudConsoleService = cloudConsoleService;

            this.RootNode = new CloudViewModelNode(this);

            //
            // Read current settings.
            //
            // NB. Do not hold on to the settings object because it might change.
            //

            this.operatingSystemsFilter = settingsRepository
                                          .GetSettings()
                                          .IncludeOperatingSystems
                                          .EnumValue;

            eventService.BindAsyncHandler <SessionStartedEvent>(
                e => UpdateInstanceAsync(e.Instance, i => i.IsConnected = true));
            eventService.BindAsyncHandler <SessionEndedEvent>(
                e => UpdateInstanceAsync(e.Instance, i => i.IsConnected = false));
        }
예제 #7
0
 public GatewaySystem(string name, OperatingSystems selectedos, MotherboardSystem motherboard, FileSystem files) //,Texture2D icon)
 {
     Name        = name;
     SelectedOS  = selectedos;
     Motherboard = motherboard;
     Files       = files;
 }
        public ComputerTechnologyItem[] FillComputerTechnologyWithDummyItems()
        {
            var computerArray = new ComputerTechnologyItem[10];

            for (var computerIterator = 0; computerIterator < computerArray.Length; computerIterator++)
            {
                var valuesOfCompManufacturers = Enum.GetValues(typeof(ComputerManufacturer));
                var valuesOfOperatingSystems  = Enum.GetValues(typeof(OperatingSystems));
                var random = new Random(computerIterator);
                ComputerManufacturer randomComputerManufacturer =
                    (ComputerManufacturer)valuesOfCompManufacturers.GetValue(random.Next(0,
                                                                                         valuesOfCompManufacturers.Length));
                OperatingSystems randomOperatingSystem =
                    (OperatingSystems)valuesOfOperatingSystems.GetValue(
                        random.Next(0, valuesOfOperatingSystems.Length));
                var batteryAndPortableInterchange = computerIterator % 2 == 0;

                computerArray[computerIterator] = new ComputerTechnologyItem(
                    ("This is just an dummy description for computer " + computerIterator),
                    (new DateTime(2019, 1 + computerIterator, 1)),
                    (1000 * (computerIterator + 1)),
                    (new DateTime(2017, 1 + computerIterator, 1)),
                    randomComputerManufacturer,
                    batteryAndPortableInterchange,
                    randomOperatingSystem,
                    batteryAndPortableInterchange);
            }
            return(computerArray);
        }
예제 #9
0
        /// <summary>
        /// Reports if this set of configuration mix constraints can be satisfied on the specified
        /// machine. If no machine is specified, active machine is queried.
        /// </summary>
        /// <returns></returns>
        internal bool IsSatisfied(MachineRecord record)
        {
            if (record == null)
            {
                throw new ArgumentNullException("record");
            }

            //Note - The query operators may be worth caching... Need to see how that plays out.
            if (!HasMatch(OperatingSystems, record.OperatingSystem))
            {
                Explanation = "Configuration OSes: " + OperatingSystems.ToCommaSeparatedList() + " did not match " + record.OperatingSystem;
                return(false);
            }
            else if (!HasMatch(Architectures, record.Architecture))
            {
                Explanation = "Configuration Architectures: " + Architectures.ToCommaSeparatedList() + " did not match: " + record.Architecture;
                return(false);
            }
            else if (Culture != null && !Culture.Equals(record.Culture, StringComparison.OrdinalIgnoreCase))
            {
                Explanation = "Configuration Culture: " + Culture + " did not match:" + record.Culture;
                return(false);
            }
            else if (!String.IsNullOrEmpty(MultiMonitor) &&
                     (String.Compare(MultiMonitor, "True", StringComparison.InvariantCultureIgnoreCase) == 0) &&
                     (record.MonitorCount < 2))
            {
                Explanation = "Configuration MultiMonitor did not match. Test need multiple monitors, actual monitors enabled: " + record.MonitorCount;
                return(false);
            }
            else
            {
                return(true);
            }
        }
 // to enable unit testing
 internal OSSkipConditionAttribute(
     OperatingSystems operatingSystem, OperatingSystems osPlatform, string osVersion, params string[] versions)
 {
     _excludedOperatingSystem = operatingSystem;
     _excludedVersions = versions ?? Enumerable.Empty<string>();
     _osPlatform = osPlatform;
     _osVersion = osVersion;
 }
 public OSSkipConditionAttribute(OperatingSystems operatingSystem, params string[] versions) :
     this(
         operatingSystem,
         GetCurrentOS(),
         GetCurrentOSVersion(),
         versions)
 {
 }
예제 #12
0
 public OSSkipConditionAttribute(OperatingSystems operatingSystem, params string[] versions) :
     this(
         operatingSystem,
         GetCurrentOS(),
         GetCurrentOSVersion(),
         versions)
 {
 }
 public ComputerTechnologyItem(string description, DateTime dateOfWarrantyEnd,
                               int priceOnPurchase, DateTime dateOfPurchase, ComputerManufacturer manufacturer, Boolean batteryBoolean, OperatingSystems operatingSystem, Boolean portable)
     : base(description, dateOfWarrantyEnd, priceOnPurchase, dateOfPurchase, batteryBoolean)
 {
     OperatingSystem = operatingSystem;
     Portable        = portable;
     Manufacturer    = manufacturer;
 }
 public MinimumOSVersionAttribute(OperatingSystems operatingSystem, string minVersion) :
     this(
         operatingSystem,
         GetCurrentOS(),
         GetCurrentOSVersion(),
         Version.Parse(minVersion))
 {
 }
예제 #15
0
 public OSSkipConditionAttribute(OperatingSystems operatingSystem, params string[] versions) :
     this(
         operatingSystem,
         PlatformServices.Default.Runtime.OperatingSystemPlatform,
         PlatformServices.Default.Runtime.OperatingSystemVersion,
         versions)
 {
 }
예제 #16
0
 // to enable unit testing
 internal OSSkipConditionAttribute(
     OperatingSystems operatingSystem, OperatingSystems osPlatform, string osVersion, params string[] versions)
 {
     _excludedOperatingSystem = operatingSystem;
     _excludedVersions        = versions ?? Enumerable.Empty <string>();
     _osPlatform = osPlatform;
     _osVersion  = osVersion;
 }
        public void CheckNoMatch()
        {
            var UserAgent = "Apeture";

            var actualOS = OperatingSystems.GetOperatingSystem(UserAgent);

            Assert.IsNull(actualOS);
        }
예제 #18
0
 public void OsProbabilityTest()
 {
     os = new MacOS();
     Assert.AreEqual(10, os.InfectionProbability);
     os = new Linux();
     Assert.AreEqual(40, os.InfectionProbability);
     os = new Windows();
     Assert.AreEqual(80, os.InfectionProbability);
 }
        public void CheckWindows7()
        {
            var UserAgent = "Windows NT 6.1";
            var Windows7OperatingSystem = OperatingSystems.Windows7;

            var actualOS = OperatingSystems.GetOperatingSystem(UserAgent);

            Assert.AreEqual(Windows7OperatingSystem, actualOS);
        }
        public void CheckoutWindowsServer2003()
        {
            var UserAgent = "Windows NT 5.2";
            var WindowsServer2003OperatingSystem = OperatingSystems.WindowsXP64ORServer2003;

            var actualOS = OperatingSystems.GetOperatingSystem(UserAgent);

            Assert.AreEqual(WindowsServer2003OperatingSystem, actualOS);
        }
        public void CheckWindowsVista()
        {
            var UserAgent = "Windows NT 6.0";
            var WinodwsVistaOperatingSytem = OperatingSystems.WindowsVista;

            var actualOS = OperatingSystems.GetOperatingSystem(UserAgent);

            Assert.AreEqual(WinodwsVistaOperatingSytem, actualOS);
        }
        public void LoadLists()
        {
            OperatingSystems oOperatingSystem = new OperatingSystems(intProfile, dsn);

            ddlOS.DataValueField = "id";
            ddlOS.DataTextField  = "name";
            ddlOS.DataSource     = oOperatingSystem.Gets(1, 1);
            ddlOS.DataBind();
            ddlOS.Items.Insert(0, new ListItem("-- SELECT --", "0"));
        }
예제 #23
0
        public async Task <string> UploadFormFileAsync(IFormFile formFile, OperatingSystems system)
        {
            var fileName = Guid.NewGuid() + Path.GetExtension(formFile.FileName);
            var path     = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "images", fileName);

            using (var stream = new FileStream(path, FileMode.Create))
            {
                await formFile.CopyToAsync(stream);
            }

            return(path);
        }
        //---------------------------------------------------------------------
        // Ctor.
        //---------------------------------------------------------------------

        public InstanceNode(
            ulong instanceId,
            InstanceLocator locator,
            OperatingSystems os,
            bool isRunning)
        {
            Debug.Assert(!os.IsFlagCombination());

            this.InstanceId      = instanceId;
            this.Instance        = locator;
            this.OperatingSystem = os;
            this.IsRunning       = isRunning;
        }
        // to enable unit testing
        internal MinimumOSVersionAttribute(
            OperatingSystems operatingSystem, OperatingSystems osPlatform, Version osVersion, Version minVersion)
        {
            if (operatingSystem != OperatingSystems.Windows)
            {
                throw new NotImplementedException("Min version support is only implemented for Windows.");
            }
            _excludedOperatingSystem = operatingSystem;
            _minVersion = minVersion;
            _osPlatform = osPlatform;
            _osVersion  = osVersion;

            SkipReason = $"This test requires {_excludedOperatingSystem} {_minVersion} or later.";
        }
예제 #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = Request.Path;
     Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
     if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
     {
         intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
     }
     else
     {
         Response.Redirect("/admin/login.aspx");
     }
     oOperatingSystem = new OperatingSystems(intProfile, dsn);
     if (!IsPostBack)
     {
         LoadLists();
     }
     if (Request.QueryString["id"] == null)
     {
         if (Request.QueryString["add"] == null)
         {
             LoopRepeater();
         }
         else
         {
             panAdd.Visible    = true;
             btnOrder.Enabled  = false;
             btnOS.Enabled     = false;
             btnDelete.Enabled = false;
         }
     }
     else
     {
         panAdd.Visible = true;
         intID          = Int32.Parse(Request.QueryString["id"]);
         if (intID > 0 && !IsPostBack)
         {
             DataSet ds = oOperatingSystem.GetGroup(intID);
             hdnId.Value        = intID.ToString();
             txtName.Text       = ds.Tables[0].Rows[0]["name"].ToString();
             chkEnabled.Checked = (ds.Tables[0].Rows[0]["enabled"].ToString() == "1");
             btnAdd.Text        = "Update";
         }
     }
     // Modify "/admin/frame/frame_support_order.aspx" with the "&type=xxx" value.
     btnOS.Attributes.Add("onclick", "return OpenWindow('OPERATING_SYSTEM_GROUPS','" + hdnId.ClientID + "','',false,'500',500);");
     btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=OPERATING_SYSTEM_GROUPS" + "',false,400,400);");
     btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
 }
예제 #27
0
    // to enable unit testing
    internal MinimumOSVersionAttribute(OperatingSystems targetOS, Version minVersion, OperatingSystems currentOS, Version currentVersion)
    {
        if (targetOS != OperatingSystems.Windows)
        {
            throw new NotImplementedException("Min version support is only implemented for Windows.");
        }
        _targetOS       = targetOS;
        _minVersion     = minVersion;
        _currentOS      = currentOS;
        _currentVersion = currentVersion;

        // Do not skip other OS's, Use OSSkipConditionAttribute or a separate MinimumOSVersionAttribute for that.
        _skip      = _targetOS == _currentOS && _minVersion > _currentVersion;
        SkipReason = $"This test requires {_targetOS} {_minVersion} or later.";
    }
예제 #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            oOperatingSystem = new OperatingSystems(0, dsn);
            oLog             = new Log(0, dsn);
            oZeus            = new Zeus(0, dsnZeus);
            oFunction        = new Functions(0, dsn, intEnvironment);
            oVariable        = new Variables(intEnvironment);

            panInformation.Style["visibility"] = "hidden";
            if (!IsPostBack)
            {
                LoadLists();
                txtSearch.Focus();
            }
        }
예제 #29
0
        // to enable unit testing
        internal OSMinVersionAttribute(OperatingSystems targetOS, Version minVersion, OperatingSystems currentOS, Version currentVersion)
        {
            if (targetOS != OperatingSystems.Windows)
            {
                throw new NotImplementedException(targetOS.ToString());
            }

            _targetOS       = targetOS;
            _minVersion     = minVersion;
            _currentOS      = currentOS;
            _currentVersion = currentVersion;

            _skip      = _targetOS == _currentOS && _minVersion > _currentVersion;
            SkipReason = $"The test cannot run on this operating system version '{currentVersion}'.";
        }
예제 #30
0
        public void AddMachine(string machineName, OperatingSystems operatingSystem, IEnumerable <Kpi> kpis)
        {
            var machine = new Machine(machineName);

            if (operatingSystem == OperatingSystems.Unknown)
            {
                operatingSystem = GenericScanner.GetMachineOs(machineName, User, Password, SshKeyFileName);
            }
            var scanner = ScannerFactory.GetScanner(operatingSystem);

            scanner.Persistence = Persistence;
            scanner.SetKpis(kpis);
            Machines.Add(machine, scanner);
            Log.Debug("Machine {0} added to batch {1}", machineName, Name);
        }
예제 #31
0
        public async Task <IEnumerable <GuestOsInfo> > ListZoneInventoryAsync(
            ZoneLocator locator,
            OperatingSystems operatingSystems,
            CancellationToken token)
        {
            var instances = await this.computeEngineAdapter
                            .ListInstancesAsync(locator, token)
                            .ConfigureAwait(false);

            return(await ListInventoryAsync(
                       instances
                       .Where(i => IsRunningOperatingSystem(i, operatingSystems))
                       .Select(i => i.GetInstanceLocator()),
                       token)
                   .ConfigureAwait(false));
        }
예제 #32
0
        private static bool IsRunningOperatingSystem(
            Instance instance,
            OperatingSystems operatingSystems)
        {
            switch (operatingSystems)
            {
            case OperatingSystems.Windows:
                return(ComputeEngineAdapter.IsWindowsInstance(instance));

            case OperatingSystems.Linux:
                return(!ComputeEngineAdapter.IsWindowsInstance(instance));

            default:
                return(true);
            }
        }
        private bool CanRunOnThisOS(OperatingSystems excludedOperatingSystems)
        {
            if (excludedOperatingSystems == OperatingSystems.None)
            {
                return true;
            }

            switch (TestPlatformHelper.RuntimeEnvironment.OperatingSystem)
            {
                case "Windows":
                    var osVersion = new Version(TestPlatformHelper.RuntimeEnvironment.OperatingSystemVersion);

                    // The GetVersion API has a back compat feature: for apps that are not manifested
                    // and run on Windows 8.1, it returns version 6.2 rather than 6.3. See this:
                    // http://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx
                    if (osVersion.Major == 6)
                    {
                        if (osVersion.Minor == 1 &&
                            (excludedOperatingSystems.HasFlag(OperatingSystems.Win7) ||
                            excludedOperatingSystems.HasFlag(OperatingSystems.Win2008R2)))
                        {
                            return false;
                        }
                    }
                    break;
                case "Linux":
                    if (excludedOperatingSystems.HasFlag(OperatingSystems.Linux))
                    {
                        return false;
                    }
                    break;
                case "Darwin":
                    if (excludedOperatingSystems.HasFlag(OperatingSystems.MacOSX))
                    {
                        return false;
                    }
                    break;
            }

            return true;
        }
 public OSSkipConditionAttribute(OperatingSystems excludedOperatingSystems)
 {
     _excludedOS = excludedOperatingSystems;
 }