private static void CheckVersion() { if (SoftwareVersion.GerShortVersionNumeric(SoftwareVersion.Version) >= SoftwareVersion.GerShortVersionNumeric(SoftwareVersionUpdateController._receivedVersion)) { return; } }
private void LoadExtensions() { this.version = this.im.LoadExtension <SoftwareVersion>(); this.sdisco = this.im.LoadExtension <ServiceDiscovery>(); this.ecapa = this.im.LoadExtension <EntityCapabilities>(); this.ping = this.im.LoadExtension <S22.Xmpp.Extensions.Ping>(); this.attention = this.im.LoadExtension <Attention>(); this.time = this.im.LoadExtension <EntityTime>(); this.block = this.im.LoadExtension <BlockingCommand>(); this.pep = this.im.LoadExtension <Pep>(); this.userTune = this.im.LoadExtension <UserTune>(); this.userAvatar = this.im.LoadExtension <UserAvatar>(); this.userMood = this.im.LoadExtension <UserMood>(); this.dataForms = this.im.LoadExtension <DataForms>(); this.featureNegotiation = this.im.LoadExtension <FeatureNegotiation>(); this.streamInitiation = this.im.LoadExtension <StreamInitiation>(); this.siFileTransfer = this.im.LoadExtension <SIFileTransfer>(); this.inBandBytestreams = this.im.LoadExtension <InBandBytestreams>(); this.userActivity = this.im.LoadExtension <UserActivity>(); this.socks5Bytestreams = this.im.LoadExtension <Socks5Bytestreams>(); this.FileTransferSettings = new S22.Xmpp.Client.FileTransferSettings(this.socks5Bytestreams, this.siFileTransfer); this.serverIpCheck = this.im.LoadExtension <ServerIpCheck>(); this.inBandRegistration = this.im.LoadExtension <InBandRegistration>(); this.chatStateNotifications = this.im.LoadExtension <ChatStateNotifications>(); this.bitsOfBinary = this.im.LoadExtension <BitsOfBinary>(); }
/// <summary> </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { string localStatus = "FAILED"; ActivityStatus.Set(context, localStatus); string sSpatialRegistrationObjectType = ""; int nPatientID = 0; string sManfacturer = ""; string sModel = ""; string sSoftwareVersion = ""; string sModality = ""; string _dcmInstanceId = UnitId.Get(context); int nDcmInstanceId = Convert.ToInt32(_dcmInstanceId); context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this); try { _processSpatialRegistrationObject.RetrieveSpatialRegistrationDetails(nDcmInstanceId, ref nPatientID, ref sManfacturer, ref sModel, ref sSoftwareVersion, ref sModality, ref sSpatialRegistrationObjectType); if (nPatientID > 0) { localStatus = "SUCCESS"; } SpatialRegistrationObjectType.Set(context, sSpatialRegistrationObjectType); PatientID.Set(context, nPatientID); Manufacturer.Set(context, sManfacturer); Model.Set(context, sModel); SoftwareVersion.Set(context, sSoftwareVersion); Modality.Set(context, sModality); ActivityStatus.Set(context, localStatus); } catch (Exception e) { ActivityStatus.Set(context, localStatus); } }
public void onConnectionEstablished(DicePlus dpe) { if (dpe.Equals(currentlyConnectedDie)) { currentlyConnectedDie = null; } SoftwareVersion sv = dpe.getSoftwareVersion(); if ((sv.getMajor() > major) || (sv.getMajor() == major && sv.getMinor() >= minor)) { connectedDice.Add(dpe); if (connectedDice.Count >= maxDiceCount) { setState(State.CONNECTED); } else { setState(State.DISCONNECTED); } DicePlusAnimator.Instance.runConnectedAnimation(); dpe.subscribeRolls(); dpe.subscribeBatteryState(); dpe.registerListener(this); rssi = dpe.rssi; } else { setState(State.DISCONNECTED); DicePlusAnimator.Instance.runVersionMissmatchAnimation(false); dpe.disconnect(); } }
public SignboardDiagnostics(Guid signboardId, DateTime date, SoftwareVersion version) { SignboardId = signboardId; SoftwareVersion = version; Date = date; Metrics = new List<DiagnosticMetric>(); }
public static String GetDefaultConfigFileName(Type type) { SoftwareVersion version = new SoftwareVersion(Assembly.GetEntryAssembly().GetName().Version); String fileName = String.Format("{0}_{1}_{2}.config", type.Name, version.Major, version.Minor); return(PathUtil.GetPersonalConfigurationFilePath(fileName)); }
public static void Constructor_Succeeds([Values("", "343", "xxx999")] string revision) { const int major = 1; const int minor = 2; const int build = 3; var input = $"{major}.{minor}.{build}"; if (!string.IsNullOrWhiteSpace(revision)) { input += $".{revision}"; } Console.WriteLine($"Input: {input}"); var result = new SoftwareVersion(input); Console.WriteLine($"Output: {result}"); Assert.That(result, Is.Not.Null); Assert.That(result.Major, Is.EqualTo(major)); Assert.That(result.Minor, Is.EqualTo(minor)); Assert.That(result.Build, Is.EqualTo(build)); Assert.That(result.Revision, Is.EqualTo(revision)); Assert.That(result.ToString(), Is.EqualTo(input)); }
public bool ValidateConfiguration() { bool callsignValidity = Callsign.VerifyCallsign(); bool passwordValidity = Helpers.VerifyPassword(Callsign, Password); bool checkSoftwareName = SoftwareName.IndexOf(' ') > -1; bool checkSoftwareVersion = SoftwareVersion.IndexOf(' ') > -1; if (!callsignValidity) { Trace.TraceWarning($"{nameof(Callsign)} could not be validated, see http://www.aprs-is.net/Connecting.aspx for more information"); } if (!passwordValidity) { Trace.TraceWarning($"{nameof(Password)} is not valid for given callsign. Please request a valid password with the software vendor in case you need write access to the APRS server."); } if (Password == "-1") { Trace.TraceWarning("APRS client is in readonly mode. Request a valid password in case you need write access to the APRS server"); } if (!checkSoftwareName) { Trace.TraceWarning($"{nameof(SoftwareName)} contains a space.Spaces are illegal. Your mileage may vary now."); } if (!checkSoftwareVersion) { Trace.TraceWarning($"{nameof(SoftwareVersion)} contains a space. Spaces are illegal. Your mileage may vary now."); } return(callsignValidity && passwordValidity && checkSoftwareName && checkSoftwareVersion); }
public SoftwareVersion GetSoftwareVersionByNameOrInsert(string _name, int _terminalTypeId) { try { using (var context = new VeraEntities()) { var SoftwareVersion = context.SoftwareVersion.FirstOrDefault(x => x.VersionCode.Trim() == _name.Trim() && x.Status > 0 && x.TerminalTypeId == _terminalTypeId); if (SoftwareVersion == null) { SoftwareVersion = new SoftwareVersion() { VersionCode = _name.Trim(), Status = 1, TerminalTypeId = _terminalTypeId }; context.SoftwareVersion.Add(SoftwareVersion); context.SaveChanges(); return(SoftwareVersion); } return(SoftwareVersion); } } catch (Exception exc) { throw exc; } }
public SoftwareManager(IMvxJsonConverter jsonConverter) : base(jsonConverter) { CurrentVersion = new SoftwareVersion { Name = CurrentPackage.VersionName, Number = CurrentPackage.VersionCode }; }
public DiagnosticsTableEntity(Guid signboardId, DateTime date, SoftwareVersion version) { PartitionKey = signboardId.ToString(); RowKey = String.Format("{0:D19}", (DateTime.MaxValue - date.ToUniversalTime()).Ticks); Date = date; SignboardId = signboardId; Version = version.VersionNumber; }
/* ----------------------------------------------------------------- */ /// /// Info /// /// <summary> /// システム情報をログに出力します。 /// </summary> /// /// <param name="type">対象となるオブジェクトの型情報</param> /// <param name="assembly">アセンブリ情報</param> /// /* ----------------------------------------------------------------- */ public static void Info(Type type, Assembly assembly) { var asm = new AssemblyReader(assembly); var sv = new SoftwareVersion(assembly); Info(type, $"{asm.Product} {sv.ToString(true)}"); Info(type, $"{Environment.OSVersion}"); Info(type, $"Microsoft .NET Framework {Environment.Version}"); Info(type, $"{Environment.UserName}@{Environment.MachineName}"); }
public bool Parse(string src) { var dest = new SoftwareVersion(src); var cmp = new SoftwareVersion(src); Assert.That(dest, Is.EqualTo(cmp)); Assert.That(dest, Is.Not.EqualTo(src)); Assert.That(dest, Is.Not.EqualTo(default(SoftwareVersion))); Assert.That(dest.GetHashCode(), Is.EqualTo(cmp.GetHashCode())); return(dest.ToString() == src); }
public static SoftwareVersion GetSoftwareVersion(Object value) { SoftwareVersion ret; if (Convert.IsDBNull(value)) { ret = new SoftwareVersion(); } else { ret = new SoftwareVersion(value.ToString()); } return(ret); }
private void UpdateObject(SoftwareVersion _newSoftwareVersion, ref SoftwareVersion _oldSoftwareVersion) { try { foreach (PropertyInfo SoftwareVersionPropInfo in _newSoftwareVersion.GetType().GetProperties().ToList()) { _oldSoftwareVersion.GetType().GetProperty(SoftwareVersionPropInfo.Name).SetValue(_oldSoftwareVersion, _newSoftwareVersion.GetType().GetProperty(SoftwareVersionPropInfo.Name).GetValue(_newSoftwareVersion)); } } catch (Exception e) { Console.WriteLine(e); throw; } }
/* ----------------------------------------------------------------- */ /// /// Initialize /// /// <summary> /// オブジェクトを初期化します。 /// </summary> /// /* ----------------------------------------------------------------- */ private void Initialize(AssemblyReader reader, SettingsType type, string path) { Type = type; Path = path; Version = new SoftwareVersion(reader.Assembly); Company = reader.Company; Product = reader.Product; Value = new TValue(); Value.PropertyChanged += WhenChanged; _autosaver.AutoReset = false; _autosaver.Elapsed += WhenElapsed; _dispose = new OnceAction <bool>(Dispose); }
public SoftwareVersion AddNewSoftwareVersion(SoftwareVersion _SoftwareVersion) { try { using (var context = new VeraEntities()) { context.SoftwareVersion.Add(_SoftwareVersion); int numOfInserted = context.SaveChanges(); return(numOfInserted > 0 ? _SoftwareVersion : null); } } catch (Exception) { throw; } }
public async Task <bool> InsertAsync(SoftwareVersionViewModel viewModel) { var entity = new SoftwareVersion() { Id = viewModel.Id, Name = viewModel.Name, ReleaseNote = viewModel.ReleaseNote, Description = viewModel.Description, }; await _softwareVersions.AddAsync(entity); var result = await _unitOfWork.SaveChangesAsync(); return(result != 0); }
public void MinByReturnsFirstOccurrenceWhenThereAreMultipleObjectsWithSameMinValue() { var v1 = new SoftwareVersion(1, 2, 3, 2); var v2 = new SoftwareVersion(1, 2, 3, 2); var versions = new List <SoftwareVersion> { new SoftwareVersion(1, 2, 3, 4), v1, new SoftwareVersion(1, 2, 3, 40), v2, new SoftwareVersion(1, 2, 3, 400), new SoftwareVersion(1, 2, 3, 5) }; Assert.AreEqual(v1, versions.MinBy(v => v.InternalNumber)); }
/* --------------------------------------------------------------------- */ /// /// Version /// /// <summary> /// バージョン情報を表示します。 /// </summary> /// /* --------------------------------------------------------------------- */ public static void Version(Assembly assembly) { var sv = new SoftwareVersion(assembly) { Digit = 3 }; using (var dialog = new Cube.Forms.VersionForm { Version = sv.ToString(true), Image = Properties.Resources.Logo, Description = string.Empty, Height = 280, StartPosition = FormStartPosition.CenterParent, }) dialog.ShowDialog(); }
/// <summary> /// Create a sender node from this application's configuration /// </summary> /// <returns></returns> public static Sender CreateSenderUv(Uri receiveEndpoint, ISystemConfigurationService configService) { return(new Sender() { Telecom = receiveEndpoint == null ? new TEL() { NullFlavor = NullFlavor.NoInformation } : (TEL)receiveEndpoint.ToString(), Device = new Device() { Id = new SET <II>(new II(configService.DeviceIdentifier)), SoftwareName = SoftwareName.Product, Desc = SoftwareDescription.Description, ManufacturerModelName = SoftwareVersion.ToString() } }); }
public void GetString() { var src = typeof(SoftwareVersionTest).Assembly; var major = src.GetVersion().Major; var minor = src.GetVersion().Minor; var pf = src.GetPlatform(); var dest = new SoftwareVersion(src) { Digit = 2, Prefix = "begin-", Suffix = "-end" }; Assert.That(dest.Platform, Is.EqualTo(pf)); Assert.That(dest.ToString(true), Is.EqualTo($"begin-{major}.{minor}-end ({pf})")); Assert.That(dest.ToString(false), Is.EqualTo($"begin-{major}.{minor}-end")); Assert.That(dest.ToString(), Is.EqualTo(dest.ToString(false))); }
public override int GetHashCode() { unchecked { return(base.GetHashCode() + (Callsign.ToUpper().GetHashCode() * 3) + (VID.ToUpper().GetHashCode() * 3) + (Name.ToUpper().GetHashCode() * 3) + (ClientType.GetHashCode() * 3) + (GetItemHashCode(Location) * 3) + (Server.ToUpper().GetHashCode() * 3) + (Protocol.ToUpper().GetHashCode() * 3) + (ConnectionTime.GetHashCode() * 3) + (SoftwareName.ToUpper().GetHashCode() * 3) + (SoftwareVersion.ToUpper().GetHashCode() * 3) + (AdministrativeVersion.GetHashCode() * 3) + (ClientRating.GetHashCode() * 3) * 17); } }
public void ToString_Assembly() { var asm = AssemblyReader.Default; var major = asm.Version.Major; var minor = asm.Version.Minor; var arch = AssemblyReader.Platform; var version = new SoftwareVersion(asm.Assembly) { Digit = 2, Prefix = "begin-", Suffix = "-end" }; Assert.That(version.Platform, Is.EqualTo(arch)); Assert.That(version.ToString(true), Is.EqualTo($"begin-{major}.{minor}-end ({arch})")); Assert.That(version.ToString(false), Is.EqualTo($"begin-{major}.{minor}-end")); Assert.That(version.ToString(), Is.EqualTo(version.ToString(false))); }
public IActionResult Update(long id, [FromBody] SoftwareVersion softwareVersion) { var existingSoftwareVersion = _softwareVersionService.Get(id); Console.WriteLine("APK?" + softwareVersion.Apk); if (existingSoftwareVersion == null) { return(new NotFoundObjectResult(string.Format("No software version found for id: {0}", id))); } existingSoftwareVersion.Version = softwareVersion.Version; existingSoftwareVersion.Apk = softwareVersion.Apk; existingSoftwareVersion.IsDeleted = softwareVersion.IsDeleted; var updatedSoftwareVersion = _softwareVersionService.Update(existingSoftwareVersion); return(new OkObjectResult(updatedSoftwareVersion)); }
static Dictionary <SoftwareVersion, String> GetVersions(List <String> fileNames) { Dictionary <SoftwareVersion, String> values = new Dictionary <SoftwareVersion, String>(); foreach (String fileName in fileNames) { int index1 = Path.GetFileName(fileName).LastIndexOf('-'); int index2 = Path.GetFileName(fileName).LastIndexOf('.'); if (index1 > 0 && index2 > index1) { index1++; String versionString = Path.GetFileName(fileName).Substring(index1, index2 - index1); SoftwareVersion version = new SoftwareVersion(versionString); values.Add(version, fileName); } } return(values); }
public T Get <T>(SqlDBCredentials credentials, SoftwareVersion version = null) { T retVal = default(T); CredentialLookup lkp; if (_credentialLookup.TryGetValue(typeof(T), out lkp)) { if (version == null) { version = new SoftwareVersion(); } String key = credentials.ToParsableString() + ";DBVER=" + version.ToString(); if (lkp.ContainsKey(key)) { retVal = (T)lkp[key]; } } return(retVal); }
public Object GetByType(Type t, SqlDBCredentials credentials, SoftwareVersion version = null) { Object retVal = null; CredentialLookup lkp; if (_credentialLookup.TryGetValue(t, out lkp)) { if (version == null) { version = new SoftwareVersion(); } String key = credentials.ToParsableString() + ";DBVER=" + version.ToString(); if (lkp.ContainsKey(key)) { retVal = lkp[key]; } } return(retVal); }
public static DBResult GetDatabaseVersion(SqlDBCredentials credentials, out SoftwareVersion version, out InternalDatabaseType databaseType) { DBResult retVal = new DBResult(DBResult.Result.Success); try { _databaseVersionLock.Lock(); version = null; databaseType = InternalDatabaseType.Unknown; String indexKey = credentials.ToParsableString(); if (!_databaseVersionLookup.TryGetValue(indexKey, out version)) { ISqlDataSource ds = SqlConnectionPool.Instance(credentials).GetDataSource(); DatabaseDataReader reader; QueryString sql = ds.FormatTrusted("SELECT * FROM I.seq where name in ('{0}', '{1}')", KEY_DB_TYPE, KEY_SCHEMA_VER); retVal = ds.Query(sql, out reader); if (retVal.ResultCode == DBResult.Result.Success && reader.HasRows) { while (reader.Read()) { String key = DBUtil.GetString(reader[COL_KEY]); if (key == KEY_SCHEMA_VER) { version = DBUtil.GetSoftwareVersion(reader[COL_VALUE]); } else if (key == KEY_DB_TYPE) { databaseType = (InternalDatabaseType)DBUtil.GetInt32(reader[COL_VALUE]); } } _databaseVersionLookup.Add(indexKey, version); } } } finally { _databaseVersionLock.Unlock(); } return(retVal); }
public T Set <T>(SqlDBCredentials credentials, SoftwareVersion version, T obj) { CredentialLookup lkp; if (!_credentialLookup.TryGetValue(typeof(T), out lkp)) { lkp = new CredentialLookup(); _credentialLookup.Add(typeof(T), lkp); } String key = credentials.ToParsableString() + ";DBVER=" + version.ToString(); if (lkp.ContainsKey(key)) { lkp[key] = obj; } else { lkp.Add(key, obj); } return(obj); }
public void LogBanner(String extraString) { AssemblyTitleAttribute title = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyTitleAttribute>(); AssemblyDescriptionAttribute desc = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyDescriptionAttribute>(); AssemblyCompanyAttribute company = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyCompanyAttribute>(); AssemblyCopyrightAttribute copyright = Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyCopyrightAttribute>(); SoftwareVersion version = new SoftwareVersion(Assembly.GetEntryAssembly().GetName().Version); StringBuilder sb = new StringBuilder(); sb.AppendLine(String.Empty.PadRight(84, '*')); String nameString = $"{title.Title} {version} ({extraString})"; sb.AppendLine($"* {nameString,-80}*"); String authorString = $"{company.Company} {copyright.Copyright}"; sb.AppendLine($"* {desc.Description,-80}*"); sb.AppendLine(String.Empty.PadRight(84, '*')); String output = sb.ToString(); LogToDevices(LogLevel.ALWAYS, output); }
public DatabaseVersionAttribute(params Object[] versions) { NumericVersions = new List <UInt32>(); Versions = new List <SoftwareVersion>(); /** validate parameter count */ if (versions == null || versions.Length == 0) { throw new Exception("Invalid parameter to DatabaseVersion Attrbute"); } /** parse each parameter */ foreach (Object o in versions) { SoftwareVersion version = null; if (o is String) { /** parse textual versions */ if (SoftwareVersion.TryParse(o as String, out version) == false) { throw new Exception("Invalid version number in Version Attribute"); } } else if (o is int) { /** parse integral versions */ if (SoftwareVersion.TryParse(Convert.ToUInt32(o), out version) == false) { throw new Exception("Invalid version number in Version Attribute"); } } else { throw new Exception(String.Format("Unparsable data type {0} in Database Version Attribute", o.GetType())); } NumericVersions.Add(version.ToUInt32()); Versions.Add(version); } }
/// <summary> /// Initializes the various XMPP extension modules. /// </summary> private void LoadExtensions() { version = im.LoadExtension<SoftwareVersion>(); sdisco = im.LoadExtension<ServiceDiscovery>(); ecapa = im.LoadExtension<EntityCapabilities>(); ping = im.LoadExtension<Ping>(); attention = im.LoadExtension<Attention>(); time = im.LoadExtension<EntityTime>(); block = im.LoadExtension<BlockingCommand>(); pep = im.LoadExtension<Pep>(); userTune = im.LoadExtension<UserTune>(); #if WINDOWSPLATFORM userAvatar = im.LoadExtension<UserAvatar>(); #endif userMood = im.LoadExtension<UserMood>(); dataForms = im.LoadExtension<DataForms>(); featureNegotiation = im.LoadExtension<FeatureNegotiation>(); streamInitiation = im.LoadExtension<StreamInitiation>(); siFileTransfer = im.LoadExtension<SIFileTransfer>(); inBandBytestreams = im.LoadExtension<InBandBytestreams>(); userActivity = im.LoadExtension<UserActivity>(); socks5Bytestreams = im.LoadExtension<Socks5Bytestreams>(); FileTransferSettings = new FileTransferSettings(socks5Bytestreams, siFileTransfer); serverIpCheck = im.LoadExtension<ServerIpCheck>(); messageCarbons = im.LoadExtension<MessageCarbons>(); inBandRegistration = im.LoadExtension<InBandRegistration>(); chatStateNotifications = im.LoadExtension<ChatStateNotifications>(); bitsOfBinary = im.LoadExtension<BitsOfBinary>(); vcardAvatars = im.LoadExtension<VCardAvatars>(); cusiqextension = im.LoadExtension<CustomIqExtension>(); messageArchiving = im.LoadExtension<MessageArchiving>(); messageArchiveManagement = im.LoadExtension<MessageArchiveManagement>(); multiUserChat = im.LoadExtension<MultiUserChat>(); serviceAdministration = im.LoadExtension<ServiceAdministration>(); adHocCommands = im.LoadExtension<AdHocCommands>(); directMucInvitations = im.LoadExtension<DirectMucInvitations>(); }
/// <summary> /// Initializes the various XMPP extension modules. /// </summary> void LoadExtensions() { version = im.LoadExtension<SoftwareVersion>(); sdisco = im.LoadExtension<ServiceDiscovery>(); ecapa = im.LoadExtension<EntityCapabilities>(); ping = im.LoadExtension<Ping>(); attention = im.LoadExtension<Attention>(); time = im.LoadExtension<EntityTime>(); block = im.LoadExtension<BlockingCommand>(); pep = im.LoadExtension<Pep>(); userTune = im.LoadExtension<UserTune>(); userAvatar = im.LoadExtension<UserAvatar>(); userMood = im.LoadExtension<UserMood>(); dataForms = im.LoadExtension<DataForms>(); featureNegotiation = im.LoadExtension<FeatureNegotiation>(); streamInitiation = im.LoadExtension<StreamInitiation>(); siFileTransfer = im.LoadExtension<SIFileTransfer>(); inBandBytestreams = im.LoadExtension<InBandBytestreams>(); userActivity = im.LoadExtension<UserActivity>(); socks5Bytestreams = im.LoadExtension<Socks5Bytestreams>(); FileTransferSettings = new FileTransferSettings(socks5Bytestreams, siFileTransfer); serverIpCheck = im.LoadExtension<ServerIpCheck>(); inBandRegistration = im.LoadExtension<InBandRegistration>(); chatStateNotifications = im.LoadExtension<ChatStateNotifications>(); bitsOfBinary = im.LoadExtension<BitsOfBinary>(); }