Пример #1
0
 private void QueryVCDPropertyInterface(VCDPropertyElement elem)
 {
     foreach (VCDPropertyInterface itf in elem)
     {
         foreach (var Project in _projects)
         {
             CreateCode(itf, Project);
         }
     }
 }
Пример #2
0
        private string getPropertyName(VCDPropertyElement Element)
        {
            String Name = "";
            var    map  = new Dictionary <string, string>();

            map.Add("{284C0E0D-010B-45BF-8291-09D90A459B28}:{B57D3002-0AC6-4819-A609-272A33140ACA}", "WhiteBalance_One_Push");
            map.Add("{284C0E0D-010B-45BF-8291-09D90A459B28}:{ 6519038B-1AD8-4E91-9021-66D64090CC85}", "WhiteBalance_Red");
            map.Add("{284C0E0D-010B-45BF-8291-09D90A459B28}:{8407E480-175A-498C-8171-08BD987CC1AC}", "WhiteBalance_Green");
            map.Add("{284C0E0D-010B-45BF-8291-09D90A459B28}:{6519038A-1AD8-4E91-9021-66D64090CC85}", "WhiteBalance_Blue");
            map.Add("{90D5702E-E43B-4366-AAEB-7A7A10B448B4}:{65190390-1AD8-4E91-9021-66D64090CC85}", "Exposure_MaxAutoAuto");

            string mapValue;

            if (map.TryGetValue(Element.Parent.ItemID.ToString() + ":" + Element.ElementID.ToString(), out mapValue))
            {
                Name = mapValue;
            }
            else
            {
                if (Element.Name == "Value")
                {
                    Name = Element.Parent.Name;
                }
                else
                {
                    Name = Element.Parent.Name + " " + Element.Name.Replace(Element.Parent.Name, "").Trim();
                }
            }
            String AllowedChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyxz0123456789_";

            for (int i = 0; i < Name.Length; i++)
            {
                if (AllowedChars.IndexOf(Name[i]) == -1)
                {
                    Name = Name.Replace(Name[i], '_');
                }
            }
            return(Name);
        }