ArchiveSettingHandlers.cs 1.05 KB
using System;
using System.Collections.Generic;
using System.Linq;
using Sungero.Core;
using Sungero.CoreEntities;
using DirRX.Container.ArchiveSetting;

namespace DirRX.Container
{
  partial class ArchiveSettingClientHandlers
  {

    public override void Refresh(Sungero.Presentation.FormRefreshEventArgs e)
    {
      e.Params.AddOrUpdate(Constants.ArchiveSetting.SaveFromUIParamName, true);
      _obj.State.Properties.SourceUid.IsRequired = true;
    }

    public virtual void WebApiUrlValueInput(Sungero.Presentation.StringValueInputEventArgs e)
    {
      // Проверить адрес.
      if (!string.IsNullOrEmpty(e.NewValue) && !System.Uri.IsWellFormedUriString(e.NewValue, UriKind.Absolute))
        e.AddError("Адрес сервиса должен соответствовать формату URL.");
    }
    
    public override void Showing(Sungero.Presentation.FormShowingEventArgs e)
    {
      e.Params.AddOrUpdate(Constants.ArchiveSetting.SaveFromUIParamName, true);
      _obj.State.Properties.SourceUid.IsRequired = true;
    }

  }
}