Beispiel #1
0
        public ZionBlue(Versions version)
            : base()
        {
            System.Collections.Generic.List<string> hubAttr = Nodes["Hub"];

            switch (version)
            {
                case Versions.v2_01:
                case Versions.v2_02:
                    hubAttr.Add("UserPassword");
                    break;
                case Versions.v2_03:
                    break;
                case Versions.v2_04:
                    hubAttr.Add("ShowJoins");

                    hubAttr.Add("DescriptionFormat");
                    hubAttr.Add("CID");
                    hubAttr.Add("UserConnection");
                    hubAttr.Add("UserUpload");
                    hubAttr.Add("AwayMessage");
                    hubAttr.Add("UserEmail");
                    hubAttr.Add("NoShare");
                    hubAttr.Add("ClientEmulation");
                    break;
                case Versions.v2_05:
                    hubAttr.Add("AwayMsg");
                    hubAttr.Add("Email");
                    hubAttr.Add("ShowJoins");
                    break;
            }

            hubAttr.Remove("Bottom");
            hubAttr.Remove("Top");
            hubAttr.Remove("Right");
            hubAttr.Remove("Left");

            hubAttr.Add("WindowPosX");
            hubAttr.Add("WindowPosY");
            hubAttr.Add("WindowSizeX");
            hubAttr.Add("WindowSizeY");
            hubAttr.Add("WindowType");
            hubAttr.Add("ChatUserSplit");
            hubAttr.Add("UserListState");
            hubAttr.Add("HeaderOrder");
            hubAttr.Add("HeaderWidths");
            hubAttr.Add("HeaderVisible");

            hubAttr.Add("CheckOnConnect");
            hubAttr.Add("CheckClients");
            hubAttr.Add("CheckFilelists");
            hubAttr.Add("UseMyinfoDetect");
            hubAttr.Add("CheckFakeShare");
            hubAttr.Add("ExtendedCheck1");
            hubAttr.Add("ExtendedCheck2");
            hubAttr.Add("ExtendedCheck3");
            hubAttr.Add("CheckKey");
            hubAttr.Add("UserIp");
            hubAttr.Add("UserProtected");
        }
Beispiel #2
0
 public Decoded Decode(string input, Versions versions)
 {
     var buffer = DecodeAndCheck(input);
     // ReSharper disable once LoopCanBeConvertedToQuery
     for (var i = 0; i < versions.VersionsArray.Length; i++)
     {
         var versionName = versions.NamesArray[i];
         var version = versions.VersionsArray[i];
         var expectedPayloadLen = version.ExpectedLength;
         var expectedVerLen = version.VersionBytes.Length;
         var expectedTotLen = expectedPayloadLen + expectedVerLen;
         var payloadEnd = buffer.Length - 4;
         if (expectedTotLen == payloadEnd)
         {
             var actualVersion = CopyOfRange(buffer, 0, expectedVerLen);
             if (ArrayEquals(actualVersion, version.VersionBytes))
             {
                 var payload = CopyOfRange(buffer, actualVersion.Length, payloadEnd);
                 return new Decoded(version.VersionBytes, payload, versionName);
             }
         }
     }
     throw new EncodingFormatException("No version matched amongst " +
                         $"{string.Join(", ", versions.NamesArray)}");
 }
 public void Thumb()
 {
     var v = new Versions();
     var version = v.Images["thumb"];
     Assert.AreEqual(100, version.Width);
     Assert.AreEqual(0, version.Height);
     Assert.AreEqual(50, version.Format.Quality);
 }
 public void Large()
 {
     var v = new Versions();
     var version = v.Images["large"];
     Assert.AreEqual(1080, version.Width);
     Assert.AreEqual(0, version.Height);
     Assert.AreEqual(85, version.Format.Quality);
 }
Beispiel #5
0
        /// <summary>
        /// Returns a Version in the MSI/MSM Summary Information Version format
        /// </summary>
        /// <param name="version">The MSI version</param>
        /// <returns>A string representing the MSI/MSM Summary Information Version format</returns>
        /// <remarks>
        /// Example: Windows Installer version 4.5 is converted to '405'
        /// </remarks>
        public static string GetVersionInMSIFormat(Versions versions)
        {
            // Convert the version to the correct format
            Version version = MSIVersions.GetVersion(versions);
            int msiVersion = (version.Major * 100) + version.Minor;

            return Convert.ToString(msiVersion);
        }
 public void Medium()
 {
     var v = new Versions();
     var version = v.Images["medium"];
     Assert.AreEqual(640, version.Width);
     Assert.AreEqual(0, version.Height);
     Assert.AreEqual(70, version.Format.Quality);
 }
 public void Images()
 {
     var v = new Versions();
     Assert.IsNotNull(v.Images);
     Assert.AreEqual(3, v.Images.Keys.Count());
     Assert.IsNotNull(v.Images["thumb"]);
     Assert.IsNotNull(v.Images["medium"]);
     Assert.IsNotNull(v.Images["large"]);
 }
Beispiel #8
0
 public Assets(Versions.VersionJson ver, string urlDownloadBase = null, string urlResourceBase = null)
 {
     _ver = ver;
     _urlDownloadBase = urlDownloadBase ?? Resources.UrlReplacer.getDownloadUrl();
     _urlResourceBase = urlResourceBase ?? Resources.UrlReplacer.getResourceUrl();
     //Run();
     var thread = new Thread(Run);
     thread.Start();
 }
Beispiel #9
0
 private LaunchGameInfo(string MCPath, Login.IAuth auth, Versions.VersionJson ver, string java, int xmx, WindowSize size, ServerInfo info)
 {
     Auth = auth;
     Version = ver;
     JavaPath = java;
     JavaXmx = xmx;
     Size = size;
     Server = info;
     this.MCPath = MCPath;
 }
 public static IJsonLogSerializer CreateSerializer(Versions version)
 {
     switch (version)
     {
         case Versions.Version2F:
             return new TsdClient.JSONLogFormat.Version2F.JsonLogSerializer();
         default:
             throw new InvalidOperationException("Invalid Version");
     }
 }
        private bool TryGetInitialVersions(ConditionalWeakTable<ProjectId, Versions> initialVersionMap, Project project, string keyName, out Versions versions)
        {
            // if we already loaded this, return it.
            if (initialVersionMap.TryGetValue(project.Id, out versions))
            {
                return true;
            }

            // otherwise, load it
            return TryLoadInitialVersions(initialVersionMap, project, keyName, out versions);
        }
Beispiel #12
0
        public Apex(Versions version)
        {
            System.Collections.Generic.List<string> hubAttr = Nodes["Hub"];

            hubAttr.Remove("Bottom");
            hubAttr.Remove("Top");
            hubAttr.Remove("Right");
            hubAttr.Remove("Left");

            hubAttr.Add("HeaderOrder");
            hubAttr.Add("HeaderWidths");
            hubAttr.Add("HeaderVisible");
            hubAttr.Add("ChatUserSplit");
            hubAttr.Add("UserListState");

            hubAttr.Add("HideShare");
            hubAttr.Add("Mode");
            hubAttr.Add("IP");

            hubAttr.Add("StealthMode");
            hubAttr.Add("Email");
            hubAttr.Add("AwayMsg");
            hubAttr.Add("ExclChecks");
            hubAttr.Add("ShowJoins");

            switch (version)
            {
                case Versions.v0_40:
                    hubAttr.Add("Encoding");
                    hubAttr.Add("NoAdlSearch");
                    hubAttr.Add("LogChat");
                    hubAttr.Add("MiniTab");
                    hubAttr.Add("AutoOpenOpenChat");
                    hubAttr.Add("HubChats");
                    hubAttr.Add("ProtectedPrefixes");
                    break;
                case Versions.v1_00Beta5:
                    hubAttr.Add("OpChat");
                    hubAttr.Add("RawOne");
                    hubAttr.Add("RawTwo");
                    hubAttr.Add("RawThree");
                    hubAttr.Add("RawFour");
                    hubAttr.Add("RawFive");
                    hubAttr.Add("WindowPosX");
                    hubAttr.Add("WindowPosY");
                    hubAttr.Add("WindowSizeX");
                    hubAttr.Add("WindowSizeY");
                    hubAttr.Add("WindowType");
                    break;
            }
        }
        public ActionResult AddTag(Guid id, string name, string value)
        {
            var versions = new Versions();
            var version = versions.GetVersion(id);
            if (version.Tags.ContainsKey(name))
                throw new HttpException(406, "Tag name already exists");

            version.Tags.Add(name, value);
            versions.UpdateVersion(version);
            if (Request.IsAjaxRequest())
                return Json(null);
            else
                return RedirectToAction("EditTags", new { id = id });
        }
Beispiel #14
0
 /// <summary>
 /// Checks the specified version.
 /// </summary>
 /// <param name="__version">Version.</param>
 /// <returns></returns>
 public bool check(Versions __version)
 {
     //MessageBox.Show(">" + ((int)__version).ToString());
     __key = Registry.ClassesRoot.OpenSubKey("Photoshop.Image." + (int)__version);
     //MessageBox.Show(__key.Name);
     if (__key != null)
     {
         //MessageBox.Show(__key.Name);
         return true;
     }
     else
     {
         return false;
     }
 }
        public void Load(byte[] data, int start)
        {
            if (start + 0x22 > data.Length) throw new ArgumentOutOfRangeException("start");

            Name = new EncodedString5(data, start, 0x10);
            Version = (Versions)data[0x10 + start];
            Language = (Languages)data[0x11 + start];
            Country = data[0x12 + start];
            Region = data[0x13 + start];
            OT = BitConverter.ToUInt32(data, 0x14 + start);
            byte[] trendyPhrase = new byte[8];
            Array.Copy(data, 0x18 + start, trendyPhrase, 0, 8);
            PhraseLeader = new TrendyPhrase5(trendyPhrase);
            Gender = data[0x20 + start];
            Unknown = data[0x21 + start];
        }
Beispiel #16
0
 public PlaySetting(PlayNew parent, Versions.VersionJson mcver) : this() {
     this.parent = parent;
     mcversion = mcver;
     DataContext = mcversion;
     if (mcversion.errored)
     {
         tabAssets.Visibility = Visibility.Collapsed;
         tabLib.Visibility = Visibility.Collapsed;
         tabs.SelectedIndex = 2;
         butPlay.IsEnabled = false;
         butDLAssets.IsEnabled = false;
         gridMissInherit.Visibility = Visibility.Visible;
         if (mcversion.baseErrored)
             butDLtoFix.Visibility = Visibility.Collapsed;
     }
 }
        public C_CHECK_VERSION_CUSTOM(CustomReader reader)
        {
            var count  = reader.ReadUInt16();
            var offset = reader.ReadUInt16();

            for (var i = 1; i <= count; i++)
            {
                reader.BaseStream.Position = offset - 4;
                //var pointer = reader.ReadUInt16();
                reader.Skip(2);
                var nextOffset   = reader.ReadUInt16();
                var versionKey   = reader.ReadUInt32();
                var versionValue = reader.ReadUInt32();
                Versions.Add(versionKey, versionValue);
                offset = nextOffset;
            }
        }
Beispiel #18
0
 /// <summary>
 /// Constructor
 /// </summary>
 protected APIMappingBaseClass(params int[] Versions)
     : base()
 {
     ObjectType = typeof(ClassType);
     Name       = ObjectType.Name;
     Properties = new List <IAPIProperty>();
     SetCanDelete(x => true);
     SetCanGet(x => true);
     SetCanSave(x => true);
     SetAll(() => QueryProvider.All <ClassType>());
     SetAny(x => QueryProvider.Any <ClassType, IDType>(x.To(default(IDType))));
     SetDelete(x => { QueryProvider.Delete(x); return(true); });
     SetSave(x => { QueryProvider.Save <ClassType, IDType>(x); return(true); });
     SetPaged((x, y, z) => QueryProvider.Paged <ClassType>(x, y, z));
     SetPageCount(x => QueryProvider.PageCount <ClassType>(x));
     this.Versions = Versions.Check(x => x.Length > 0, new int[] { 1 }).ToList();
 }
Beispiel #19
0
        /// <summary>
        /// Gets the most recent version of two versions. This is used to determine if an entity should push up
        /// the map's minversion value. If either of the supplied versions is UnableToDetect, the method will
        /// return UnableToDetect as most recent version
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        private Versions GetMostRecentVersion(Versions a, Versions b)
        {
            //if either version is marked as UnableToDetect, return this version value
            if (a == Versions.UnableToDetect || b == Versions.UnableToDetect)
            {
                return(Versions.UnableToDetect);
            }

            if ((int)a > (int)b)
            {
                return(a);
            }
            else
            {
                return(b);
            }
        }
Beispiel #20
0
        internal C_CHECK_VERSION(TeraMessageReader reader) : base(reader)
        {
            var count  = reader.ReadUInt16();
            var offset = reader.ReadUInt16();

            for (var i = 1; i <= count; i++)
            {
                reader.BaseStream.Position = offset - 4;
                var pointer = reader.ReadUInt16();
                Debug.Assert(pointer == offset);//should be the same
                var nextOffset   = reader.ReadUInt16();
                var VersionKey   = reader.ReadUInt32();
                var VersionValue = reader.ReadUInt32();
                Versions.Add(VersionKey, VersionValue);
                offset = nextOffset;
            }
        }
Beispiel #21
0
        /// <summary>
        /// Checks to see if we're loading an XML document from an old version of the application.
        /// This is used by the collections for editors, regions, screens, tags, screenshots, triggers, and settings.
        /// </summary>
        /// <param name="appCodenameToCheck">The codename of the application to check.</param>
        /// <param name="appVersionToCheck">The version of the application to check.</param>
        /// <returns>True if we're handling a file from an old version. False if it's the current version or we don't know what version it is.</returns>
        public bool IsOldAppVersion(string appCodenameToCheck, string appVersionToCheck)
        {
            if (string.IsNullOrEmpty(appCodenameToCheck) && string.IsNullOrEmpty(appVersionToCheck))
            {
                // This is likely to be version 2.1 "Clara" before the concept of an "app:version"
                // or the management of application versions even existed in Auto Screen Capture.
                appCodenameToCheck = "Clara";
                appVersionToCheck  = "2.1.8.2";
            }

            if (!string.IsNullOrEmpty(appCodenameToCheck) && !string.IsNullOrEmpty(appVersionToCheck))
            {
                Version versionInConfig = Versions.Get(appCodenameToCheck, appVersionToCheck);
                Version versionHere     = Versions.Get(Settings.ApplicationCodename, Settings.ApplicationVersion);

                // All of these were a mistake. They should never have had their revision numbers go beyond 9.
                // So if we find any of these versions then treat them as old versions of the application.
                if (versionInConfig != null &&
                    (versionInConfig.VersionString.Equals("2.2.0.10") ||
                     versionInConfig.VersionString.Equals("2.2.0.11") ||
                     versionInConfig.VersionString.Equals("2.2.0.12") ||
                     versionInConfig.VersionString.Equals("2.2.0.13") ||
                     versionInConfig.VersionString.Equals("2.2.0.14") ||
                     versionInConfig.VersionString.Equals("2.2.0.15") ||
                     versionInConfig.VersionString.Equals("2.2.0.16") ||
                     versionInConfig.VersionString.Equals("2.2.0.17") ||
                     versionInConfig.VersionString.Equals("2.2.0.18") ||
                     versionInConfig.VersionString.Equals("2.2.0.19") ||
                     versionInConfig.VersionString.Equals("2.2.0.20") ||
                     versionInConfig.VersionString.Equals("2.2.0.21") ||
                     versionInConfig.VersionString.Equals("2.2.0.22")))
                {
                    return(true);
                }

                // Compare the version number in the config file with the version number of this version.
                // It's a basic numerical comparison so 2203 is going to be less than 2224.
                if (versionInConfig != null && (versionInConfig.VersionNumber < versionHere.VersionNumber))
                {
                    return(true);
                }
            }

            // If we're not sure then just say it isn't an old app version to prevent screwing up data.
            return(false);
        }
Beispiel #22
0
        public PackageVersion GetVersion(object inputVersion)
        {
            var version = (inputVersion ?? "").ToString().Trim().ToLowerInvariant();
            var v       = Versions.FirstOrDefault(x => x.VersionString == version);

            if (v == null)
            {
                v = Versions.LastOrDefault();
            }
            if (v == null)
            {
                v = new PackageVersion {
                    VersionString = version.Length > 0 ? version : "0",
                };
            }
            return(v);
        }
        public bool Equals(DestinyItemQualityBlockDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     ItemLevels == input.ItemLevels ||
                     (ItemLevels != null && ItemLevels.SequenceEqual(input.ItemLevels))
                     ) &&
                 (
                     QualityLevel == input.QualityLevel ||
                     (QualityLevel.Equals(input.QualityLevel))
                 ) &&
                 (
                     InfusionCategoryName == input.InfusionCategoryName ||
                     (InfusionCategoryName != null && InfusionCategoryName.Equals(input.InfusionCategoryName))
                 ) &&
                 (
                     InfusionCategoryHash == input.InfusionCategoryHash ||
                     (InfusionCategoryHash.Equals(input.InfusionCategoryHash))
                 ) &&
                 (
                     InfusionCategoryHashes == input.InfusionCategoryHashes ||
                     (InfusionCategoryHashes != null && InfusionCategoryHashes.SequenceEqual(input.InfusionCategoryHashes))
                 ) &&
                 (
                     ProgressionLevelRequirementHash == input.ProgressionLevelRequirementHash ||
                     (ProgressionLevelRequirementHash.Equals(input.ProgressionLevelRequirementHash))
                 ) &&
                 (
                     CurrentVersion == input.CurrentVersion ||
                     (CurrentVersion.Equals(input.CurrentVersion))
                 ) &&
                 (
                     Versions == input.Versions ||
                     (Versions != null && Versions.SequenceEqual(input.Versions))
                 ) &&
                 (
                     DisplayVersionWatermarkIcons == input.DisplayVersionWatermarkIcons ||
                     (DisplayVersionWatermarkIcons != null && DisplayVersionWatermarkIcons.SequenceEqual(input.DisplayVersionWatermarkIcons))
                 ));
        }
Beispiel #24
0
        public void LoadFrom(IEnumerable <IItemVersion> versions, IFieldFormatter[] fieldFormatters)
        {
            bool first = true;

            foreach (var version in versions)
            {
                if (first)
                {
                    Language = version.Language.Name;
                    first    = false;
                }

                var versionObject = new YamlVersion();
                versionObject.LoadFrom(version, fieldFormatters);

                Versions.Add(versionObject);
            }
        }
        public ActionResult ConfirmDelete(Guid id)
        {
            var versions = new Versions();
            var apps = new Apps();
            var groups = new Groups();

            var version = versions.GetVersion(id);
            var app = apps.GetApp(version.AppKey);
            var group = groups.GetGroup(app.GroupKey);

            var model = new VersionDetails()
            {
                Version = version,
                App = app,
                Group = group,
            };
            return View(model);
        }
        public BattleTowerProfile4(EncodedString4 name, Versions version, 
            Languages language, byte country, byte region, uint ot,
            TrendyPhrase4 phrase_leader, byte gender, byte unknown)
        {
            if (name == null) throw new ArgumentNullException("name");
            if (name.Size != 16) throw new ArgumentException("name");
            if (phrase_leader == null) throw new ArgumentNullException("phrase_leader");

            Name = name; // todo: clone
            Version = version;
            Language = language;
            Country = country;
            Region = region;
            OT = ot;
            PhraseLeader = phrase_leader; // todo: clone
            Gender = gender;
            Unknown = unknown;
        }
Beispiel #27
0
        public static HtmlBuilder VerUpCheckBox(
            this HtmlBuilder hb, Context context, SiteSettings ss, BaseModel baseModel)
        {
            var mustVerUp = Versions.MustVerUp(context: context, baseModel: baseModel);

            return
                (baseModel.VerType == Versions.VerTypes.Latest &&
                 baseModel.MethodType != BaseModel.MethodTypes.New
                    ? hb.FieldCheckBox(
                     controlId: "VerUp",
                     labelText: Displays.VerUp(),
                     _checked: mustVerUp,
                     disabled: mustVerUp,
                     fieldCss: " w400 both",
                     controlCss: " always-send",
                     labelPositionIsRight: true)
                    : hb);
        }
Beispiel #28
0
 /// <summary>
 /// Returns a Version object representing the MSI version selected
 /// </summary>
 /// <param name="versions">The MSI version</param>
 /// <returns>A Version object</returns>
 public static Version GetVersion(Versions versions)
 {
     switch (versions)
     {
         case Versions.MSI20:
             return new Version("2.0");
         case Versions.MSI30:
             return new Version("3.0");
         case Versions.MSI31:
             return new Version("3.1");
         case Versions.MSI45:
             return new Version("4.5");
         case Versions.MSI50:
             return new Version("5.0");
         default:
             throw new ArgumentException(String.Format("{0} is an invalid value for this method", versions.ToString()));
     }
 }
Beispiel #29
0
        public T Get <T>(object id, Type concreteType, TextReader json, Guid?version)
        {
            var cacheValue = Cache[typeof(T)].GetOrAdd(id, _ =>
            {
                if (version.HasValue)
                {
                    Versions.Store <T>(id, version.Value);
                }

                var document = Serializer.FromJson(concreteType, json);

                _listeners.Each(listener => listener.DocumentLoaded(id, document));

                return(ToCache(id, concreteType, document, json));
            });

            return(FromCache <T>(cacheValue));
        }
        public async Task <IActionResult> OnPostAddVersion()
        {
            SelectedVersionDetails = new PluginVersion
            {
                VersionNumber   = string.Empty,
                IsPrivatePlugin = true,
                IsNewVersion    = true,
                Id = Guid.NewGuid().ToString()
            };
            SelectedVersionDetails.SetSupportedProducts();

            Versions.Add(SelectedVersionDetails);
            SetSelectedProducts(Versions, "New plugin version");

            ModelState.Clear();

            return(Partial("_PluginVersionDetailsPartial", SelectedVersionDetails));
        }
                static IObservable <AppBinary?> UpdateAppData(ContinueData <PushVersionCommand> m)
                {
                    var(commit, fileName) = ((string, ITempFile))m.Result.Outcome !;
                    return(Observable.Using(() => fileName,
                                            file =>
                                            (
                                                from info in Observable.Return((Commit: commit, File: file, Data: m))
                                                let oldApp = info.Data.AppData ?? AppData.Empty
                                                             let newVersion = oldApp.Last + 1
                                                                              let newId = $"{oldApp.Id}-{newVersion}.zip"
                                                                                          let newBinary = new AppFileInfo(newId, oldApp.Last + 1, DateTime.UtcNow, false, info.Commit)
                                                                                                          let newData = oldApp with
                    {
                        Last = newVersion,
                        LastUpdate = DateTime.UtcNow,
                        Versions = info.Data.AppData !.Versions.Add(newBinary)
                    }
                                                select(info.Data.State, NewData: newData, NewBinary: newBinary, info.File,
                                                       ToDelete: newData.Versions.OrderByDescending(i => i.CreationTime).Skip(5)
                                                       .Where(i => !i.Deleted).ToArray())
                                            )
                                            .Select(i =>
                    {
                        using var stream = i.State.Files.GetFile(i.NewBinary.Id).Create();
                        using var fileStream = i.File.Stream;

                        fileStream.Seek(0, SeekOrigin.Begin);
                        fileStream.CopyTo(stream);

                        var newData = i.ToDelete
                                      .Aggregate(i.NewData,
                                                 (current, appFileInfo) => current !with
                        {
                            Versions = current.Versions
                                       .Replace(appFileInfo, appFileInfo with
                            {
                                Deleted = true
                            })
                        });

                        i.State.Apps.Update(newData !);
                        i.State.ToDelete.Add(i.ToDelete.Select(e => new ToDeleteRevision(e.Id)));
                        return (Data: newData, i.NewBinary, i.State);
                    })
Beispiel #32
0
        private Reachability Change(UniqueAddress observer, UniqueAddress subject, ReachabilityStatus status)
        {
            var v               = NextVersion(observer);
            var newVersions     = Versions.SetItem(observer, v);
            var newRecord       = new Record(observer, subject, status, v);
            var oldObserverRows = ObserverRows(observer);

            // don't record Reachable observation if nothing has been noted so far
            if (oldObserverRows == null && status == ReachabilityStatus.Reachable)
            {
                return(this);
            }

            // otherwise, create new instance including this first observation
            if (oldObserverRows == null)
            {
                return(new Reachability(Records.Add(newRecord), newVersions));
            }

            if (!oldObserverRows.TryGetValue(subject, out var oldRecord))
            {
                if (status == ReachabilityStatus.Reachable &&
                    oldObserverRows.Values.All(r => r.Status == ReachabilityStatus.Reachable))
                {
                    return(new Reachability(Records.FindAll(r => !r.Observer.Equals(observer)), newVersions));
                }
                return(new Reachability(Records.Add(newRecord), newVersions));
            }

            if (oldRecord.Status == ReachabilityStatus.Terminated || oldRecord.Status == status)
            {
                return(this);
            }

            if (status == ReachabilityStatus.Reachable &&
                oldObserverRows.Values.All(r => r.Status == ReachabilityStatus.Reachable || r.Subject.Equals(subject)))
            {
                return(new Reachability(Records.FindAll(r => !r.Observer.Equals(observer)), newVersions));
            }

            var newRecords = Records.SetItem(Records.IndexOf(oldRecord), newRecord);

            return(new Reachability(newRecords, newVersions));
        }
Beispiel #33
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         if (InterfaceUri != null)
         {
             result = (result * 397) ^ InterfaceUri.GetHashCode();
         }
         result = (result * 397) ^ (int)OS;
         if (Versions != null)
         {
             result = (result * 397) ^ Versions.GetHashCode();
         }
         result = (result * 397) ^ Constraints.GetUnsequencedHashCode();
         result = (result * 397) ^ Distributions.GetUnsequencedHashCode();
         return(result);
     }
 }
Beispiel #34
0
        public Request(IEnumerable <string> validMethods = null,
                       IEnumerable <string> validVersion = null) : this()
        {
            if (validMethods != null)
            {
                foreach (var item in validMethods)
                {
                    Methods.Add(item);
                }
            }

            if (validVersion != null)
            {
                foreach (var item in validVersion)
                {
                    Versions.Add(item);
                }
            }
        }
Beispiel #35
0
        public static async Task InitializeAsync(string localDirectoryPath)
        {
            Logger.WriteLine("Initializing Minecraft API.");

            LocalDirectory = localDirectoryPath ?? throw new ArgumentNullException(nameof(localDirectoryPath));

            foreach (var version in await DownloadNewVersionsAsync())
            {
                Versions.Add(version);
            }

            Logger.WriteLine("Saving versions.");
            await SaveVersionsToFirebaseStorage();

            SaveVersionsToFileAsync(LocalVersionsFilePath);

            Updated = DateTime.Now;
            Logger.WriteLine("Minecraft API was successfully initialized.");
        }
        protected void Initialize()
        {
            Settings s = SettingsManager.Load();

            if (!Directory.Exists(s.WargamePath))
            {
                return;
            }

            string dataPath = Path.Combine(s.WargamePath, "Data", "wargame", "PC");

            if (!Directory.Exists(dataPath))
            {
                return;
            }

            var dataDir = new DirectoryInfo(dataPath);

            foreach (DirectoryInfo dir in dataDir.EnumerateDirectories())
            {
                var v = new VersionInfoViewModel(dir, this);
                Versions.Add(v);
                VersionNumbers.Add(v.Version);
            }

            foreach (var version in Versions)
            {
                foreach (var directory in version.DirectoryInfo.EnumerateDirectories())
                {
                    var v = Versions.SingleOrDefault(x => x.Version == Convert.ToInt32(directory.Name));

                    if (v != null)
                    {
                        foreach (var fl in directory.EnumerateFiles())
                        {
                            v.VersionFiles.Add(new VersionFileViewModel(fl));
                        }
                    }
                }
            }

            VersionFilter = Versions.OrderByDescending(x => x.Version).First().Version;
        }
Beispiel #37
0
        /// <summary>
        /// Links MainWindow with this class using events
        /// </summary>
        public void InitUI()
        {
            Log.Info("Initializing user interface...");
            this.Window.Closing += OnWindowClosing;
            this.Window.ProfileList.SelectionChanged += OnSelectionChange;
            this.Window.AboutButton.Click            += ShowAboutPopup;
            this.Window.SettingsButton.Click         += OpenSettingsPopup;
            this.Window.CreateButton.Click           += CreateNewProfile;
            this.Window.EditButton.Click             += EditSelectedProfile;
            this.Window.FolderButton.Click           += OpenProfileFolder;
            this.Window.DeleteButton.Click           += DeleteSelectedProfile;
            this.Window.PlayButton.Click             += PressPlay;
            this.Window.PlayOnlineButton.Click       += PressPlay;
            this.UiManager              = new UIManager(this.Window);
            this.UiManager.WindowTitle += " " + Version + " " + Versions.GetVersionType(Version);

            this.CurrentThread = new Thread(InitLauncher);
            this.CurrentThread.Start();
        }
        private void Dg_version_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                HelpClass.StartAwait(grid_main);
                //selection

                if (dg_version.SelectedIndex != -1)
                {
                    version          = dg_version.SelectedItem as Versions;
                    this.DataContext = version;

                    if (version != null)
                    {
                        #region delete
                        if (version.canDelete)
                        {
                            btn_delete.Content = MainWindow.resourcemanager.GetString("trDelete");
                        }
                        else
                        {
                            if (version.isActive == 0)
                            {
                                btn_delete.Content = MainWindow.resourcemanager.GetString("trActive");
                            }
                            else
                            {
                                btn_delete.Content = MainWindow.resourcemanager.GetString("trInActive");
                            }
                        }
                        #endregion
                    }
                }

                clearValidate();
                HelpClass.EndAwait(grid_main);
            }
            catch (Exception ex)
            {
                HelpClass.EndAwait(grid_main);
                HelpClass.ExceptionMessage(ex, this);
            }
        }
        private async void Btn_add_Click(object sender, RoutedEventArgs e)
        {//add
            try
            {
                HelpClass.StartAwait(grid_main);
                version = new Versions();
                if (validate())
                {
                    tb_code.Text = await version.generateCodeNumber((int)cb_program.SelectedValue);

                    version.versionscode = tb_code.Text;
                    //version.versionscode = "vr-0000009";
                    version.name         = tb_name.Text;
                    version.programId    = (int)cb_program.SelectedValue;
                    version.details      = tb_details.Text;
                    version.notes        = tb_notes.Text;
                    version.isActive     = 1;
                    version.createUserId = MainWindow.userLogin.userId;
                    version.updateUserId = MainWindow.userLogin.userId;

                    int s = await version.Save(version);

                    if (s <= 0)
                    {
                        Toaster.ShowWarning(Window.GetWindow(this), message: MainWindow.resourcemanager.GetString("trPopError"), animation: ToasterAnimation.FadeIn);
                    }
                    else
                    {
                        Toaster.ShowSuccess(Window.GetWindow(this), message: MainWindow.resourcemanager.GetString("trPopAdd"), animation: ToasterAnimation.FadeIn);
                        Clear();
                        await RefreshVersionsList();
                        await Search();
                    }
                }

                HelpClass.EndAwait(grid_main);
            }
            catch (Exception ex)
            {
                HelpClass.EndAwait(grid_main);
                HelpClass.ExceptionMessage(ex, this);
            }
        }
Beispiel #40
0
        protected override object[] GetChildren()
        {
            var menus = new List <object>()
            {
                new Directory("Agent Pools", "Pool", this.PowerShell),
                new Directory("Extensions", "Extension", this.PowerShell),
                new Directory("Feeds", "Feed", this.PowerShell)
            };

            if (Versions.TestGraphSupport())
            {
                menus.Add(new Permissions("Permissions", this.PowerShell));
            }

            // This will add any projects
            menus.AddRange(base.GetChildren());

            return(menus.ToArray());
        }
Beispiel #41
0
        public Launcher(MainWindow window)
        {
            Instance    = this;
            this.Window = window;

            this.LoadSettings();

            if (this.Settings.UseLogFile)
            {
                Log.SetLogFile(Path.Combine(UserDirPath, "latest.log"));
            }
            Log.Info("GTA V Modding Launcher " + Version);
            Log.Info("Using PursuitLib " + Versions.GetTypeVersion(typeof(Log)));

            Log.Info("Loading languages...");
            I18n.SupportedLanguages.Add("en-US");
            I18n.SupportedLanguages.Add("fr-FR");
            I18n.LoadLanguage(this.Settings.Language);
        }
Beispiel #42
0
        public void Load(byte[] data, int start)
        {
            if (start + 0x22 > data.Length)
            {
                throw new ArgumentOutOfRangeException("start");
            }

            Name     = new EncodedString4(data, start, 0x10);
            Version  = (Versions)data[0x10 + start];
            Language = (Languages)data[0x11 + start];
            Country  = data[0x12 + start];
            Region   = data[0x13 + start];
            OT       = BitConverter.ToUInt32(data, 0x14 + start);
            byte[] trendyPhrase = new byte[8];
            Array.Copy(data, 0x18 + start, trendyPhrase, 0, 8);
            PhraseLeader = new TrendyPhrase4(trendyPhrase);
            Gender       = data[0x20 + start];
            Unknown      = data[0x21 + start];
        }
        static void Init(DotNetCorePath path)
        {
            IsInstalled = !path.IsMissing;
            FileName    = path.FileName;

            Versions = DotNetCoreRuntimeVersions.GetInstalledVersions(path)
                       .OrderByDescending(version => version)
                       .ToArray();

            // If there are no runtimes then do not consider the runtime to be installed.
            if (!Versions.Any())
            {
                IsInstalled = false;
            }

            // Used by the DotNetMSBuildSdkResolver to find the .NET Core SDK.
            // Not sure this is needed - seems to work without it.
            Environment.SetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR", path.ParentDirectory);
        }
Beispiel #44
0
        public override int GetHashCode()
        {
            int hash = 1;

            hash ^= node_.GetHashCode();
            if (versions_ != null)
            {
                hash ^= Versions.GetHashCode();
            }
            if (Version != 0)
            {
                hash ^= Version.GetHashCode();
            }
            if (library_ != null)
            {
                hash ^= Library.GetHashCode();
            }
            return(hash);
        }
Beispiel #45
0
        private void SetVersionList()
        {
            var editedVersion = Versions.FirstOrDefault(v => v.Id.Equals(SelectedVersionDetails.Id));

            if (editedVersion != null)
            {
                Versions[Versions.IndexOf(editedVersion)] = SelectedVersionDetails;
            }
            else if (SelectedVersionDetails?.SelectedProduct != null)
            {
                var selectedProduct = SelectedVersionDetails.SupportedProducts.FirstOrDefault(item => item.Id == SelectedVersionDetails.SelectedProductId);
                SelectedVersionDetails.SupportedProducts = new List <SupportedProductDetails> {
                    selectedProduct
                };
                Versions.Add(SelectedVersionDetails);
            }

            PrivatePlugin.Versions = Versions;
        }
Beispiel #46
0
 protected void ProductSelected(BChangeEventArgs <BSelectOptionBase <int?> > arg)
 {
     Components.Clear();
     table.MarkAsRequireRender();
     RequireRender = true;
     if (arg.NewValue.Value.HasValue)
     {
         productId       = arg.NewValue.Value.Value;
         productVersions = ProductService.GetProductVersions(arg.NewValue.Value.Value);
         Versions        = productVersions.ToDictionary(x => x.Id, x => x.Version);
     }
     else
     {
         EmptyMessage = "请选择产品及版本后查询";
         productId    = 0;
         productVersions.Clear();
         Versions.Clear();
     }
 }
Beispiel #47
0
        /// <summary>
        /// Select the version of Visual Studio for conversion
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lbVersion_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            double v      = 0;
            int    ending = 0;

            // chop off any previous ending of the message
            ending         = lbMessage.Text.IndexOf("solution");
            lbMessage.Text = lbMessage.Text.Substring(0, ending + 8);

            v = double.Parse(lbVersion.SelectedItem.ToString().Substring(21, 3), System.Globalization.CultureInfo.GetCultureInfo("en-US"));
            //INSTANT C# NOTE: The following VB 'Select Case' included either a non-ordinal switch expression or non-ordinal, range-type, or non-constant 'Case' expressions and was converted to C# 'if-else' logic:
            //			Select Case v
            //ORIGINAL LINE: Case 8.0
            if (v == 8.0)
            {
                ConvertTo       = Versions.Version8;
                lbMessage.Text += " to VS2005 (v8.0)";
            }
            //ORIGINAL LINE: Case 9.0
            else if (v == 9.0)
            {
                ConvertTo       = Versions.Version9;
                lbMessage.Text += " to VS2008 (v9.0)";
            }
            //ORIGINAL LINE: Case 10.0
            else if (v == 10.0)
            {
                ConvertTo       = Versions.Version10;
                lbMessage.Text += " to VS2010 (v10.0)";
            }
            else if (v == 11.0)
            {
                ConvertTo       = Versions.Version11;
                lbMessage.Text += " to VS2012 (v11.0)";
            }
            //ORIGINAL LINE: Case Else
            else
            {
                // not likely
                MessageBox.Show("Not a valid choice", "Internal Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #48
0
        public Application CreateApplicationForOrganization(int organizationId, string versionNumber)
        {
            var application = new Application
            {
                Name     = Name,
                VendorId = VendorId,
                CreatedFromCommonApplicationId = Id,
                OrganizationId = organizationId
            };

            var selectedVersion = Versions.FirstOrDefault(v => v.VersionNumber == versionNumber);

            if (selectedVersion != null)
            {
                application.Version = versionNumber;
                foreach (var component in selectedVersion.SupportedNationalComponents)
                {
                    application.ApplicationNationalComponent.Add(new ApplicationNationalComponent
                    {
                        NationalComponentId = component.NationalComponentId
                    });
                }
            }

            foreach (var dataset in CommonDatasets)
            {
                application.ApplicationDatasets.Add(new ApplicationDataset
                {
                    Dataset = new Dataset
                    {
                        Name                     = dataset.Name,
                        Description              = dataset.Description,
                        Purpose                  = dataset.Purpose,
                        HasPersonalData          = dataset.HasPersonalData,
                        HasSensitivePersonalData = dataset.HasSensitivePersonalData,
                        HasMasterData            = dataset.HasMasterData,
                        OrganizationId           = organizationId
                    }
                });
            }
            return(application);
        }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Features              = new Features(this);
     Examples              = new Examples(this);
     Model                 = new Model(this);
     Apps                  = new Apps(this);
     Versions              = new Versions(this);
     Train                 = new Train(this);
     User                  = new User(this);
     Permissions           = new Permissions(this);
     BaseUri               = "https://{AzureRegion}.api.cognitive.microsoft.com/luis/api/v2.0";
     SerializationSettings = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new  List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ModelInfo>("readableType"));
     DeserializationSettings.Converters.Add(new  PolymorphicDeserializeJsonConverter <ModelInfo>("readableType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ModelInfoResponse>("readableType"));
     DeserializationSettings.Converters.Add(new  PolymorphicDeserializeJsonConverter <ModelInfoResponse>("readableType"));
     CustomInitialize();
 }
		public void file_patch()
		{
			// arrange
			var version = new Version(1, 2, 3, 4, "alpha");
			var fileVersion = new Version(3, 4, 5, 6, "beta");
			var infoVersion = new Version(5, 6, 7, 8, "delta");
			var versions = new Versions(version, fileVersion, infoVersion);
			var configuration = new VersionConfiguration(true, true, true, false, true, false);
			var versionConfigurationApplicator = new VersionConfigurationApplicator(versions, configuration);

			// act
			var cleanedVersion = versionConfigurationApplicator.Version;
			var cleanedFileVersion = versionConfigurationApplicator.FileVersion;
			var cleanedInfoVersion = versionConfigurationApplicator.InfoVersion;

			// assert
			Assert.Equal("1.2.0.0-alpha", cleanedVersion);
			Assert.Equal("3.4.5.6-beta", cleanedFileVersion);
			Assert.Equal("5.6.0.0-delta", cleanedInfoVersion);
		}
Beispiel #51
0
        public static void Run(string[] args)
        {
            string comment;
            string directoryPath;
            Guid appKey;
            ControllerConfiguration context;

            ParseArguments(args, out comment, out directoryPath, out appKey, out context);

            var versionsController = new Versions(context);
            var appsController = new Apps(context);
            var revision = appsController.PushAppRevision(appKey);
            var newVersion = new Version()
            {
                VersionNumber = revision,
                Comment = comment,
                AppKey = appKey,
            };
            versionsController.PushVersion(new DirectoryInfo(directoryPath), newVersion.Key);
            versionsController.CreateVersion(newVersion);
        }
        public ActionResult Version(Guid tid, Guid aid)
        {
            var targetAppVersions = new TargetAppVersions();
            var versions = new Versions();
            var apps = new Apps();
            var targets = new Targets();
            var groups = new Groups();

            Version version;
            var versionKey = targetAppVersions.GetTargetAppVersion(tid, aid);
            if (versionKey.HasValue)
            {
                try
                {
                    version = versions.GetVersion(versionKey.Value);
                }
                catch (Exception)
                {
                    version = null;
                }
            }
            else
            {
                version = null;
            }

            var app = apps.GetApp(aid);
            var target = targets.GetTarget(tid);
            var group = groups.GetGroup(target.GroupKey);

            var model = new TargetAppVersionDetails()
            {
                Version = version,
                App = app,
                Target = target,
                Group = group,
            };
            return View(model);
        }
Beispiel #53
0
		public static string Versions(Versions v)
		{
			string result = "unknown";

			switch (v) {
				case Utilities.Versions.FreshInstall:
					result = "Fresh Install";
                    break;
				case Utilities.Versions.NotSet:
					result = "Not Set";
                    break;
				case Utilities.Versions.SP1:
					result = "SP1";
                    break;
				case Utilities.Versions.SP2:
					result = "SP2";
                    break;
				case Utilities.Versions.SP3:
                    result = "SP3"; 
                    break;
				case Utilities.Versions.SP31:
					result = "SP3.1";
                    break;
				case Utilities.Versions.SP32:
					result = "SP3.2";
                    break;
				case Utilities.Versions.SP4:
					result = "SP4";
                    break;
				case Utilities.Versions.SP5:
					result = "SP5";
                    break;
                case Utilities.Versions.SP6:
                    result = "SP6";
                    break;
			}

			return result;
		}
        private static bool TryReadFrom(Project project, string keyName, out Versions versions)
        {
            versions = default(Versions);

            var service = project.Solution.Workspace.Services.GetService<IPersistentStorageService>();
            if (service == null)
            {
                return false;
            }

            using (var storage = service.GetStorage(project.Solution))
            using (var stream = storage.ReadStreamAsync(keyName, CancellationToken.None).WaitAndGetResult(CancellationToken.None))
            {
                if (stream == null)
                {
                    return false;
                }

                try
                {
                    using (var reader = new ObjectReader(stream))
                    {
                        var formatVersion = reader.ReadInt32();
                        if (formatVersion != SerializationFormat)
                        {
                            return false;
                        }

                        var persistedProjectVersion = VersionStamp.ReadFrom(reader);
                        var persistedSemanticVersion = VersionStamp.ReadFrom(reader);

                        versions = new Versions(persistedProjectVersion, persistedSemanticVersion);
                        return true;
                    }
                }
                catch (Exception)
                {
                    return false;
                }
            }
        }
        private bool TryLoadInitialVersions(ConditionalWeakTable<ProjectId, Versions> initialVersionMap, Project project, string keyName, out Versions versions)
        {
            var result = TryReadFrom(project, keyName, out versions);
            if (result)
            {
                Versions save = versions;
                initialVersionMap.GetValue(project.Id, _ => save);
                return true;
            }

            initialVersionMap.GetValue(project.Id, _ => Versions.Default);
            return false;
        }
Beispiel #56
0
 public bool IsValid(string input, Versions version)
 {
     try
     {
         Decode(input, version);
         return true;
     }
     catch (EncodingFormatException)
     {
         return false;
     }
 }
Beispiel #57
0
 public string Encode(byte[] buffer, string versionName, Versions versions)
 {
     return Encode(buffer, versions.Find(versionName));
 }
Beispiel #58
0
 /// <summary>
 /// Get settings from a specific version from XML config file
 /// </summary>
 /// <param name="TopNode">XMLNode to start searching</param>
 /// <param name="version">Versions value with wanted version</param>
 /// <returns></returns>
 private XmlNodeList GetSettingNodes(XmlNode TopNode, Versions version)
 {
     foreach (XmlNode child in TopNode.ChildNodes)
     {
         // check name values
         if (child.Attributes[0].Value == version.ToString())
         {
             return child.ChildNodes;
         }
     }
     return null;
 }
Beispiel #59
0
        /// <summary>
        /// Gets the most recent version of two versions. This is used to determine if an entity should push up 
        /// the map's minversion value. If either of the supplied versions is UnableToDetect, the method will
        /// return UnableToDetect as most recent version
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        private Versions GetMostRecentVersion(Versions a, Versions b)
        {
            //if either version is marked as UnableToDetect, return this version value
            if (a == Versions.UnableToDetect || b == Versions.UnableToDetect)
                return Versions.UnableToDetect;

            if ((int)a > (int)b)
                return a;
            else
                return b;
        }
Beispiel #60
0
 public VersionInfo(Versions version)
 {
     this.SetVersion(version);
 }