コード例 #1
0
 public static List <ListOfValue> GetListOfValue(this List <List <Value> > list)
 {
     return(list.Select(o =>
     {
         var listOfValue = new ListOfValue();
         listOfValue.Value.Add(o.GetValueData());
         return listOfValue;
     }).ToList());
 }
コード例 #2
0
        public bool DownloadImage(TaxonomyInfo taxonomy, Attribute attribute = null, ListOfValue lov = null)
        {
            bool success = false;

            if (!(String.IsNullOrEmpty(RemoteImageGuid) || String.IsNullOrEmpty(LocalDirectory)) && Directory.Exists(LocalDirectory))
            {
                // get fully formed name
                string localName = GetLocalName(taxonomy, attribute, lov);
                LocalImageName = LocalDirectory + "\\" + localName;

                // download file
                success = FetchImage(HttpDir + _projectId + "/" + RemoteImageGuid + OriginalImageExtension, LocalImageName);
            }
            else
            {
                LocalImageName = "";
            }
            return(success);
        }
コード例 #3
0
        private string GetLocalName(TaxonomyInfo taxonomy, Attribute attribute, ListOfValue lov)
        {
            // this is only a sketch
            var localName = new StringBuilder();

            localName.Append(CleanName(taxonomy.TaxonomyData.NodeName));
            if (attribute != null)
            {
                localName.Append("(" + CleanName(attribute.AttributeName) + ")");
            }

            if (lov != null)
            {
                localName.Append("[" + CleanName(lov.Value) + "]");
            }

            localName.Append(OriginalImageExtension);

            return(localName.ToString());
        }