public SortedList<string, string> LoadScripts(string path, string pattern, bool recurse, string workingDirectory, Versioning.IParseVersions versionParser = null) { SortedList<string, string> s = ScriptRunner.ResolveScriptsFromPathAndVersion(path, pattern, recurse, workingDirectory, FromVersion, ToVersion, versionParser); return s; }
private void UpdateVersionAfterPatch(int verNumber) { Versioning.SetNewVersionAfterPatch(verNumber); if (!Dispatcher.CheckAccess()) { Dispatcher.Invoke(() => GameVersionLabel.Content = Versioning.FriendlyCurrentGameVersion()); } else { GameVersionLabel.Content = Versioning.FriendlyCurrentGameVersion(); } }
/// <summary> /// Creates a new instance of the TcpDuplexServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="tcpPort">TCP port number</param> /// <param name="authProvider">Authentication provider</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param> /// <param name="oaep">Specifies if OAEP padding should be activated</param> /// <param name="keepAlive">Enables or disables TCP KeepAlive for the new connection</param> /// <param name="keepAliveTime">Time for TCP KeepAlive in Milliseconds</param> /// <param name="KeepAliveInterval">Interval for TCP KeepAlive in Milliseconds</param> public TcpDuplexServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider, bool encryption, string algorithm, bool oaep, bool keepAlive, ulong keepAliveTime, ulong KeepAliveInterval) : this(versioning) { TcpPort = tcpPort; AuthenticationProvider = authProvider; Encryption = encryption; Algorithm = algorithm; Oaep = oaep; TcpKeepAliveEnabled = keepAlive; TcpKeepAliveTime = keepAliveTime; TcpKeepAliveInterval = KeepAliveInterval; }
private void DisplayRegistrationSuccessfullMessage(Versioning serverVersion) { AddServerMessage(ChatColor.Green, "*** You've registered successfully as {0} ({1})", Client.Name, Client.IsSpectator ? "Spectator" : "Player"); if (serverVersion == null) { AddServerMessage(ChatColor.Red, "Unknown server version. Use at your own risk!!!"); } else { AddServerMessage(ChatColor.Red, "Server version: {0}.{1}", serverVersion.Major, serverVersion.Minor); } }
private void OnRegisteredAsPlayer(RegistrationResults result, Versioning serverVersion, int playerId, bool isServerMaster) { if (result == RegistrationResults.RegistrationSuccessful) { DisplayRegistrationSuccessfullMessage(serverVersion); IsRegistered = true; } else { DisplayRegistrationFailMessage(result, serverVersion); } }
private void OnRegisteredAsSpectator(RegistrationResults result, Versioning serverVersion, int spectatorId) { if (result == RegistrationResults.RegistrationSuccessful) { DisplayRegistrationSuccessfullMessage(serverVersion); IsRegistered = true; } else { DisplayRegistrationFailMessage(result, serverVersion); } }
private AirlinerCargoType(SerializationInfo info, StreamingContext ctxt) : base(info, ctxt) { int version = info.GetInt16("version"); var fields = this.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).Where(p => p.GetCustomAttribute(typeof(Versioning)) != null); IList <PropertyInfo> props = new List <PropertyInfo>(this.GetType().GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).Where(p => p.GetCustomAttribute(typeof(Versioning)) != null)); var propsAndFields = props.Cast <MemberInfo>().Union(fields.Cast <MemberInfo>()); foreach (SerializationEntry entry in info) { MemberInfo prop = propsAndFields.FirstOrDefault(p => ((Versioning)p.GetCustomAttribute(typeof(Versioning))).Name == entry.Name); if (prop != null) { if (prop is FieldInfo) { ((FieldInfo)prop).SetValue(this, entry.Value); } else { ((PropertyInfo)prop).SetValue(this, entry.Value); } } } var notSetProps = propsAndFields.Where(p => ((Versioning)p.GetCustomAttribute(typeof(Versioning))).Version > version); foreach (MemberInfo notSet in notSetProps) { Versioning ver = (Versioning)notSet.GetCustomAttribute(typeof(Versioning)); if (ver.AutoGenerated) { if (notSet is FieldInfo) { ((FieldInfo)notSet).SetValue(this, ver.DefaultValue); } else { ((PropertyInfo)notSet).SetValue(this, ver.DefaultValue); } } if (version == 1) { this.IsConvertable = false; } } }
public void UC_UpdateNuspecFile_Works() { b.Info.Flow(); var reid = TestResources.GetIdentifiers(TestResourcesReferences.NuspecSample1); string srcFile = uth.GetTestDataFile(reid); MockVersionStorage mvs = new MockVersionStorage("0.0.0.1"); Versioning sut = new Versioning(mvs); sut.AddNugetFile(srcFile); }
/// <summary> /// Creates a new instance of the TcpDuplexServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> public TcpDuplexServerProtocolSetup(Versioning versioning) : base((settings, clientSinkChain, serverSinkChain) => new TcpExChannel(settings, clientSinkChain, serverSinkChain)) { _versioning = versioning; Hashtable formatterSettings = new Hashtable(); formatterSettings.Add("includeVersions", _versioning == Versioning.Strict); formatterSettings.Add("strictBinding", _versioning == Versioning.Strict); ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null)); ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full }); ServerSinkChain.Add(new ClientAddressServerChannelSinkProvider()); }
private bool IsVersionIncrementRequired(FlushEntityEvent @event, EntityEntry entry, IEntityPersister persister, int[] dirtyProperties) { // NH different behavior: because NH-1756 when PostInsertId is used with a generated version // the version is read inmediately after save and does not need to be incremented. // BTW, in general, a generated version does not need to be incremented by NH. bool isVersionIncrementRequired = entry.Status != Status.Deleted && !persister.IsVersionPropertyGenerated && (dirtyProperties == null || Versioning.IsVersionIncrementRequired(dirtyProperties, @event.HasDirtyCollection, persister.PropertyVersionability)); return(isVersionIncrementRequired); }
/// <summary> /// Perform any property value substitution that is necessary /// (interceptor callback, version initialization...) /// </summary> /// <param name="entity">The entity </param> /// <param name="id">The entity identifier </param> /// <param name="values">The snapshot entity state </param> /// <param name="persister">The entity persister </param> /// <param name="source">The originating session </param> /// <returns> /// True if the snapshot state changed such that /// reinjection of the values into the entity is required. /// </returns> protected virtual bool SubstituteValuesIfNecessary(object entity, object id, object[] values, IEntityPersister persister, ISessionImplementor source) { bool substitute = source.Interceptor.OnSave(entity, id, values, persister.PropertyNames, persister.PropertyTypes); //keep the existing version number in the case of replicate! if (persister.IsVersioned) { // NH Specific feature (H3.2 use null value for versionProperty; NH ask to persister to know if a valueType mean unversioned) object versionValue = values[persister.VersionProperty]; substitute |= Versioning.SeedVersion(values, persister.VersionProperty, persister.VersionType, persister.IsUnsavedVersion(versionValue), source); } return(substitute); }
/// <summary> /// Creates a new instance of the IpcBinaryClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> public IpcBinaryClientProtocolSetup(Versioning versioning) : base((settings, clientSinkChain, serverSinkChain) => new IpcChannel(settings, clientSinkChain, serverSinkChain)) { _channelName = "IpcBinaryClientProtocol_" + Guid.NewGuid().ToString(); _versioning = versioning; Hashtable formatterSettings = new Hashtable(); formatterSettings.Add("includeVersions", _versioning == Versioning.Strict); formatterSettings.Add("strictBinding", _versioning == Versioning.Strict); ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null)); ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full }); }
private object AssembleCacheEntry(CacheEntry entry, object id, IEntityPersister persister, LoadEvent @event) { object optionalObject = @event.InstanceToLoad; IEventSource session = @event.Session; ISessionFactoryImplementor factory = session.Factory; if (log.IsDebugEnabled) { log.Debug("assembling entity from second-level cache: " + MessageHelper.InfoString(persister, id, factory)); } IEntityPersister subclassPersister = factory.GetEntityPersister(entry.Subclass); object result = optionalObject ?? session.Instantiate(subclassPersister, id); // make it circular-reference safe TwoPhaseLoad.AddUninitializedCachedEntity(new EntityKey(id, subclassPersister, session.EntityMode), result, subclassPersister, LockMode.None, entry.AreLazyPropertiesUnfetched, entry.Version, session); IType[] types = subclassPersister.PropertyTypes; object[] values = entry.Assemble(result, id, subclassPersister, session.Interceptor, session); // intializes result by side-effect TypeFactory.DeepCopy(values, types, subclassPersister.PropertyUpdateability, values, session); object version = Versioning.GetVersion(values, subclassPersister); if (log.IsDebugEnabled) { log.Debug("Cached Version: " + version); } IPersistenceContext persistenceContext = session.PersistenceContext; persistenceContext.AddEntry(result, Status.Loaded, values, null, id, version, LockMode.None, true, subclassPersister, false, entry.AreLazyPropertiesUnfetched); subclassPersister.AfterInitialize(result, entry.AreLazyPropertiesUnfetched, session); persistenceContext.InitializeNonLazyCollections(); // upgrade the lock if necessary: //lock(result, lockMode); //PostLoad is needed for EJB3 //TODO: reuse the PostLoadEvent... PostLoadEvent postLoadEvent = new PostLoadEvent(session); postLoadEvent.Entity = result; postLoadEvent.Id = id; postLoadEvent.Persister = persister; IPostLoadEventListener[] listeners = session.Listeners.PostLoadEventListeners; for (int i = 0; i < listeners.Length; i++) { listeners[i].OnPostLoad(postLoadEvent); } return(result); }
private static NpmHistory FilterLatestVersions(NpmHistory history) { var filteredHistory = new NpmHistory { name = history.name, description = history.description, versions = new List <string>() }; var firstVersion = Versioning.StringToVersion(history.versions[0]); var currentMajor = firstVersion.Major; var currentMinor = firstVersion.Minor; var currentBuild = firstVersion.Build; var currentVersion = history.versions[0]; for (var i = 0; i < history.versions.Count; i++) { if (i == history.versions.Count - 1) { filteredHistory.versions.Add(history.versions[i]); } var ver = Versioning.StringToVersion(history.versions[i]); if (ver.Major > currentMajor) { currentMajor = ver.Major; currentMinor = ver.Minor; currentBuild = ver.Build; filteredHistory.versions.Add(currentVersion); currentVersion = history.versions[i]; continue; } if (ver.Minor > currentMinor) { currentMinor = ver.Minor; currentBuild = ver.Build; filteredHistory.versions.Add(currentVersion); currentVersion = history.versions[i]; continue; } if (ver.Build > currentBuild) { currentVersion = history.versions[i]; } } return(filteredHistory); }
public static void NewPipelineBuild() { Save(); Versioning.ClearConsole(); SemVer.BumpPatch(); AddressableAssetSettings.BuildPlayerContent(); LoadResourceFile(); OpenBuildFolder(); }
/// <summary> /// Perform any property value substitution that is necessary /// (interceptor callback, version initialization...) /// </summary> /// <param name="entity">The entity </param> /// <param name="id">The entity identifier </param> /// <param name="values">The snapshot entity state </param> /// <param name="persister">The entity persister </param> /// <param name="source">The originating session </param> /// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param> /// <returns> /// True if the snapshot state changed such that /// reinjection of the values into the entity is required. /// </returns> protected virtual async Task <bool> SubstituteValuesIfNecessaryAsync(object entity, object id, object[] values, IEntityPersister persister, ISessionImplementor source, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); bool substitute = source.Interceptor.OnSave(entity, id, values, persister.PropertyNames, persister.PropertyTypes); //keep the existing version number in the case of replicate! if (persister.IsVersioned) { // NH Specific feature (H3.2 use null value for versionProperty; NH ask to persister to know if a valueType mean unversioned) object versionValue = values[persister.VersionProperty]; substitute |= await(Versioning.SeedVersionAsync(values, persister.VersionProperty, persister.VersionType, persister.IsUnsavedVersion(versionValue), source, cancellationToken)).ConfigureAwait(false); } return(substitute); }
public override string GenerateDiffScript(DataModel previousModel, Versioning version) { if (previousModel == null) { throw new Exception("The previous model cannot be null."); } var sb = new StringBuilder(); sb.AppendLine("--NOT IMPLEMENTED"); sb.AppendLine("--Generated Upgrade For Version " + version.ToString()); sb.AppendLine("--Generated on " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); return(sb.ToString()); }
public void OnPlayerRegistered(RegistrationResults result, Versioning serverVersion, int playerId, bool gameStarted, bool isServerMaster, GameOptions options) { Log.Default.WriteLine(LogLevels.Info, "OnPlayerRegistered[{0}]:{1} => {2} {3} {4} | Version: {5}.{6}", PlayerName, result, playerId, gameStarted, isServerMaster, serverVersion == null ? -1 : serverVersion.Major, serverVersion == null ? -1 : serverVersion.Minor); ResetTimeout(); if (result == RegistrationResults.RegistrationSuccessful) { PlayerId = playerId; State = States.WaitingStartGame; } else { State = States.ApplicationStarted; } }
private void PreHandleUnitTestProjects(Dictionary <string, string> replacementsDictionary) { var testProjectPicker = new TestProjectPicker(); bool?result = testProjectPicker.ShowModal(); if (testProjectPicker.SelectedProject != null) { //TODO: Why am I doing this? Solution solution = _dte.Solution; Project project = testProjectPicker.SelectedProject; string path = string.Empty; string projectPath = Path.GetDirectoryName(project.FullName); string solutionPath = Path.GetDirectoryName(solution.FullName); if (!string.IsNullOrEmpty(projectPath) && !string.IsNullOrEmpty(solutionPath)) { if (projectPath.StartsWith(solutionPath)) { path = "..\\" + project.UniqueName; } else { path = project.FullName; } } replacementsDictionary["$referenceproject$"] = "True"; replacementsDictionary.Add("$projectPath$", path); replacementsDictionary.Add("$projectId$", project.Kind); replacementsDictionary.Add("$projectName$", project.Name); } if (testProjectPicker.SelectedUnitTestFramework != null) { _unitTestFrameworkPackage = testProjectPicker.SelectedUnitTestFramework.NugetName; replacementsDictionary.Add("$useXrmToolingClientUsing$", testProjectPicker.SelectedUnitTestFramework.CrmMajorVersion >= 8 ? "1" : "0"); } else { if (testProjectPicker.SelectedProject == null) { return; } string version = ProjectWorker.GetSdkCoreVersion(testProjectPicker.SelectedProject); replacementsDictionary.Add("$useXrmToolingClientUsing$", Versioning.StringToVersion(version).Major >= 8 ? "1" : "0"); } }
//+----------------------------------------------------------------------------------------------------- //| g e t C u r r e n t V e r s i o n //+----------------------------------------------------------------------------------------------------- // Auteur: Jonathan Lapierre // Compagnie: Thoran inc. // /// <summary> /// Will give the current version of the file (Version flagged as active) /// </summary> /// <returns>Will return an empty version object if not found</returns> public Versioning getCurrentVersion() { try { //Check if the XML was already loaded, if not load it if (this.xmlConfig.InnerXml == "") { this.LoadFromFile(); } //Loop the nodes to find the active version foreach (XmlNode MasterNodeFetch in xmlConfig.SelectNodes("/root/version")) { if (MasterNodeFetch.Attributes["active"].Value == "true") { Versioning retVers = new Versioning(); retVers.Major = MasterNodeFetch.Attributes["major"].Value; retVers.Minor = MasterNodeFetch.Attributes["minor"].Value; retVers.Build = MasterNodeFetch.Attributes["build"].Value; retVers.VersionInfo = MasterNodeFetch.ChildNodes[0].InnerText; retVers.MajorMinorBuild = retVers.Major + "." + retVers.Minor + "." + retVers.Build; retVers.CurrentVersion = new System.Version(retVers.MajorMinorBuild); DateTime ReleaseDate; //Check if date is valid if (DateTime.TryParse(MasterNodeFetch.Attributes["releaseDate"].Value, out ReleaseDate)) { retVers.ReleaseDate = ReleaseDate; } else { retVers.ReleaseDate = DateTime.MinValue; } return(retVers); } } return(new Versioning()); } catch (Exception err) { GlobalFuncLocal.log(err.Message + " | " + err.StackTrace, GlobalFuncLocal.ErrorLevel.CRITICAL); //Throw exception to let programmer or administrator know that their is a missing or invalid version.xml file throw new Exception("Missing or invalid version.xml file. Please check log for more information"); } }
public void Versioning_DefaultBehaviour_IsIncrementBuild() { b.Info.Flow(); JsonVersionPersister jvp = new JsonVersionPersister(uth.NewTemporaryFileName(true)); Versioning ver = new Versioning(jvp); string before = ver.ToString(); ver.Increment(); string after = ver.ToString(); Assert.Equal("0.0.0.0", before); Assert.Equal("0.0.1.0", after); }
/// <summary> /// Creates a new instance of the TcpBinaryServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> public TcpBinaryServerProtocolSetup(Versioning versioning) : base((settings, clientSinkChain, serverSinkChain) => new TcpChannel(settings, clientSinkChain, serverSinkChain)) { SocketCachingEnabled = true; _channelName = "TcpBinaryServerProtocolSetup_" + Guid.NewGuid().ToString(); _versioning = versioning; Hashtable formatterSettings = new Hashtable(); formatterSettings.Add("includeVersions", _versioning == Versioning.Strict); formatterSettings.Add("strictBinding", _versioning == Versioning.Strict); ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null)); ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full }); ServerSinkChain.Add(new ClientAddressServerChannelSinkProvider()); }
/// <summary> /// Creates a new instance of the TcpBinaryServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> public TcpBinaryServerProtocolSetup(Versioning versioning) : base((settings, clientSinkChain, serverSinkChain) => new TcpChannel(settings, clientSinkChain, serverSinkChain)) { SocketCachingEnabled = true; _channelName = "TcpBinaryServerProtocolSetup_" + Guid.NewGuid().ToString(); _versioning = versioning; Hashtable formatterSettings = new Hashtable(); formatterSettings.Add("includeVersions", _versioning == Versioning.Strict); formatterSettings.Add("strictBinding", _versioning == Versioning.Strict); ClientSinkChain.Add(new SafeBinaryClientFormatterSinkProvider(formatterSettings, null)); ServerSinkChain.Add(new SafeBinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full }); ServerSinkChain.Add(new ClientAddressServerChannelSinkProvider()); }
/// <summary> /// Creates a new instance of the HttpCustomClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="webProxy">Defines HTTP proxy settings</param> public HttpCustomClientProtocolSetup(Versioning versioning, IWebProxy webProxy) : base((settings, clientSinkChain, serverSinkChain) => new HttpChannel(settings, clientSinkChain, serverSinkChain)) { _channelName = "HttpCustomClientProtocolSetup" + Guid.NewGuid().ToString(); _versioning = versioning; Hashtable formatterSettings = new Hashtable(); formatterSettings.Add("includeVersions", _versioning == Versioning.Strict); formatterSettings.Add("strictBinding", _versioning == Versioning.Strict); WebRequest.DefaultWebProxy = webProxy; ClientSinkChain.Add(new BinaryClientFormatterSinkProvider(formatterSettings, null)); ServerSinkChain.Add(new BinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full }); }
private void OnRegisteredAsPlayer(RegistrationResults result, Versioning serverVersion, int playerId, bool isServerMaster) { if (result == RegistrationResults.RegistrationSuccessful) { if (Client.IsServerMaster) { Client.ChangeOptions(Options); } else { Options = Client.Options; } IsGameNotStarted = !Client.IsGameStarted; } }
void StockOnParameterChange(Contract c, ContractParameter p) { // Workaround for stock bug #18267 if (p.State == ParameterState.Complete && p.FundsCompletion == 0 && p.ScienceCompletion == 0 && p.ReputationCompletion == 0) { Versioning v = Versioning.Instance as Versioning; if (v.versionMajor == 1 && v.versionMinor == 4 && v.revision == 2) { MessageSystem.Message message = MessageSystem.Instance.FindMessages(m => m.message.Contains(p.MessageComplete)).FirstOrDefault(); if (message != null) { MessageSystem.Instance.DiscardMessage(message.button); } } } }
private void Register(string playerName, string team) { Log.Default.WriteLine(LogLevels.Info, "Registering"); State = States.Registering; PlayerName = playerName; Team = team; Version version = Assembly.GetEntryAssembly().GetName().Version; Versioning clientVersion = new Versioning { Major = version.Major, Minor = version.Minor, }; Proxy.RegisterPlayer(this, clientVersion, playerName, team); }
private void OnRegisteredAsSpectator(RegistrationResults result, Versioning serverVersion, int spectatorId) { if (result == RegistrationResults.RegistrationSuccessful) { IsRegistered = true; PlayFieldViewModel = PlayFieldSpectatorViewModel; OnPropertyChanged("PlayFieldViewModel"); if (ClientOptionsViewModel.Instance.AutomaticallySwitchToPartyLineOnRegistered) { if (ActiveTabItemIndex == ConnectionViewModel.TabIndex) { ActiveTabItemIndex = PartyLineViewModel.TabIndex; } } } }
public void Outputter_Environment_WritesToEnvironment() { b.Info.Flow(); MockVersionStorage mvs = new MockVersionStorage("0.0.0.1"); var sut = new Versioning(mvs); var v = sut.Version; var op = new MockVersioningOutputter(v); op.DoOutput(OutputPossibilities.File); Assert.True(op.FileWasWritten); Assert.False(op.EnvWasSet); }
public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("version", 2); Type myType = this.GetType(); IList <PropertyInfo> props = new List <PropertyInfo>(myType.GetProperties().Where(p => p.GetCustomAttribute(typeof(Versioning)) != null)); foreach (PropertyInfo prop in props) { object propValue = prop.GetValue(this, null); Versioning att = (Versioning)prop.GetCustomAttribute(typeof(Versioning)); info.AddValue(att.Name, propValue); } }
/// <summary> /// Creates a new instance of the TcpDuplexServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> public TcpDuplexServerProtocolSetup(Versioning versioning) : base((settings, clientSinkChain, serverSinkChain) => new TcpExChannel(settings, clientSinkChain, serverSinkChain)) { _versioning = versioning; Hashtable formatterSettings = new Hashtable(); formatterSettings.Add("includeVersions", _versioning == Versioning.Strict); formatterSettings.Add("strictBinding", _versioning == Versioning.Strict); ClientSinkChain.Add(new SafeBinaryClientFormatterSinkProvider(formatterSettings, null)); ServerSinkChain.Add(new SafeBinaryServerFormatterSinkProvider(formatterSettings, null) { TypeFilterLevel = TypeFilterLevel.Full }); ServerSinkChain.Add(new ClientAddressServerChannelSinkProvider()); }
private void PostHandleCrmAssemblyProjects(Project project, IVsPackageInstaller installer) { try { project.DTE.SuppressUI = true; //Pre-2015 use .NET 4.0 if (Versioning.StringToVersion(_coreVersion).Major < 7) { project.Properties.Item("TargetFrameworkMoniker").Value = ".NETFramework,Version=v4.0"; } //Plug-in & workflows use .NET 4.5.2 else if (_crmProjectType == ProjectType.Plugin || _crmProjectType == ProjectType.Workflow) { project.Properties.Item("TargetFrameworkMoniker").Value = ".NETFramework,Version=v4.5.2"; } //Console v9+ use .NET 4.6.2 //TODO: Getting "Project Unavailable" message when finished but project builds fine //else if (_crmProjectType == ProjectType.Console && Versioning.StringToVersion(_coreVersion).Major >= 9) // project.Properties.Item("TargetFrameworkMoniker").Value = ".NETFramework,Version=v4.6.2"; //Install all the NuGet packages project = (Project)((Array)_dte.ActiveSolutionProjects).GetValue(0); NuGetProcessor.InstallPackage(installer, project, Resource.SdkAssemblyCore, _coreVersion); if (_needsWorkflow) { NuGetProcessor.InstallPackage(installer, project, Resource.SdkAssemblyWorkflow, _coreVersion); } if (_needsClient) { NuGetProcessor.InstallPackage(installer, project, _clientPackage, _clientVersion); } ProjectWorker.ExcludeFolder(project, "bin"); ProjectWorker.ExcludeFolder(project, "performance"); if (_signAssembly) { Signing.GenerateKey(project, _destDirectory); } } catch (Exception ex) { ExceptionHandler.LogException(Logger, Resource.ErrorMessage_ErrorProcessingTemplate, ex); MessageBox.Show(Resource.ErrorMessage_ErrorProcessingTemplate); } }
/// <summary> /// Replaces the common tokens like "[year]" with their appropriate values as gathered from KSP /// </summary> /// <param name="sourceString">The source string to act on</param> /// <returns>The string post replacements</returns> public static string ReplaceStandardTokens(string sourceString) { string str = sourceString; str = ReplaceToken(str, "UT", Planetarium.fetch != null ? Math.Round(Planetarium.GetUniversalTime()).ToString() : "0"); str = ReplaceToken(str, "save", HighLogic.SaveFolder != null && HighLogic.SaveFolder.Trim().Length > 0 ? HighLogic.SaveFolder : "NA"); str = ReplaceToken(str, "version", Versioning.GetVersionString()); str = ReplaceToken(str, "vessel", HighLogic.LoadedSceneIsFlight && FlightGlobals.ActiveVessel != null ? FlightGlobals.ActiveVessel.vesselName : "NA"); str = ReplaceToken(str, "body", Planetarium.fetch != null ? Planetarium.fetch.CurrentMainBody.GetDisplayName() : "NA"); str = ReplaceToken(str, "situation", HighLogic.LoadedSceneIsFlight && FlightGlobals.ActiveVessel != null ? FlightGlobals.ActiveVessel.situation.ToString() : "NA"); str = ReplaceToken(str, "biome", HighLogic.LoadedSceneIsFlight && FlightGlobals.ActiveVessel != null ? ScienceUtil.GetExperimentBiome(FlightGlobals.ActiveVessel.mainBody, FlightGlobals.ActiveVessel.latitude, FlightGlobals.ActiveVessel.longitude) : "NA"); double ut = 0; int[] times = { 0, 0, 0, 0, 0 }; if (Planetarium.fetch != null) { ut = Planetarium.GetUniversalTime(); times = Utilities.ConvertUT(ut); } str = ReplaceToken(str, "year", times[0].ToString()); str = ReplaceToken(str, "year0", times[0].ToString("D3")); str = ReplaceToken(str, "day", times[1].ToString()); str = ReplaceToken(str, "day0", times[1].ToString("D3")); str = ReplaceToken(str, "hour", times[2].ToString()); str = ReplaceToken(str, "hour0", times[2].ToString("D2")); str = ReplaceToken(str, "min", times[3].ToString()); str = ReplaceToken(str, "min0", times[3].ToString("D2")); str = ReplaceToken(str, "sec", times[4].ToString()); str = ReplaceToken(str, "sec0", times[4].ToString("D2")); str = ReplaceToken(str, "kspDate", KSPUtil.PrintDate(ut, false).Trim()); string time = KSPUtil.PrintTimeCompact(0, false); if (HighLogic.LoadedSceneIsFlight && FlightGlobals.ActiveVessel != null) { time = KSPUtil.PrintTimeCompact((int)FlightGlobals.ActiveVessel.missionTime, false); } time = time.Replace(":", "-"); //Can't use colons in filenames on Windows, so we'll replace them with "-" str = ReplaceToken(str, "MET", time); return(str); }
private void OnRegisteredAsSpectator(RegistrationResults result, Versioning serverVersion, int spectatorId) { if (result == RegistrationResults.RegistrationSuccessful) { string version = serverVersion == null ? "Unknown server version. Use at your own risk." : String.Format("Server version {0}.{1}", serverVersion.Major, serverVersion.Minor); SetConnectionResultMessage(ChatColor.Green, "Registered as spectator {0}. {1}", spectatorId + 1, version); } else { string version = serverVersion == null ? "Unknown server version" : String.Format("Server version {0}.{1}", serverVersion.Major, serverVersion.Minor); DescriptionAttribute attribute = EnumHelper.GetAttribute <DescriptionAttribute>(result); Client.UnregisterAndDisconnect(); SetConnectionResultMessage(ChatColor.Red, "Registration failed: {0}. {1}", attribute == null ? result.ToString() : attribute.Description, version); } _isRegistered = Client.IsRegistered; OnPropertyChanged("ConnectDisconnectLabel"); OnPropertyChanged("IsNotRegistered"); }
public static SortedList<string, string> ResolveScriptsFromPathAndVersion(string path, string pattern, bool recurse, string workingDirectory, Versioning.Version source, Versioning.Version destination, Versioning.IParseVersions versionParser = null) { SortedList<string, string> files = new SortedList<string, string>(); if (versionParser == null) versionParser = new Versioning.VersionDateParser(); string usedPath = path; if (!System.IO.Directory.Exists(usedPath)) usedPath = System.IO.Path.Combine(workingDirectory, path); if (!System.IO.Directory.Exists(usedPath)) throw new ArgumentOutOfRangeException("path"); foreach (var d in System.IO.Directory.GetDirectories(usedPath)) { System.IO.DirectoryInfo dir = new DirectoryInfo(d); Versioning.Version dirVersion = versionParser.Parse(dir.Name); if (dirVersion >= source && dirVersion <= destination) { var scripts = ResolveScriptsFromPath(dir.FullName, pattern, recurse, workingDirectory); foreach (string key in scripts.Keys) { files.Add(key, scripts[key]); } } } return files; }
/// <summary> /// Creates a new instance of the TcpDuplexServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="tcpPort">TCP port number</param> /// <param name="authProvider">Authentication provider</param> /// <param name="keepAlive">Enables or disables TCP KeepAlive for the new connection</param> /// <param name="keepAliveTime">Time for TCP KeepAlive in Milliseconds</param> /// <param name="KeepAliveInterval">Interval for TCP KeepAlive in Milliseconds</param> public TcpDuplexServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider, bool keepAlive, ulong keepAliveTime, ulong KeepAliveInterval) : this(versioning) { TcpPort = tcpPort; AuthenticationProvider = authProvider; TcpKeepAliveEnabled = keepAlive; TcpKeepAliveTime = keepAliveTime; TcpKeepAliveInterval = KeepAliveInterval; }
/// <summary> /// Creates a new instance of the TcpDuplexServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="tcpPort">TCP port number</param> /// <param name="authProvider">Authentication provider</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param> /// <param name="oaep">Specifies if OAEP padding should be activated</param> public TcpDuplexServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider, bool encryption, string algorithm, bool oaep) : this(versioning) { TcpPort = tcpPort; AuthenticationProvider = authProvider; Encryption = encryption; Algorithm = algorithm; Oaep = oaep; }
/// <summary> /// Creates a new instance of the HttpCustomClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param> /// <param name="maxAttempts">Maximum number of connection attempts</param> /// <param name="webProxy">Defines HTTP proxy settings</param> public HttpCustomClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, int maxAttempts, IWebProxy webProxy) : this(versioning, webProxy) { Encryption = encryption; Algorithm = algorithm; MaxAttempts = maxAttempts; }
/// <summary> /// Creates a new instance of the HttpCustomClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="webProxy">Defines HTTP proxy settings</param> public HttpCustomClientProtocolSetup(Versioning versioning, bool encryption, IWebProxy webProxy) : this(versioning, webProxy) { Encryption = encryption; }
/// <summary> /// Creates a new instance of the HttpCustomServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="httpPort">HTTP port number</param> /// <param name="authProvider">Authentication provider</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param> /// <param name="oaep">Specifies if OAEP padding should be activated</param> public HttpCustomServerProtocolSetup(Versioning versioning, int httpPort, IAuthenticationProvider authProvider, bool encryption, string algorithm, bool oaep) : this(versioning) { HttpPort = httpPort; AuthenticationProvider = authProvider; Encryption = encryption; Algorithm = algorithm; Oaep = oaep; }
/// <summary> /// Creates a new instance of the HttpCustomClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param> /// <param name="oaep">Specifies if OAEP padding should be activated</param> /// <param name="webProxy">Defines HTTP proxy settings</param> public HttpCustomClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, bool oaep, IWebProxy webProxy) : this(versioning, webProxy) { Encryption = encryption; Algorithm = algorithm; Oaep = oaep; }
/// <summary> /// Creates a new instance of the TcpDuplexClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Symmetric encryption algorithm (e.G. "3DES")</param> /// <param name="oaep">Specifies if OAEP padding should be activated</param> public TcpDuplexClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, bool oaep) : this(versioning) { Encryption = encryption; Algorithm = algorithm; Oaep = oaep; }
/// <summary> /// Creates a new instance of the TcpDuplexServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="tcpPort">TCP port number</param> /// <param name="authProvider">Authentication provider</param> public TcpDuplexServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider) : this(versioning) { TcpPort = tcpPort; AuthenticationProvider = authProvider; }
public override async Task<Newtonsoft.Json.Linq.JObject> GetPackageMetadata(string id, Versioning.NuGetVersion version) { foreach (var source in _sources) { var result = await source.GetPackageMetadata(id, version); if (result != null) { return result; } } return null; }
public override Task<JObject> GetPackageMetadata(string id, Versioning.NuGetVersion version) { return Task.Factory.StartNew(() => { NuGetTraceSources.V2SourceRepository.Verbose("getpackage", "Getting metadata for {0} {1}", id, version); var semver = CoreConverters.SafeToSemanticVersion(version); var package = _repository.FindPackage(id, semver); // Sometimes, V2 APIs seem to fail to return a value for Packages(Id=,Version=) requests... if (package == null) { var packages = _repository.FindPackagesById(id); package = packages.FirstOrDefault(p => Equals(p.Version, semver)); } // If still null, fail if (package == null) { return null; } string repoRoot = null; IPackagePathResolver resolver = null; if (_lprepo != null) { repoRoot = _lprepo.Source; resolver = _lprepo.PathResolver; } return PackageJsonLd.CreatePackage(package, repoRoot, resolver); }); }
public override async Task<Newtonsoft.Json.Linq.JObject> GetPackageMetadata(string id, Versioning.NuGetVersion version) { await DetectVersionWhenNeccessary(); return await _repo.GetPackageMetadata(id, version); }
/// <summary> /// Creates a new instance of the HttpCustomServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="httpPort">HTTP port number</param> /// <param name="authProvider">Authentication provider</param> public HttpCustomServerProtocolSetup(Versioning versioning, int httpPort, IAuthenticationProvider authProvider) : this(versioning) { HttpPort = httpPort; AuthenticationProvider = authProvider; }
/// <summary> /// Creates a new instance of the TcpBinaryServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="tcpPort">TCP port number</param> public TcpBinaryServerProtocolSetup(Versioning versioning, int tcpPort) : this(versioning) { TcpPort = tcpPort; }
/// <summary> /// Creates a new instance of the TcpCustomClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> public TcpCustomClientProtocolSetup(Versioning versioning, bool encryption) : this(versioning) { Encryption = encryption; }
/// <summary> /// Creates a new instance of the TcpDuplexClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Symmetric encryption algorithm (e.G. "3DES")</param> /// <param name="maxAttempts">Maximum number of connection attempts</param> public TcpDuplexClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, int maxAttempts) : this(versioning) { Encryption = encryption; Algorithm = algorithm; MaxAttempts = maxAttempts; }
/// <summary> /// Creates a new instance of the TcpCustomClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param> public TcpCustomClientProtocolSetup(Versioning versioning, bool encryption, string algorithm) : this(versioning) { Encryption = encryption; Algorithm = algorithm; }
/// <summary> /// Creates a new instance of the TcpDuplexClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="keepAlive">Enables or disables TCP KeepAlive for the new connection</param> /// <param name="keepAliveTime">Time for TCP KeepAlive in Milliseconds</param> /// <param name="KeepAliveInterval">Interval for TCP KeepAlive in Milliseconds</param> public TcpDuplexClientProtocolSetup(Versioning versioning, bool encryption, bool keepAlive, ulong keepAliveTime, ulong KeepAliveInterval) : this(versioning) { Encryption = encryption; TcpKeepAliveEnabled = keepAlive; TcpKeepAliveTime = keepAliveTime; TcpKeepAliveInterval = KeepAliveInterval; }
public bool ParseAndValidate(string version, Versioning.Version testVersion, Versioning.IParseVersions parser = null) { if (parser == null) parser = new Versioning.JustVersionParser(); Versioning.Version v = parser.Parse(version); return (v.Major == testVersion.Major && v.Minor == testVersion.Minor && v.Build == testVersion.Build && v.Description == testVersion.Description); }
/// <summary> /// Creates a new instance of the TcpCustomClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param> /// <param name="maxAttempts">Maximum number of connection attempts</param> /// <param name="oaep">Specifies if OAEP padding should be used</param> public TcpCustomClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, int maxAttempts, bool oaep) : this(versioning) { Encryption = encryption; Algorithm = algorithm; MaxAttempts = maxAttempts; Oaep = oaep; }
/// <summary> /// Creates a new instance of the TcpDuplexClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Symmetric encryption algorithm (e.G. "3DES")</param> /// <param name="maxAttempts">Maximum number of connection attempts</param> /// <param name="oaep">Specifies if OAEP padding should be activated</param> /// <param name="keepAlive">Enables or disables TCP KeepAlive for the new connection</param> /// <param name="keepAliveTime">Time for TCP KeepAlive in Milliseconds</param> /// <param name="KeepAliveInterval">Interval for TCP KeepAlive in Milliseconds</param> public TcpDuplexClientProtocolSetup(Versioning versioning, bool encryption, string algorithm, int maxAttempts, bool oaep, bool keepAlive, ulong keepAliveTime, ulong KeepAliveInterval) : this(versioning) { Encryption = encryption; Algorithm = algorithm; MaxAttempts = maxAttempts; Oaep = oaep; TcpKeepAliveEnabled = keepAlive; TcpKeepAliveTime = keepAliveTime; TcpKeepAliveInterval = KeepAliveInterval; }
/// <summary> /// Creates a new instance of the HttpCustomClientProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> public HttpCustomClientProtocolSetup(Versioning versioning) : this(versioning, WebRequest.DefaultWebProxy) { }
/// <summary> /// Creates a new instance of the TcpCustomServerProtocolSetup class. /// </summary> /// <param name="versioning">Versioning behavior</param> /// <param name="tcpPort">TCP port number</param> /// <param name="authProvider">Authentication provider</param> /// <param name="encryption">Specifies if the communication sould be encrypted</param> /// <param name="algorithm">Encryption algorithm (e.G. "3DES")</param> public TcpCustomServerProtocolSetup(Versioning versioning, int tcpPort, IAuthenticationProvider authProvider, bool encryption, string algorithm) : this(versioning) { TcpPort = tcpPort; AuthenticationProvider = authProvider; Encryption = encryption; Algorithm = algorithm; }