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;
        }
Esempio n. 2
0
 void OnNotifyChanged(T val)
 {
     OnChanged?.Invoke(val);
 }
Esempio n. 3
0
 private void RaiseFlagsFileChanged()
 {
     OnChanged?.Invoke(this, new FlagsFileChangedEventArgs(this));
 }
Esempio n. 4
0
 private void NotifyChanged()
 {
     OnChanged?.Invoke();
 }
Esempio n. 5
0
 private async void OnFieldChanged(object?sender, FieldChangedEventArgs e) => await OnChanged.InvokeAsync();
Esempio n. 6
0
 internal void GoldChanged()
 {
     OnChanged?.Invoke(User);
 }
Esempio n. 7
0
 public void RoomTraveled()
 {
     RoomsCount += 1;
     OnChanged?.Invoke(User);
 }
Esempio n. 8
0
 protected virtual void OnValueChanged(BusChangedEventArgs <BusData> e)
 {
     OnChanged?.Invoke(this, e);
 }
Esempio n. 9
0
        public void Append <T>(T data, bool @default)
        {
            Write(data, @default);

            OnChanged?.Invoke(data);
        }
Esempio n. 10
0
 private void _settingsList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     OnChanged?.Invoke();
 }
Esempio n. 11
0
 partial void OnConstantModified()
 {
     OnChanged?.Invoke();
 }
Esempio n. 12
0
 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);
    }
Esempio n. 14
0
 public void MakeSomeChange()
 {
     //make some change in the view Model
     OnChanged.Invoke();
 }
Esempio n. 15
0
 /// <summary>
 /// Raise the event when data changed.
 /// </summary>
 private static void Change()
 {
     OnChanged?.Invoke(new object(), new EventArgs());
 }
Esempio n. 16
0
 private void OnToggleChanged()
 {
     OnChanged.Invoke();
 }
Esempio n. 17
0
    protected void ucMailout_OnChanged(object sender, EventArgs e)
    {
        InfoMessage = GetInfoMessage(CurrentState, mParentIssue, mABTest.TestWinnerOption);

        OnChanged?.Invoke(this, EventArgs.Empty);
    }
 protected void HandleChanged() => OnChanged?.Invoke();
Esempio n. 19
0
 private void NotifyOnChanged(DigitalSignalProvider provider)
 {
     OnChanged?.Invoke(this, new DigitalLevelChangedEventArgs(provider, Level));
 }
Esempio n. 20
0
 public void MonsterKilled()
 {
     MonsterCount += 1;
     OnChanged?.Invoke(User);
 }
Esempio n. 21
0
 private void OnStatChanged()
 {
     OnChanged?.Invoke();
 }
Esempio n. 22
0
 public Task <ISTrainingPartResponse <bool> > SaveStaffAsync(Staff staff)
 {
     OnChanged?.Invoke(DbChangeStatus.Update, staff);
     return(Task.FromResult(new ISTrainingPartResponse <bool>(ISTrainingPartResponseCode.Ok, true)));
 }
Esempio n. 23
0
 /// <summary>
 /// Clear
 /// </summary>
 public void Clear()
 {
     _dic.Clear();
     OnChanged?.Invoke(this, false, default(T));
 }
Esempio n. 24
0
 public void SetValue(T value)
 {
     _value = value;
     OnChanged?.Invoke(this);
 }
 public void NotifyChanged()
 {
     OnChanged.Invoke(this, EventArgs.Empty);
 }
Esempio n. 26
0
 private void DoOnChanged(ValueChangedEventArgs args)
 {
     isChanged = true;
     OnChanged?.Invoke(this, args);
 }
Esempio n. 27
0
 private void InternalOnChanged(IntPtr b, IntPtr data)
 {
     OnChanged?.Invoke(this);
 }
Esempio n. 28
0
 public void TriggerChanged(OnChangedEventArgs eventArgs)
 {
     OnChanged?.Invoke(this, eventArgs);
 }
Esempio n. 29
0
 public void SetData(T[] data)
 {
     this.Clear();
     this.AddRange(data);
     OnChanged?.Invoke();
 }
Esempio n. 30
0
 public void SetData(IEnumerable <T> data)
 {
     this.Clear();
     this.AddRange(data);
     OnChanged?.Invoke();
 }
Esempio n. 31
0
 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));
 }