private bool CanAnalyzeAPI(DocsAPI api) { bool result = false; foreach (DocsAssemblyInfo apiAssembly in api.AssemblyInfos) { foreach (string excluded in Config.ExcludedAssemblies) { if (apiAssembly.AssemblyName.StartsWith(excluded)) { return(false); // No more analysis required } } foreach (string included in Config.IncludedAssemblies) { if (apiAssembly.AssemblyName.StartsWith(included)) { result = true; // Almost done, need to check types if needed break; } } if (result) { return(IsTypeAllowed(api)); } } return(result); }
private void DownloadTourney_Load(object sender, EventArgs e) { this.Enabled = false; this.Opacity = 0.75; m_le = new LoadingEvents("Loading Online Tourney List"); m_le.StartPosition = FormStartPosition.CenterParent; m_da = new DocsAPI("*****@*****.**", "kibitzer"); CustomBackgroundWorker cbw = new CustomBackgroundWorker("List Online Tourneys", m_da.getListOfFoldersInBackground, tourneysImported, null, null, null, null); cbw.run(Path.Combine("Indian Bridge Scorer", "Tourneys")); m_le.ShowDialog(this); }
private void UploadTourney_Load(object sender, EventArgs e) { label1.Text = "Uploading " + Constants.CurrentTourneyName + " to Google Docs"; Dictionary <string, string> fileFilters = new Dictionary <string, string>(); fileFilters.Add(".ini", "text/plain"); fileFilters.Add(".mdb", "application/msaccess"); DocsAPI m_da = new DocsAPI("*****@*****.**", "kibitzer"); CustomBackgroundWorker m_cbw = new CustomBackgroundWorker("Upload to Google Docs", m_da.uploadDirectoryToGoogleDocsInBackground, uploadCompleted, operationStatus, operationProgressBar, operationCancelButton, null); Tuple <string, string, Dictionary <string, string> > values = new Tuple <string, string, Dictionary <string, string> >(Constants.getCurrentTourneyFolder(), Path.Combine("Indian Bridge Scorer", "Tourneys"), fileFilters); m_cbw.run(values); }
private bool IsTypeAllowed(DocsAPI api) { // All types are allowed if (Config.ExcludedTypes.Count() == 0 && Config.IncludedTypes.Count() == 0) { return(true); } string typeName; string typeFullName; if (api is DocsType) { DocsType type = (DocsType)api; typeName = type.Name; typeFullName = type.FullName; } else if (api is DocsMember) { DocsMember member = (DocsMember)api; typeName = member.ParentType.Name; typeFullName = member.ParentType.FullName; } else { throw new InvalidCastException(); } if (Config.ExcludedTypes.Count() > 0) { if (Config.ExcludedTypes.Contains(typeName) || Config.ExcludedTypes.Contains(typeFullName)) { return(false); } } if (Config.IncludedTypes.Count() > 0) { if (Config.IncludedTypes.Contains(typeName) || Config.IncludedTypes.Contains(typeFullName)) { return(true); } } return(false); }