public XamlUI Load(string xamlURI, string suffix) { if (string.IsNullOrEmpty(suffix)) { return(this.Load(xamlURI)); } try { if (string.IsNullOrEmpty(xamlURI)) { throw new ArgumentNullException("xamlURI"); } string key = xamlURI + string.Format("({0})", suffix); if (!this.UIDictionary.ContainsKey(key)) { if (xamlURI.EndsWith(".xaml", true, null)) { XamlUI lui = XamlHelper.ConvertXamlToUI(xamlURI, suffix); this.UIDictionary.Add(key, lui); } else if (xamlURI.EndsWith(".dll", true, null)) { XamlUI lui2 = XamlHelper.ConvertDLLToUI(xamlURI, suffix); this.UIDictionary.Add(key, lui2); } else { XamlUI lui3 = XamlHelper.ConvertXmlToUI(xamlURI, suffix); this.UIDictionary.Add(key, lui3); } } return(this.UIDictionary[key]); } catch (Exception exception) { MessageBox.Show(exception.Message); return(null); } }
public XamlUI Load(string xamlURI) { try { if (this.expired) { throw new Exception("Invalid License Information!"); } if (string.IsNullOrEmpty(xamlURI)) { throw new ArgumentNullException("xamlURI"); } if (!this.UIDictionary.ContainsKey(xamlURI)) { if (xamlURI.EndsWith(".xaml", true, null)) { XamlUI lui = XamlHelper.ConvertXamlToUI(xamlURI); this.UIDictionary.Add(xamlURI, lui); } else if (xamlURI.EndsWith(".dll", true, null)) { XamlUI lui2 = XamlHelper.ConvertDLLToUI(xamlURI); this.UIDictionary.Add(xamlURI, lui2); } else { XamlUI lui3 = XamlHelper.ConvertXmlToUI(xamlURI); this.UIDictionary.Add(xamlURI, lui3); } } return(this.UIDictionary[xamlURI]); } catch (Exception exception) { MessageBox.Show(exception.Message); return(null); } }