コード例 #1
0
        private NameValueCollection GetModifiedProperties(WorkItemProperties propertyUpdate)
        {
            var modifiedProperties = new NameValueCollection(_properties);

            foreach (var key in propertyUpdate.AllKeys)
            {
                var newValue = propertyUpdate[key];

                if (string.IsNullOrEmpty(newValue))
                {
                    modifiedProperties.Remove(key);
                }
                else
                {
                    modifiedProperties[key] = newValue;
                }
            }
            return(modifiedProperties);
        }
コード例 #2
0
        public WorkItem UpdateProperties(WorkItemProperties properties)
        {
            var modifiedProperties = GetModifiedProperties(properties);

            return(new WorkItem(Id, Path, Classes, Status, Parent, _ordinal, modifiedProperties, Timestamp, LastMoved));
        }