public void Save() { File.WriteAllText(FileName, scintillaZ80Monitor1.Text); InfoEvent?.Invoke(this, new InfoEventArgs("Saved " + FileName)); originalText = scintillaZ80Monitor1.Text; Text = Path.GetFileName(FileName); }
public void AnalizData() { if (ONData.DataNew != null && ONData.DataOld != null) { int added = ReaderNew.RowsId.Except(ReaderOld.RowsId).Count(); int deleted = ReaderOld.RowsId.Except(ReaderNew.RowsId).Count(); InfoEvent?.Invoke($"Добавлено строк: {added} Удалено строк: {deleted} Всего строк: {ReaderNew.RowsId.Count}"); } }
public void Die() { lp = 0; GetComponent <Animator>().SetBool("Death", true); if (aiMovement != null) { aiMovement.KillMovement(); } if (_aiDied != null) { _aiDied.Invoke(transform); } if (despawns) { StartCoroutine(Despawn()); } }
/// <summary> /// Loads all classes according to the given namespace /// </summary> /// <param name="namespaceName">The name of the namespace</param> /// <param name="browseTab">true to load all classes, false to load only dynamic and static classes</param> /// <param name="cancellationToken">The token to cancel the execution</param> /// <returns>The list with the classes</returns> /// <exception cref="ArgumentNullException">Will be thrown when the namespace name is null or empty</exception> /// <exception cref="ManagementException">Will be thrown when an error occured in the management object searcher</exception> public static List <ClassItem> LoadClasses(string namespaceName, bool browseTab, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(namespaceName)) { throw new ArgumentNullException(nameof(namespaceName)); } var searcher = new ManagementObjectSearcher(new ManagementScope(namespaceName), new WqlObjectQuery("SELECT * FROM meta_class"), null); var result = new List <ClassItem>(); foreach (var wmiClass in searcher.Get()) { if (cancellationToken.IsCancellationRequested) { cancellationToken.ThrowIfCancellationRequested(); } var name = wmiClass["__CLASS"].ToString(); InfoEvent?.Invoke($"{result.Count,4} - current class: {name}"); if (browseTab) { var classItem = new ClassItem(name); classItem.Description = LoadClassDescription(namespaceName, classItem.Name); result.Add(classItem); } else { foreach (var qualifier in wmiClass.Qualifiers) { if (qualifier.Name.EqualsIgnoreCase("dynamic") || qualifier.Name.EqualsIgnoreCase("static")) { var classItem = new ClassItem(name); result.Add(classItem); } } } } return(result.OrderBy(o => o.Name).ToList()); }
/// <summary> /// Loads the available namespaces starting from the root namespace passed into the root parameter /// </summary> /// <exception cref="ManagementException">Will be thrown when an error occured while loading the namespaces</exception> private static void LoadNamespaces(string root) { try { var nsClass = new ManagementClass(new ManagementScope(root), new ManagementPath("__namespace"), null); foreach (var ns in nsClass.GetInstances()) { var nsName = $"{root}\\{ns["Name"]}"; InfoEvent?.Invoke($"> current namespace: {GetNamespacePath(nsName)}{Environment.NewLine}" + $"> {NamespaceList.Count} namespaces found / {_skipCount} skipped"); NamespaceList.Add(new NamespaceItem(nsName)); LoadNamespaces(nsName); } } catch (ManagementException) { // Skip the error. It was fired because of insufficient permissions _skipCount++; } }
public void OnPointerEnter(PointerEventData eventData) { //image.color = new Color32(255, 255, 255, 150); highlightPanel.SetActive(true); eventInfo.Invoke(description); }
private void RaiseInfoEvent(string info) { InfoEvent?.Invoke(this, info); }
public void OnInfo(object sender, string message) => InfoEvent?.Invoke(sender, message);
protected virtual void OnInfoEvent(IndexWriterInfoEventArgs e) { InfoEvent?.Invoke(this, e); }
private static void RaiseInfoEvent(InfoEventArgs e) { InfoEvent?.Invoke(typeof(ConsoleUtil), e); }
public static void Info(this string msg) { logger.Information(msg); InfoEvent?.Invoke(msg); }