コード例 #1
0
 public void Handle(UpdateResourceMessage message)
 {
     if (message?.ResourceModel != null)
     {
         if (SourceId != Guid.Empty && SourceId == message.ResourceModel.ID)
         {
             IErrorInfo sourceNotAvailableMessage = ValidationMemoManager.DesignValidationErrors.FirstOrDefault(info => info.Message == ValidationMemoManager.SourceNotFoundMessage);
             if (sourceNotAvailableMessage != null)
             {
                 ValidationMemoManager.RemoveError(sourceNotAvailableMessage);
                 ValidationMemoManager.UpdateWorstError();
                 MappingManager.InitializeMappings();
                 MappingManager.UpdateMappings();
             }
         }
     }
 }
コード例 #2
0
        void UpdateDesignerAfterResourceLoad(IServerRepository serverRepository)
        {
            if (!IsDeleted)
            {
                MappingManager.InitializeMappings();
                ValidationMemoManager.InitializeLastValidationMemo(_environment);
                if (IsItemDragged.Instance.IsDragged)
                {
                    Expand();
                    IsItemDragged.Instance.IsDragged = false;
                }
            }
            var environmentModel = serverRepository.Get(EnvironmentID);

            if (EnvironmentID == Guid.Empty)
            {
                environmentModel = serverRepository.ActiveServer;
            }
            if (environmentModel?.Connection?.WebServerUri != null)
            {
                var servUri = new Uri(environmentModel.Connection.WebServerUri.ToString());
                var host    = servUri.Host;
                if (!host.Equals(FriendlySourceName, StringComparison.InvariantCultureIgnoreCase))
                {
                    FriendlySourceName = host;
                }
            }

            InitializeProperties();
            if (_environment != null)
            {
                _environment.AuthorizationServiceSet += OnEnvironmentOnAuthorizationServiceSet;
                AuthorizationServiceOnPermissionsChanged(null, null);
            }
            IsLoading = false;
            if (ResourceModel == null)
            {
                ValidationMemoManager.UpdateLastValidationMemoWithSourceNotFoundError();
            }
        }