} // ConfigurationItems private void ConfigurationForm_Load(object sender, EventArgs e) { listViewConfigItems.TileSize = new Size(listViewConfigItems.Width - SystemInformation.VerticalScrollBarWidth - 2, listViewConfigItems.LargeImageList.ImageSize.Height + 6); foreach (var configItem in ConfigurationItems) { var registration = configItem.Registration; using (var img = registration.EditorImage) { listViewConfigItems.LargeImageList.Images.Add(img); } // using configItem.Editor = registration.CreateEditor(AppUiConfiguration.CloneSettings <IConfigurationItem>(configItem.ExistingData)); var item = new ListViewItem(registration.EditorDisplayName); item.ImageIndex = imageListConfigItems.Images.Count - 1; item.Tag = configItem.Editor; listViewConfigItems.Items.Add(item); } // foreach if (listViewConfigItems.Items.Count > 0) { listViewConfigItems.Items[0].Selected = true; } // if } // ConfigurationForm_Load
} // Current public static AppUiConfiguration CreateForUserConfig(UserConfig userConfig) { AppUiConfiguration config; config = new AppUiConfiguration(); config.User = userConfig; return(config); } // CreateForUserConfig
} // Load public static AppUiConfiguration LoadRegistryAppConfiguration(out InitializationResult initializationResult) { AppUiConfiguration config; config = new AppUiConfiguration(); initializationResult = config.LoadRegistrySettings(null); if (initializationResult.IsError) { return(null); } return(config); } // LoadRegistryAppConfiguration
} // CreateForUserConfig public static InitializationResult Load(string overrideBasePath, Action <string> displayProgress) { AppUiConfiguration config; InitializationResult result; displayProgress?.Invoke(Properties.Texts.LoadProgress_Start); config = new AppUiConfiguration(); result = config.LoadBasicConfiguration(overrideBasePath); if (result.IsError) { return(result); } displayProgress?.Invoke(Properties.Texts.LoadProgress_UserConfig); result = config.LoadUserConfiguration(); if (result.IsError) { return(result); } result = config.RegisterConfigurationItems(); if (result.IsError) { return(result); } result = config.ProcessXmlConfigurationItems(); if (result.IsError) { return(result); } displayProgress?.Invoke(Properties.Texts.LoadProgress_ContentProvider); result = config.LoadIpTvProviderData(); if (result.IsError) { return(result); } Current = config; return(InitializationResult.Ok); } // Load