public void CreateView(VkImageViewType type = VkImageViewType.ImageView2D, VkImageAspectFlags aspectFlags = VkImageAspectFlags.Color, uint layerCount = 1, uint baseMipLevel = 0, uint levelCount = 1, uint baseArrayLayer = 0, VkComponentSwizzle r = VkComponentSwizzle.R, VkComponentSwizzle g = VkComponentSwizzle.G, VkComponentSwizzle b = VkComponentSwizzle.B, VkComponentSwizzle a = VkComponentSwizzle.A) { VkImageView view = default(VkImageView); VkImageViewCreateInfo viewInfo = VkImageViewCreateInfo.New(); viewInfo.image = handle; viewInfo.viewType = type; viewInfo.format = Format; viewInfo.components.r = r; viewInfo.components.g = g; viewInfo.components.b = b; viewInfo.components.a = a; viewInfo.subresourceRange.aspectMask = aspectFlags; viewInfo.subresourceRange.baseMipLevel = baseMipLevel; viewInfo.subresourceRange.levelCount = levelCount; viewInfo.subresourceRange.baseArrayLayer = baseArrayLayer; viewInfo.subresourceRange.layerCount = layerCount; Utils.CheckResult(vkCreateImageView(Dev.VkDev, ref viewInfo, IntPtr.Zero, out view)); if (Descriptor.imageView.Handle != 0) { Dev.DestroyImageView(Descriptor.imageView); } Descriptor.imageView = view; }
public async Task <IActionResult> Index(string username) { try { var developerId = _userManager.FindByNameAsync(username).Result.Id; var dev = new Dev { ShortBio = await _context.ShortBios.FindAsync(developerId), WorkingProfile = await _context.WorkingProfiles.FindAsync(developerId) }; var subscriptions = _context.Subscriptions.FirstOrDefault(s => s.DevId == developerId); if (subscriptions == null) { return(View("NotFound404")); } else { return(View(dev)); } } catch (Exception) { return(NotFound()); } }
public void CreateSampler(VkFilter minFilter = VkFilter.Linear, VkFilter magFilter = VkFilter.Linear, VkSamplerMipmapMode mipmapMode = VkSamplerMipmapMode.Linear, VkSamplerAddressMode addressMode = VkSamplerAddressMode.Repeat, float maxAnisotropy = 1.0f, float minLod = 0.0f, float maxLod = -1f) { VkSampler sampler; VkSamplerCreateInfo sampInfo = VkSamplerCreateInfo.New(); sampInfo.maxAnisotropy = maxAnisotropy; sampInfo.maxAnisotropy = 1.0f; // device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f; //samplerInfo.anisotropyEnable = device->enabledFeatures.samplerAnisotropy; sampInfo.addressModeU = addressMode; sampInfo.addressModeV = addressMode; sampInfo.addressModeW = addressMode; sampInfo.magFilter = magFilter; sampInfo.minFilter = minFilter; sampInfo.mipmapMode = mipmapMode; sampInfo.minLod = minLod; sampInfo.maxLod = maxLod < 0f ? info.mipLevels : maxLod; Utils.CheckResult(vkCreateSampler(Dev.VkDev, ref sampInfo, IntPtr.Zero, out sampler)); if (Descriptor.sampler.Handle != 0) { Dev.DestroySampler(Descriptor.sampler); } Descriptor.sampler = sampler; }
public override void Activate() { if (state != ActivableState.Activated) { List <VkSubpassDescription> spDescs = new List <VkSubpassDescription> (); foreach (SubPass sp in subpasses) { spDescs.Add(sp.SubpassDescription); } VkRenderPassCreateInfo renderPassInfo = VkRenderPassCreateInfo.New(); renderPassInfo.attachmentCount = (uint)attachments.Count; renderPassInfo.pAttachments = attachments.Pin(); renderPassInfo.subpassCount = (uint)spDescs.Count; renderPassInfo.pSubpasses = spDescs.Pin(); renderPassInfo.dependencyCount = (uint)dependencies.Count; renderPassInfo.pDependencies = dependencies.Pin(); handle = Dev.CreateRenderPass(renderPassInfo); foreach (SubPass sp in subpasses) { sp.UnpinLists(); } attachments.Unpin(); spDescs.Unpin(); dependencies.Unpin(); } base.Activate(); }
//copied and modified from "TransitionPoint.cs" public GlobalEnums.GatePosition GetGatePosition(string name) { if (name.Contains("top")) { return(GlobalEnums.GatePosition.top); } if (name.Contains("right")) { return(GlobalEnums.GatePosition.right); } if (name.Contains("left")) { return(GlobalEnums.GatePosition.left); } if (name.Contains("bot")) { return(GlobalEnums.GatePosition.bottom); } if (name.Contains("door")) { return(GlobalEnums.GatePosition.door); } Dev.LogError("Gate name " + name + "does not conform to a valid gate position type. Make sure gate name has the form 'left1'"); return(GlobalEnums.GatePosition.unknown); }
public Reservation Set(long time, OnTime onTime, OnCancel onCancel = null, Reservation.IHandle handler = null, IAlarmPayload payload = null) { Dev.Assert(onTime != null, "Cannot set timer with null onTime delegate"); if (handler?.Reservation != null) { return(null); } Reservation reservation = _reservationPool.Alloc(); reservation.Time = LogicTime.TIME() + time; reservation.OnTime = onTime; reservation.OnCancel = onCancel; reservation.Handler = handler; reservation.Payload = payload; if (handler != null) { Dev.Assert(handler.Reservation == null, "Alarm reservation already used"); reservation.Handler.Reservation = reservation; } _reservations.Add(reservation.Time, reservation); return(reservation); }
static void DataDump(GameObject go, int depth) { Dev.Log(new string( '-', depth ) + go.name); foreach (Component comp in go.GetComponents <Component>()) { switch (comp.GetType().ToString()) { case "UnityEngine.RectTransform": Dev.Log(new string( '+', depth ) + comp.GetType() + " : " + ((RectTransform)comp).sizeDelta + ", " + ((RectTransform)comp).anchoredPosition + ", " + ((RectTransform)comp).anchorMin + ", " + ((RectTransform)comp).anchorMax); break; case "UnityEngine.UI.Text": Dev.Log(new string( '+', depth ) + comp.GetType() + " : " + ((Text)comp).text); break; default: Dev.Log(new string( '+', depth ) + comp.GetType()); break; } } foreach (Transform child in go.transform) { DataDump(child.gameObject, depth + 1); } }
/// <summary> /// Get the language pack for the class with <paramref name="className"/>. /// If the language does not exist, the system will fallback to the <see cref="DEFAULT_LANGUAGE"/> /// </summary> /// <param name="className">Name of the class to get the lang pack for</param> /// <returns>Lang pack</returns> public static LanguagePack GetLanguagePackOrDefault(string className) { LanguagePack langPack = EditorLanguagePack.Load(className, Language); if (langPack == null) { langPack = EditorLanguagePack.Load(className, DEFAULT_LANGUAGE); if (Translate.Present) { if (langPack != null) { Translate.MissingLanguagePack(className); } } } if (langPack == null) { if (Dev.Present) { Dev.NoLocalizationPkg(className, Culture.Language, Culture.DEFAULT_LANGUAGE); } else { Debug.LogError("No localization package was found for " + className + "!"); } } return(langPack); }
static void Main(string[] args) { Log log = new Log(@".\testlog.log"); log.WriteLine(@"hjy_generic_example start"); App app = new App(); bool blLocked = app.Lock("hello"); log.WriteLine(@"blLocked = " + blLocked.ToString()); if (!blLocked) { log.WriteLine("other same app running"); return; } bool blResult = Dev.FindDev(Dev.dev_type.Description, @"Microsoft Usbccid Smartcard Reader (WUDF)"); ManagementObject[] devices = Dev.GetDevObjects(); foreach (ManagementObject device in devices) { log.WriteLine(device.ToString()); log.WriteLine(@"Description: " + ((device["Description"].ToString().Length > 0) ? (device["Description"].ToString()) : (@"Fail"))); log.WriteLine(@"HardwareID: " + ((device["HardwareID"].ToString().Length > 0) ? (device["HardwareID"].ToString()) : (@"Fail"))); log.WriteLine(@"PNPDeviceID: " + ((device["PNPDeviceID"].ToString().Length > 0) ? (device["PNPDeviceID"].ToString()) : (@"Fail"))); log.WriteLine(@"PNPClass: " + ((device["PNPClass"].ToString().Length > 0) ? (device["PNPClass"].ToString()) : (@"Fail"))); } }
public IHttpActionResult PutDev(int id, Dev dev) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != dev.Id) { return(BadRequest()); } db.Entry(dev).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!DevExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
/// <summary> /// 新增树节点(Dev) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TreeNodeNewDev_Clicked(object sender, RoutedEventArgs e) { if (viewModel.SelectedTreeNode == null || viewModel.SelectedTreeNode.Deepth == 1) { var window = new TreeNodeEditWindow(NodeType.Dev, null); window.Owner = this; var ret = window.ShowDialog(); if (string.IsNullOrEmpty(ret)) { return; } var dev = new Dev() { DevName = ret }; if (viewModel.Config.Devs == null) { viewModel.Config.Devs = new List <Dev>(); } viewModel.Config.Devs.Add(dev); viewModel.LeftTree = TreeViewModel.CreateTreeFromConfig(viewModel.Config); ConfigTree.ItemsSource = viewModel.LeftTree; } }
public static GameObject FindGameObject(this Scene scene, string name) { if (!scene.IsValid()) { return(null); } GameObject[] rootGameObjects = scene.GetRootGameObjects(); try { foreach (GameObject go in rootGameObjects) { if (go == null) { break; } GameObject found = go.FindGameObjectInChildren(name); if (found != null) { return(found); } } } catch (Exception e) { Dev.Log("Exception: " + e.Message); } return(null); }
private static bool ReadLine() { string inputString = Console.ReadLine(); string[] inputStringSplit = inputString.Split("."); if (GameSettings.IsDevMode) { if (inputStringSplit[0].ToLower() == "dev") { switch (inputStringSplit[1].ToLower()) { case "quit": Dev.Dis("Exit via dev command"); System.Environment.Exit(0); break; case "ping": Dev.Dis("This is a ping"); break; } return(false); } else { outString = inputString; return(true); } } else { outString = inputString; return(true); } }
void OnEnemyCollision(GameObject other, Vector3 normal) { Dev.Where(); HitInstance hit = ImpactHit; hit.DamageDealt = (int)(blowVelocity.magnitude * .25f); //1011 //if( ( other.layer & 11 ) > 0 ) { Rigidbody2D rb = other.GetComponentInParent <Rigidbody2D>(); if (rb != null) { bool isEnemy = rb.gameObject.IsGameEnemy(); if (!isEnemy) { return; } blowVelocity = normal * blowVelocity.magnitude; rb.gameObject.GetOrAddComponent <TakeDamageFromImpact>().blowVelocity = blowVelocity; rb.gameObject.GetOrAddComponent <PreventOutOfBounds>(); DamageEnemies dme = rb.gameObject.GetOrAddComponent <DamageEnemies>(); dme.damageDealt = (int)blowVelocity.magnitude; HealthManager.Hit(hit); } } }
void SetupDefaulSettings() { string globalSettingsFilename = Application.persistentDataPath + ModHooks.PathSeperator + GetType().Name + ".GlobalSettings.json"; bool forceReloadGlobalSettings = false; if (GlobalSettings != null && GlobalSettings.SettingsVersion != CharmingSettingsVars.GlobalSettingsVersion) { forceReloadGlobalSettings = true; } else { Log("Global settings version match!"); } if (forceReloadGlobalSettings || !File.Exists(globalSettingsFilename)) { if (forceReloadGlobalSettings) { Log("Global settings are outdated! Reloading global settings"); } else { Log("Global settings file not found, generating new one... File was not found at: " + globalSettingsFilename); } GlobalSettings.Reset(); GlobalSettings.SettingsVersion = CharmingSettingsVars.GlobalSettingsVersion; } SaveGlobalSettings(); Dev.Log("Mod done setting initializing!"); }
/// <summary> /// Print the value of the variable in a simple and clean way /// </summary> /// <typeparam name="T"></typeparam> /// <param name="var"></param> public static void LogVar <T>(string label, T var) { string var_name = label; string var_value = Convert.ToString(var); DevLoggingOutput.Log(Dev.FunctionHeader() + Dev.Colorize(var_name, _param_color) + " = " + Dev.Colorize(var_value, _log_color)); }
void UnRegisterCallbacks() { Dev.Where(); //Gathering Swarm hooks On.GeoRock.OnEnable -= RegisterGeoRock; On.GeoRock.OnDisable -= UnRegisterGeoRock; On.GeoControl.Disable -= UnRegisterGeo; On.GeoControl.FixedUpdate -= ProcessGeoUpdate; // Wayward Compass / Minimap hooks if (minimap != null) { minimap.Unload(); minimap = null; } ModHooks.Instance.HeroUpdateHook -= HeroMapUpdate; ModHooks.Instance.CharmUpdateHook -= CharmMapUpdate; UnityEngine.SceneManagement.SceneManager.sceneLoaded -= UpdateMinimap; UnityEngine.SceneManagement.SceneManager.activeSceneChanged -= UpdateMinimap; //Heavy Blow hooks ModHooks.Instance.SlashHitHook -= DebugPrintObjectOnHit; }
private bool TryMoveCard(Card card) { if (card.State == CardState.Blocked) { return(false); } if (Test.Cards.Contains(card)) { Test.RemoveCard(card); Done.CardCount++; return(true); } if (Dev.Cards.Contains(card)) { if (Test.AddCard(card)) { Dev.RemoveCard(card); return(true); } return(false); } throw new NullReferenceException("Card must be attached to Dev or Test column"); }
public void Remove(ref Reservation reservation) { Dev.Assert(_updates.ContainsKey(reservation.Index), "Not exist reservation"); _willremove.Enqueue(reservation); reservation = null; }
public void startOnlineServer() { Dev.log(Tag.Network, "You Clicked to initiate Server1"); GameRunningScript.getInstance().myPlayerChar = Character.Thief; Network.InitializeServer(2, portNum, true); Dev.log(Tag.Network, "You Clicked to initiate Server3"); }
//Dictionary<string,MapNode> visited = new Dictionary<string, MapNode>(); /* * //hook into this to start the randomizing of a new scene (sceneload is in game manager) * * * this.sceneLoad.Finish += delegate * { * this.$this.sceneLoad = null; * this.$this.isLoading = false; * this.$this.waitForManualLevelStart = false; * info.NotifyFinished(); * this.$this.OnNextLevelReady(); * }; * * * */ public IEnumerator Init(int seed) { Dev.Log("Loading!"); //TODO: pick a better way to know when it's safe to do this yield return(new WaitForSeconds(5f)); while (GameManager.instance.IsNonGameplayScene()) { yield return(new WaitForEndOfFrame()); } Dev.Where(); rng = new RNG(seed); ResetPlayerData(); world = new World(); currentArea = World.Map["Town"]; Dev.Log("Transitioning!"); yield return(ModCommon.Tools.EnterZone("Town", "left1", "door")); yield return(new WaitForSeconds(2f)); SetupTown(); //add the hooks UnityEngine.SceneManagement.SceneManager.activeSceneChanged -= OnSceneChange; UnityEngine.SceneManagement.SceneManager.activeSceneChanged += OnSceneChange; }
public static bool ReadDataFromFile <T>(string path, out T data) where T : class { data = null; if (!File.Exists(path)) { //System.Windows.Forms.MessageBox.Show("No file found at " + path ); return(false); } bool returnResult = true; XmlSerializer serializer = new XmlSerializer(typeof(T)); FileStream fstream = null; try { fstream = new FileStream(path, FileMode.Open); data = serializer.Deserialize(fstream) as T; } catch (System.Exception e) { Dev.LogError(e.Message); //System.Windows.Forms.MessageBox.Show("Error loading file " + e.Message); returnResult = false; } finally { fstream.Close(); } return(returnResult); }
//SN号打开相机 public void OpenBySN(TIS.Imaging.ICImagingControl icImagingControl1, string Ctemp) { string temp = ""; if (icImagingControl1.Devices.Length > 0) { foreach (Device Dev in icImagingControl1.Devices) { if (Dev.GetSerialNumber(out temp)) { if (temp == Ctemp)//判断是否等于指定相机序号 { icImagingControl1.Device = Dev.Name; break; } } } if (!icImagingControl1.DeviceValid) { MessageBox.Show("没有找到相机,是否SN号有误!"); Application.Exit(); } } else { MessageBox.Show("没有找到设备,请确认相机是否连接好"); Application.Exit(); } }
public void CreateNewDev() { Console.Clear(); Dev newDeveloper = new Dev(); Console.WriteLine("Enter the name of the Developer:"); newDeveloper.Name = Console.ReadLine(); Console.WriteLine("Enter the ID Number of the Developer:"); string newDevAsString = Console.ReadLine(); newDeveloper.ID = int.Parse(newDevAsString); Console.WriteLine("Do they have Sight Access?"); string hasPluralSightAccess = Console.ReadLine().ToLower(); if (hasPluralSightAccess == "y") { newDeveloper.HasPluralSightAccess = true; } else { newDeveloper.HasPluralSightAccess = false; } _devRepo.AddDeveloperToList(newDeveloper); }
public void SingleClick(Vector2 vect) { if (GameRunningScript.getInstance().isClickActive == false) { return; } Ray ray = cam.ScreenPointToRay(vect); RaycastHit point; if (Physics.Raycast(ray, out point, 20000, layerMask)) { if (point.collider.gameObject.GetComponent <PlayerControlScript>() != null) { PlayerControlScript player = point.collider.gameObject.GetComponent <PlayerControlScript>(); player.setSelected(true); } else if (point.collider.gameObject.GetComponent <CheckPoints>() != null) { CheckPoints check = point.collider.gameObject.GetComponent <CheckPoints>(); if (!check.getClickable()) { return; } if (GameRunningScript.getInstance().selectedPlayer == null) { return; } //TODO Do a method to decide the transport method GameRunningScript.getInstance().myPlayer.sendMove(check, TransportType.Cycle); GameRunningScript.getInstance().selectedPlayer.moveMyPlayer(check, TransportType.Cycle); Dev.log(Tag.GameClickListener, "Hit : " + check.name); } } }
void BoopOnHit(Collider2D otherCollider, GameObject gameObject) { if (hero == null || hero != HeroController.instance) { ContractorManager.Instance.StartCoroutine(CheckAndInit()); } if (otherCollider.gameObject == null) { return; } #if LEGACY_VERSION_1221 bool isEnemy = FSMUtility.LocateFSM(otherCollider.gameObject, "health_manager_enemy") != null || FSMUtility.LocateFSM(otherCollider.gameObject, "health_manager") != null; //for 1221 #else bool isEnemy = otherCollider.gameObject.IsGameEnemy(); #endif if (!isEnemy) { if (boopClip != null) { if (!highBoop.isPlaying) { highBoop.Play(); } } } else { if (boopClip != null) { Dev.Log("playing boop! " + gameObject.name); hero.GetComponent <AudioSource>().PlayOneShot(boopClip); } } }
//Element fit to screen public void fitViewControllerElementsToScreen() { //버그로 인해 먼저 이미지 스케일부터 조절 DigitalNumberCol.Frame = new CGRect(0, 0, Dev.CvD(78.55) * Dev.maxScrRatio, Dev.CvD(110) * Dev.maxScrRatio); double scrX = (Dev.scrSize.Width * Dev.deviceDensity) / 2 - (DigitalNumberCol.Width / 2); double digiClockYAxis = Dev.CvD(170) * Dev.maxScrRatio; //scrX += 4 * Dev.maxscrRatio; Log.Info("loc", scrX.ToString()); //디지털시계 이미지 스케일 조정 DigitalNumberCol.Frame = new CGRect(scrX, digiClockYAxis, DigitalNumberCol.Width, DigitalNumberCol.Height); Log.Info("wid", DigitalNumberCol.Width.ToString()); DigitalNumber0.Frame = new CGRect((DigitalNumberCol.X + (DigitalNumberCol.Width / 2)) - DigitalNumberCol.Width * 2 - Dev.CvD(36) * Dev.maxScrRatio, DigitalNumberCol.Y, DigitalNumberCol.Width, DigitalNumberCol.Height); DigitalNumber1.Frame = new CGRect((DigitalNumberCol.X + (DigitalNumberCol.Width / 2)) - DigitalNumberCol.Width - Dev.CvD(22) * Dev.maxScrRatio, DigitalNumberCol.Y, DigitalNumberCol.Width, DigitalNumberCol.Height); DigitalNumber2.Frame = new CGRect((DigitalNumberCol.X + (DigitalNumberCol.Width / 2)) + Dev.CvD(22) * Dev.maxScrRatio, DigitalNumberCol.Y, DigitalNumberCol.Width, DigitalNumberCol.Height); DigitalNumber3.Frame = new CGRect((DigitalNumberCol.X + (DigitalNumberCol.Width / 2)) + DigitalNumberCol.Width + Dev.CvD(36) * Dev.maxScrRatio, DigitalNumberCol.Y, DigitalNumberCol.Width, DigitalNumberCol.Height); double clockScrX = Dev.CvD(Dev.scrSize.Width) / 2 - (Dev.CvD(450) * Dev.maxScrRatio) / 2; double clockScrY = Dev.CvD(Dev.scrSize.Height) / 2 - (Dev.CvD(450) * Dev.maxScrRatio) / 2; //아날로그시계 조정 AnalogBody.Frame = new CGRect(clockScrX, clockScrY, Dev.CvD(450) * Dev.maxScrRatio, Dev.CvD(450) * Dev.maxScrRatio); AnalogHours.Frame = new CGRect(clockScrX, clockScrY, AnalogBody.Width, AnalogBody.Height); AnalogMinutes.Frame = AnalogHours.Frame; //땅 조정 GroundObj.Frame = new CGRect(0, Dev.CvD(Dev.scrSize.Height) - Dev.CvD(131 - 2) * Dev.maxScrRatio, Dev.CvD(Dev.scrSize.Width), Dev.CvD(131) * Dev.maxScrRatio); //백그라운드 크기 조절 backgroundImage.Frame = new CGRect(0, 0, Dev.CvD(Dev.scrSize.Width), Dev.CvD(Dev.scrSize.Height)); } //end func
public async Task <IActionResult> Edit(int id, [Bind("DevId,DevName")] Dev dev) { if (id != dev.DevId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dev); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DevExists(dev.DevId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dev)); }
/// <summary> /// Disconnect from the controller. /// </summary> protected override void DisconnectFromController() { // if we've generated any updates, send an All Off signal if (InUseState == InUseStates.Running) { Dev.AllOff(); } }
private void LogChanges(Team team) { if (_expectations.Expectations[team].Count != _expectations.PreviousExpectations[team].Count) { Dev.Log( $"{team.ToString()} bots previously {_expectations.PreviousExpectations[team].Count}, now {_expectations.Expectations[team].Count}."); } }
public void SetFixture(Dev.SettingsFixture setFix) { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); Diagnostics.CassandraTraceSwitch.Level = TraceLevel.Verbose; var clusterb = Cluster.Builder().AddContactPoint("cassi.cloudapp.net"); clusterb.WithDefaultKeyspace(keyspaceName); var cluster = clusterb.Build(); session = cluster.ConnectAndCreateDefaultKeyspaceIfNotExists(); ents = new TweetsContext(session); }
static void Test(ref object testObj, Type type, MethodInfo mth, Dev.SettingsFixture mysetting, StreamWriter output, ref int Passed, ref int Failed) { if (testObj == null) { testObj = type.GetConstructor(new Type[] { }).Invoke(new object[] { }); var ist = type.GetMethod("SetFixture"); if (ist != null) { ist.Invoke(testObj, new object[] { mysetting }); } } try { Console.ForegroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.White; var s = type.FullName + "." + mth.Name + "() Start..."; Console.WriteLine(new string(' ', 79)); Console.WriteLine(s); output.WriteLine(new string('-', 79)); output.WriteLine(s); Console.ResetColor(); mth.Invoke(testObj, new object[] { }); Passed++; Console.ForegroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.Green; s = type.FullName + "." + mth.Name + "() Passed"; Console.WriteLine(s); Console.WriteLine(new string(' ', 79)); output.WriteLine(s); output.WriteLine(new string('-', 79)); Console.ResetColor(); } catch (Exception ex) { if (ex.InnerException is Dev.AssertException) { Console.ForegroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.Red; var s = type.FullName + "." + mth.Name + "() Failed!"; Console.WriteLine(s); output.WriteLine(s); s = (ex.InnerException as Dev.AssertException).UserMessage; Console.WriteLine(s); Console.WriteLine(new string(' ', 79)); output.WriteLine(s); output.WriteLine(new string('-', 79)); } else { Console.BackgroundColor = ConsoleColor.Magenta; Console.ForegroundColor = ConsoleColor.Black; Console.WriteLine("Exception"); Console.WriteLine(ex.InnerException.Source); Console.WriteLine(ex.InnerException.Message); output.WriteLine("Exception"); output.WriteLine(ex.InnerException.Source); output.WriteLine(ex.InnerException.Message); if (ex.InnerException.InnerException != null) printInnerException(ex.InnerException.InnerException, output); } Console.WriteLine(ex.InnerException.StackTrace); output.WriteLine(ex.InnerException.StackTrace); Console.ResetColor(); Failed++; output.Flush(); } Console.WriteLine(); output.WriteLine(); }
public void SetFixture(Dev.SettingsFixture setFix) { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); //"pl-PL"); var clusterb = Cluster.Builder().AddContactPoint("cassi.cloudapp.net"); clusterb.WithDefaultKeyspace(Keyspace); if (_compression) clusterb.WithCompression(CompressionType.Snappy); Cluster = clusterb.Build(); Diagnostics.CassandraTraceSwitch.Level = System.Diagnostics.TraceLevel.Verbose; Diagnostics.CassandraStackTraceIncluded= true; Diagnostics.CassandraPerformanceCountersEnabled = true; Session = Cluster.ConnectAndCreateDefaultKeyspaceIfNotExists(ReplicationStrategies.CreateSimpleStrategyReplicationProperty(2), true); }
public void SetFixture(Dev.SettingsFixture setFix) { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); var clusterb = Cluster.Builder().AddContactPoint("cassi.cloudapp.net"); if (_compression) clusterb.WithCompression(CompressionType.Snappy); var cluster = clusterb.Build(); Session = cluster.Connect(this.Keyspace); }
public FileServerImageEditorService(Dev.Framework.FileServer.IImageFile imageFile) { _imageFile = imageFile; }
public void SetFixture(Dev.SettingsFixture setFix) { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); var clusterb = Cluster.Builder().AddContactPoint("cassi.cloudapp.net"); clusterb.WithReconnectionPolicy(new ConstantReconnectionPolicy(100)); if (_compression) clusterb.WithCompression(CompressionType.Snappy); if (_noBuffering) clusterb.WithoutRowSetBuffering(); var rp = new RoundRobinPolicyWithReconnectionRetries(new ConstantReconnectionPolicy(100)); rp.ReconnectionEvent += new EventHandler<RoundRobinPolicyWithReconnectionRetriesEventArgs>((s, ev) => { Console.Write("o"); Thread.Sleep((int)ev.DelayMs); }); clusterb.WithLoadBalancingPolicy(rp); clusterb.WithQueryTimeout(60*1000); var cluster = clusterb.Build(); Session = cluster.Connect(this.Keyspace); Message = setFix.InfoMessage; }