private object GetValue(PropertyDescriptor prop, TaskItem item, SlideType type) { Repository.Utility.WriteLog("GetValue started", System.Diagnostics.EventLogEntryType.Information); object retVal = prop.GetValue(item); //TODO Delete Later //if (type == SlideType.Chart && prop.Name == "Task") // retVal = String.Format("{0}: {1}", item.Task, item.Finish.HasValue ? item.Finish.Value.ToString("MM/dd") : String.Empty); Repository.Utility.WriteLog("GetValue completed successfully", System.Diagnostics.EventLogEntryType.Information); return retVal; }
private static void BuildListItem(SPListItem newItem, TaskItem task) { var dPathsField = newItem.ParentList.Fields[Constants.FieldId_DrivingPath] as SPFieldMultiChoice; var dShownField = newItem.ParentList.Fields[Constants.FieldId_ShowOn] as SPFieldMultiChoice; newItem[SPBuiltInFieldId.Title] = task.ID; newItem[Constants.FieldId_UniqueID] = task.UniqueID; SPFieldMultiChoiceValue value = GetDrivingPaths(task.DrivingPath) as SPFieldMultiChoiceValue; if (value != null) { for (int i = 0; i < value.Count; i++) { if (!dPathsField.Choices.Contains(value[i])) { dPathsField.Choices.Add(value[i]); } } } newItem[Constants.FieldId_DrivingPath] = GetDrivingPaths(task.DrivingPath); newItem[Constants.FieldId_Task] = task.Task; newItem[Constants.FieldId_Duration] = (task.Finish.HasValue && task.Start.HasValue) ? task.Finish.Value.Subtract(task.Start.Value).Days.ToString() + " days" : String.Empty; newItem[Constants.FieldId_Predecessor] = task.Predecessor; newItem[Constants.FieldId_Start] = task.Start; newItem[Constants.FieldId_Finish] = task.Finish; newItem[Constants.FieldId_Deadline] = task.Deadline; value = ConvertToMultiChoiceValue(task.ShowOn) as SPFieldMultiChoiceValue; if (value != null) { for (int i = 0; i < value.Count; i++) { if (!dShownField.Choices.Contains(value[i])) { dShownField.Choices.Add(value[i]); } } } newItem[Constants.FieldId_ShowOn] = ConvertToMultiChoiceValue(task.ShowOn); newItem[Constants.FieldId_ModifiedOn] = task.ModifiedOn; newItem[Constants.FieldId_PercentComplete] = task.WorkCompletePercentage; }
private object GetValue(PropertyDescriptor prop, TaskItem item, SlideType type) { object retVal = prop.GetValue(item); if (type == SlideType.Chart && prop.Name == "Task") retVal = String.Format("{0}: {1}", item.Task, item.Finish.HasValue ? item.Finish.Value.ToString("MM/dd") : String.Empty); return retVal; }