public ConfiguratorForm() { InitializeComponent(); OnCurrentStatusChanged += new OnChanged(ConfiguratorForm_OnCurrentStatusChanged); #region Список компонентов m_Components.AddRange(new object[] { textBoxModule, comboBoxEvents, comboBoxGroups, textBoxGroupLocation, textBoxGroupDestination, comboBoxGroupFilterPropertyName, textBoxGroupFilterPropertyValue, textBoxPointLocation, textBoxPointType, textBoxPointName, comboBoxPointEncoding, listBoxPoints,listBoxProperties,textBoxBitNumber}); #endregion #region Статусы WorkStatusStrings = new Dictionary<WorkStatus, string>(); WorkStatusStrings.Add(WorkStatus.NoEventDll, "Загрузите файл сборки ... "); WorkStatusStrings.Add(WorkStatus.NoEventChecked, "Выберите событие из списка ... "); WorkStatusStrings.Add(WorkStatus.EditGroup, "Редактирование группы "); WorkStatusStrings.Add(WorkStatus.NoGroupExist, "Создайте группу ... "); WorkStatusStrings.Add(WorkStatus.AddGroup, "Введите имя группы, PLC адрес, имя Core и по необходимости заполните данные по фильтру... "); WorkStatusStrings.Add(WorkStatus.EditProperty, "Редактирование точки [Enter] потверждение ввода. "); #endregion CurrentStatus = WorkStatus.NoEventDll; }
void OnNotifyChanged(T val) { OnChanged?.Invoke(val); }
private void RaiseFlagsFileChanged() { OnChanged?.Invoke(this, new FlagsFileChangedEventArgs(this)); }
private void NotifyChanged() { OnChanged?.Invoke(); }
private async void OnFieldChanged(object?sender, FieldChangedEventArgs e) => await OnChanged.InvokeAsync();
internal void GoldChanged() { OnChanged?.Invoke(User); }
public void RoomTraveled() { RoomsCount += 1; OnChanged?.Invoke(User); }
protected virtual void OnValueChanged(BusChangedEventArgs <BusData> e) { OnChanged?.Invoke(this, e); }
public void Append <T>(T data, bool @default) { Write(data, @default); OnChanged?.Invoke(data); }
private void _settingsList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { OnChanged?.Invoke(); }
partial void OnConstantModified() { OnChanged?.Invoke(); }
internal void FireChanged(Block block) { OnChanged?.Invoke(this, block); DrawOne(block); }
public void BackupAndUpdateRepositoryFile(string zipFileFullPath) { var zipFileName = System.IO.Path.GetFileName(zipFileFullPath.ToLower()); // Prise en compte du pattern filename.zip.version.* var parts = zipFileName.Split('.').ToList(); string version = null; var index = parts.IndexOf("zip"); version = string.Join(".", parts.Skip(index + 1).Take(int.MaxValue)); if (!string.IsNullOrWhiteSpace(version)) { zipFileName = zipFileName.Replace($".{version}", ""); } Logger.LogInformation("BackupAndUpdateRepositoryFile {0} with version {1} zipName {2}", zipFileFullPath, version, zipFileName); var list = GetAvailablePackageList(); var availablePackage = list.FirstOrDefault(i => i.PackageFileName.Equals(zipFileName, StringComparison.InvariantCultureIgnoreCase)); if (availablePackage != null) { if (availablePackage.ChangeDetected) { Logger.LogInformation("BackupAndUpdateRepositoryFile {0} with version {1} change already detected", zipFileFullPath, version); } availablePackage.ChangeDetected = true; } Logger.LogInformation("Start BackupAndUpdateRepositoryFile {0} with version {1}", zipFileFullPath, version); var destFileName = System.IO.Path.Combine(Settings.MicroServiceRepositoryFolder, zipFileName); if (System.IO.File.Exists(destFileName)) { // Backup string backupDirectory = Settings.MicroServiceBackupFolder; if (string.IsNullOrWhiteSpace(version)) { Logger.LogInformation("Try to BackupAndUpdateRepositoryFile {0}", zipFileFullPath); backupDirectory = GetNewBackupDirectory(zipFileName); if (!System.IO.Directory.Exists(backupDirectory)) { System.IO.Directory.CreateDirectory(backupDirectory); } var backupFileName = System.IO.Path.Combine(backupDirectory, zipFileName); System.IO.File.Copy(zipFileFullPath, backupFileName, true); Logger.LogInformation("Backup from {0} to {1} ", zipFileFullPath, backupFileName); } else { Logger.LogInformation("Try to BackupAndUpdateRepositoryFile {0} with version {1}", zipFileFullPath, version); var directoryPart = zipFileName.Replace(".zip", "", StringComparison.InvariantCultureIgnoreCase); var existingBackupFileName = System.IO.Path.Combine(backupDirectory, directoryPart, version, zipFileName); if (System.IO.File.Exists(existingBackupFileName)) { Logger.LogInformation("File {0} with version {1} already backuped without changed", zipFileFullPath, version); // Ne pas faire de mise à jour return; } var destDirectory = Path.GetDirectoryName(existingBackupFileName); if (!System.IO.Directory.Exists(destDirectory)) { System.IO.Directory.CreateDirectory(destDirectory); } var backupFileName = System.IO.Path.Combine(destDirectory, zipFileName); Logger.LogInformation("Try to Backup from {0} to {1} ", zipFileFullPath, backupFileName); System.IO.File.Copy(zipFileFullPath, backupFileName, true); Logger.LogInformation("Backup from {0} to {1} ", zipFileFullPath, backupFileName); } } try { Logger.LogInformation("Try to deploy {0} to {1} ", zipFileFullPath, destFileName); System.IO.File.Copy(zipFileFullPath, destFileName, true); Logger.LogInformation("package {0} deployed", destFileName); } catch (IOException ex) { Logger.LogError(ex, "deploy {0} failed", destFileName); return; } finally { if (availablePackage != null) { availablePackage.ChangeDetected = false; } } foreach (var running in GetRunningList()) { running.NextAction = Models.ServiceAction.ResetInstallationInfo; } OnChanged?.Invoke(); Cache.Remove(REPOSITORY_MICROSERVICE_AVAILABLE_LIST_CACHE_KEY); }
public void MakeSomeChange() { //make some change in the view Model OnChanged.Invoke(); }
/// <summary> /// Raise the event when data changed. /// </summary> private static void Change() { OnChanged?.Invoke(new object(), new EventArgs()); }
private void OnToggleChanged() { OnChanged.Invoke(); }
protected void ucMailout_OnChanged(object sender, EventArgs e) { InfoMessage = GetInfoMessage(CurrentState, mParentIssue, mABTest.TestWinnerOption); OnChanged?.Invoke(this, EventArgs.Empty); }
protected void HandleChanged() => OnChanged?.Invoke();
private void NotifyOnChanged(DigitalSignalProvider provider) { OnChanged?.Invoke(this, new DigitalLevelChangedEventArgs(provider, Level)); }
public void MonsterKilled() { MonsterCount += 1; OnChanged?.Invoke(User); }
private void OnStatChanged() { OnChanged?.Invoke(); }
public Task <ISTrainingPartResponse <bool> > SaveStaffAsync(Staff staff) { OnChanged?.Invoke(DbChangeStatus.Update, staff); return(Task.FromResult(new ISTrainingPartResponse <bool>(ISTrainingPartResponseCode.Ok, true))); }
/// <summary> /// Clear /// </summary> public void Clear() { _dic.Clear(); OnChanged?.Invoke(this, false, default(T)); }
public void SetValue(T value) { _value = value; OnChanged?.Invoke(this); }
public void NotifyChanged() { OnChanged.Invoke(this, EventArgs.Empty); }
private void DoOnChanged(ValueChangedEventArgs args) { isChanged = true; OnChanged?.Invoke(this, args); }
private void InternalOnChanged(IntPtr b, IntPtr data) { OnChanged?.Invoke(this); }
public void TriggerChanged(OnChangedEventArgs eventArgs) { OnChanged?.Invoke(this, eventArgs); }
public void SetData(T[] data) { this.Clear(); this.AddRange(data); OnChanged?.Invoke(); }
public void SetData(IEnumerable <T> data) { this.Clear(); this.AddRange(data); OnChanged?.Invoke(); }
private void OnValueChanged(T?old, T?nnew, bool wasNull, bool isNull) { OnChanged?.Invoke(new DatabaseFieldHistoryAction <T>(this, columnName, old, nnew, wasNull, isNull)); OnPropertyChanged(nameof(IsModified)); }