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

            OnChanged?.Invoke(data);
        }
示例#10
0
 private void _settingsList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     OnChanged?.Invoke();
 }
示例#11
0
 partial void OnConstantModified()
 {
     OnChanged?.Invoke();
 }
示例#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);
    }
示例#14
0
 public void MakeSomeChange()
 {
     //make some change in the view Model
     OnChanged.Invoke();
 }
示例#15
0
 /// <summary>
 /// Raise the event when data changed.
 /// </summary>
 private static void Change()
 {
     OnChanged?.Invoke(new object(), new EventArgs());
 }
 private void OnToggleChanged()
 {
     OnChanged.Invoke();
 }
示例#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();
示例#19
0
 private void NotifyOnChanged(DigitalSignalProvider provider)
 {
     OnChanged?.Invoke(this, new DigitalLevelChangedEventArgs(provider, Level));
 }
示例#20
0
 public void MonsterKilled()
 {
     MonsterCount += 1;
     OnChanged?.Invoke(User);
 }
示例#21
0
 private void OnStatChanged()
 {
     OnChanged?.Invoke();
 }
示例#22
0
 public Task <ISTrainingPartResponse <bool> > SaveStaffAsync(Staff staff)
 {
     OnChanged?.Invoke(DbChangeStatus.Update, staff);
     return(Task.FromResult(new ISTrainingPartResponse <bool>(ISTrainingPartResponseCode.Ok, true)));
 }
示例#23
0
 /// <summary>
 /// Clear
 /// </summary>
 public void Clear()
 {
     _dic.Clear();
     OnChanged?.Invoke(this, false, default(T));
 }
示例#24
0
 public void SetValue(T value)
 {
     _value = value;
     OnChanged?.Invoke(this);
 }
 public void NotifyChanged()
 {
     OnChanged.Invoke(this, EventArgs.Empty);
 }
示例#26
0
 private void DoOnChanged(ValueChangedEventArgs args)
 {
     isChanged = true;
     OnChanged?.Invoke(this, args);
 }
示例#27
0
 private void InternalOnChanged(IntPtr b, IntPtr data)
 {
     OnChanged?.Invoke(this);
 }
示例#28
0
 public void TriggerChanged(OnChangedEventArgs eventArgs)
 {
     OnChanged?.Invoke(this, eventArgs);
 }
示例#29
0
 public void SetData(T[] data)
 {
     this.Clear();
     this.AddRange(data);
     OnChanged?.Invoke();
 }
示例#30
0
 public void SetData(IEnumerable <T> data)
 {
     this.Clear();
     this.AddRange(data);
     OnChanged?.Invoke();
 }
示例#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));
 }