Пример #1
0
        //TODO: Refactor this member variable for thread safety
        // private string _importHash = ""; //prevents duplicate import

        /// <summary>
        /// Returns a bindable collection for a XAML control.
        /// </summary>
        public ObservableCollection <ToolkitContents> GetToolkits(RuleApplicationDef dest)
        {
            ObservableCollection <ToolkitContents> toolkits = new ObservableCollection <ToolkitContents>();

            foreach (XmlSerializableStringDictionary.XmlSerializableStringDictionaryItem att in dest.Attributes.Default)
            {
                if (att.Key.Contains("Toolkit:"))
                {
                    string          key = att.Key.Substring(8, att.Key.Length - 8); //trim toolkit prefix
                    ToolkitContents tk  = new ToolkitContents();
                    ParseKey(key, tk);
                    tk.Contents = GetToolkitContents(key, dest);
                    toolkits.Add(tk);
                }
            }
            return(toolkits);
        }
Пример #2
0
 internal void ParseKey(string key, ToolkitContents toolkit)
 {
     toolkit.Name     = key.Split(',')[0];
     toolkit.Revision = key.Split(',')[1];
     toolkit.GUID     = key.Split(',')[2];
 }