Наследование: Caliburn.Micro.PropertyChangedBase, IDirectoryPath
 public IEnumerable<IDebugState> GetDebugStates(string serverWebUri, DirectoryPath directory, FilePath filePath)
 {
     var webclient = new WebClient { Credentials = CredentialCache.DefaultCredentials };
     var address = String.Format(serverWebUri + "{0}/{1}?DirectoryPath={2}&FilePath={3}",
         "Services", "DebugStateService", directory.PathToSerialize, filePath.Title);
     var datalistJson = webclient.UploadString(address, string.Empty);
     return JsonConvert.DeserializeObject<IList<DebugState>>(datalistJson);
 }
Пример #2
0
        /// <summary>
        /// Gets the log files from the server (using webclient).
        /// </summary>
        /// <param name="server">The server.</param>
        /// <param name="directory">The directory.</param>
        /// <returns></returns>
        /// <author>Jurie.smit</author>
        /// <date>2013/05/24</date>
        public IEnumerable<FilePath> GetLogFiles(IEnvironmentModel server, DirectoryPath directory)
        {
            LogFiles.Clear();

            if(server == null || directory == null)
            {
                return new List<FilePath>();
            }

            var address = String.Format(server.Connection.WebServerUri + "{0}/{1}?DirectoryPath={2}",
                "Services", "FindDirectoryService", directory.PathToSerialize);
            var datalistJson = WebClient.UploadString(address, string.Empty);
            if(datalistJson.Contains("Error"))
            {
                var error = "Error: Log directory not found." + Environment.NewLine +
                            datalistJson.GetManagementPayload();
                ShowErrorPopup(error);
            }
            else
            {
                var filePaths = JsonConvert.DeserializeObject<List<FilePath>>(datalistJson);
                filePaths.ForEach(fp =>
                    {
                        if(fp.Title.EndsWith(".wwlfl"))
                        {
                            LogFiles.Add(fp);
                        }
                    });
                return filePaths;
            }
            return new List<FilePath>();
        }
Пример #3
0
 public IEnumerable<IDebugState> GetDebugStates(string serverWebUri, DirectoryPath directory, FilePath path)
 {
     var list = new List<DebugState>
     {
         new DebugState
         {
             StateType = StateType.Before,
             ServerID = ServerID,
             ParentID = Guid.Empty,
             ID = Workflow1ID,
             DisplayName = "Workflow1",
             HasError = false,
             Name = "DsfActivity",
             ActivityType = ActivityType.Workflow,
             StartTime = _startDate,
             EndTime = _startDate.AddMinutes(1)
         },
         new DebugState
         {
             StateType = StateType.All,
             ServerID = ServerID,
             ParentID = Workflow1ID,
             ID = Assign1ID,
             DisplayName = "Assign1",
             HasError = false,
             Name = "Assign",
             ActivityType = ActivityType.Step,
             StartTime = _startDate.AddMinutes(1),
             EndTime = _startDate.AddMinutes(2)
         },
         new DebugState
         {
             StateType = StateType.Before,
             ServerID = ServerID,
             ParentID = Workflow1ID,
             ID = Workflow2ID,
             DisplayName = "Workflow2",
             HasError = false,
             Name = "DsfActivity",
             ActivityType = ActivityType.Step,
             StartTime = _startDate.AddMinutes(2),
             EndTime = _startDate.AddMinutes(3)
         },
         new DebugState
         {
             StateType = StateType.All,
             ServerID = ServerID,
             ParentID = Workflow2ID,
             ID = Assign2ID,
             DisplayName = "Assign2",
             HasError = false,
             Name = "Assign",
             ActivityType = ActivityType.Step,
             StartTime = _startDate.AddMinutes(3),
             EndTime = _startDate.AddMinutes(4)
         },
         new DebugState
         {
             StateType = StateType.After,
             ServerID = ServerID,
             ParentID = Workflow1ID,
             ID = Workflow2ID,
             DisplayName = "Workflow2",
             HasError = false,
             Name = "DsfActivity",
             ActivityType = ActivityType.Step,
             StartTime = _startDate.AddMinutes(4),
             EndTime = _startDate.AddMinutes(5)
         },
         new DebugState
         {
             StateType = StateType.After,
             ServerID = ServerID,
             ParentID = Guid.Empty,
             ID = Workflow1ID,
             DisplayName = "Workflow1",
             HasError = false,
             Name = "DsfActivity",
             ActivityType = ActivityType.Workflow,
             StartTime = _startDate.AddMinutes(5),
             EndTime = _startDate.AddMinutes(6)
         },
         new DebugState
         {
             StateType = StateType.All,
             ServerID = ServerID,
             ParentID = Guid.Empty,
             ID = Assign3ID,
             DisplayName = "Assign3",
             HasError = false,
             Name = "Assign",
             ActivityType = ActivityType.Step,
             StartTime = _startDate.AddMinutes(6),
             EndTime = _startDate.AddMinutes(7)
         }
     };
     return list;
 }