public async void addcollab() { var github = new GitHubClient(new ProductHeaderValue("OctoAto"), new InMemoryCredentialStore(new Credentials("594a631687ce87bf18617fab4933d7176b66b682"))); string repo = RepoList.GetItemText(RepoList.SelectedItem); await github.Repository.Collaborator.Add("ttatotab", repo, userName.Text); MessageBox.Show("Done!"); }
IEnumerator GetRandomRepo(string user) { UnityWebRequest www = UnityWebRequest.Get("https://api.github.com/users/" + user + "/repos?per_page=10"); yield return(www.SendWebRequest()); if (www.responseCode == 200) { repoList = JsonUtility.FromJson <RepoList>("{\"repos\":" + www.downloadHandler.text + "}");; } }
private List <T> getListData <T>(int IDIdentity, string idReferenceColName) where T : class { List <SearchField> param = new System.Collections.Generic.List <SearchField>(); param.Add(new SearchField { Name = idReferenceColName, Operator = "=", Value = IDIdentity.ToString() }); RepoList list = new RepoList(); var myList = list.ListData <T>(param); var myListData = myList.ReturnValue[0].ReturnValue; return((myList.IsSuccessConnection & myList.IsSuccessQuery & myListData.Count > 0) ? myListData : null); }
public static void Main(string[] cmdArgs) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { Strings.Load(); // <--- leave breakpoint here in case of starting wrong project by accident! Globals.Root.Log("Initialised bootstrap"); string parameter = ""; if (cmdArgs != null && (cmdArgs.Length - 1) >= 0) { parameter = cmdArgs[0]; // version number } #if DEBUG parameter = "0.15.0"; #endif // can be followed by /Auto (checked in frmUpdate) if (parameter == "") { MessageBox.Show(Strings.Item("Install_NoDirect")); // the application must have been run directly by the user return; } Globals.Root.Log("Parameter = " + parameter); Version = parameter; string versionFile = Globals.Root.UpdateFolder + "\\" + Version + ".repo"; if (!File.Exists(versionFile)) { MessageBox.Show("Cannot locate index file: " + versionFile); return; } Globals.Root.Log("Version file exists"); RepoVersion version = RepoList.LoadVersionFile(versionFile); if (version.Signature != "" && !string.Equals(version.Signature, version.CalculateSignature(), StringComparison.CurrentCultureIgnoreCase)) { MessageBox.Show("Update index cannot be used, it has an invalid signature. The index that has been downloaded is not a true copy of the index."); return; } version.SetLocalPath(Globals.Root.InternalFolder + "\\"); version.SetLocalPath("%shared%", Globals.Root.SharedFolder + "\\"); Globals.Root.Log("Opening form"); frmUpdate form = new frmUpdate(version); Application.Run(form); } catch (Exception ex) when(!Globals.Root.IsDebug) { MessageBox.Show(ex.ToString()); } }
//update all all field,If forget update data entity, so auto fill from db record public T SetPreparationEntity <T>(T entity) where T : class { var propIdentity = ColumnPropGet.GetInstance.GetIdentityColumnProps <T>(); RepoList repo = new RepoList(); if (propIdentity != null) { object identityID = propIdentity.GetValue(entity); List <SearchField> lsf = new List <SearchField>(); lsf.Add(new SearchField { Name = propIdentity.Name, Operator = "=", Value = identityID.ToString() }); var checkEntityList = repo.ListData <T>(lsf); var checkEntityListData = (List <T>)checkEntityList.ReturnValue[0].ReturnValue; if (checkEntityList != null & checkEntityList.IsSuccessConnection & checkEntityList.IsSuccessQuery & (checkEntityListData).Count > 0) { var colNull = ColumnPropGet.GetInstance.GetPropertyColNullOnly <T>(entity); var checkEntity = checkEntityListData[0]; foreach (PropertyInfo itemPropUpdate in colNull) { // update tblEntity var itemPropUpdateValue = itemPropUpdate.GetValue(checkEntity); ColumnPropSet.GetInstance.SetColValue <T>(entity, itemPropUpdate.Name, itemPropUpdateValue); } TypeBantuan tipe = new TypeBantuan(); var propUpdateDate = ColumnPropGet.GetInstance.GetColumnProps <T>(MiscClass.MiscClass.ArrayUpdateDate); var propUpdateBy = ColumnPropGet.GetInstance.GetColumnProps <T>(MiscClass.MiscClass.ArrayUpdateBy); if (propUpdateDate != null) { if (propUpdateDate.CanWrite) { if (ColumnPropGet.GetInstance.GetIsNullDatetime <T>(propUpdateDate, entity)) { object objUpdateDate = tipe.DictTypes[ColumnPropGet.GetInstance.GetColumnType(propUpdateDate)].GetDefaultValue(false); propUpdateDate.SetValue(entity, objUpdateDate); } } } if (propUpdateBy != null) { if (propUpdateBy.CanWrite) { object objpic = ColumnPropSet.GetInstance.SetColumnPicValue <T>(propUpdateBy, entity); propUpdateBy.SetValue(entity, objpic); } } } } return(entity); }
private List <T> GetListData <T>(List <int> listIDIdentity, string idReferenceColName) where T : class { List <SearchField> param = new System.Collections.Generic.List <SearchField> { new SearchField { Name = idReferenceColName, Operator = "in", Value = listIDIdentity } }; RepoList list = new RepoList(); var myList = list.ListData <T>(param); var myListData = (List <T>)myList.ReturnValue[0].ReturnValue; return((myList.IsSuccessConnection & myList.IsSuccessQuery & myListData.Count > 0) ? myListData : null); }
private void SearchBar_TextChanged(object sender, TextChangedEventArgs e) { RepoList.BeginRefresh(); if (string.IsNullOrEmpty(e.NewTextValue)) { RepoList.ItemsSource = r.RepositoriesListM; } else { RepoList.ItemsSource = r.RepositoriesListM.Where(x => x.Owner.Login.StartsWith(e.NewTextValue) || x.Name.StartsWith(e.NewTextValue)); } RepoList.EndRefresh(); }
public ActionResult Index(string id) { string path = GetRepoServerPath(); ViewBag.SearchTerm = id; RepoList rl = new RepoList(); System.IO.DirectoryInfo dirinf = new System.IO.DirectoryInfo(path); foreach (System.IO.DirectoryInfo di in dirinf.EnumerateDirectories()) { GitManager.GitRepository repo = GitManager.GitRepository.CreateInstance(di); if (!repo.IsGitRepo) { continue; } int pos = 1; if (!string.IsNullOrWhiteSpace(id)) { pos = System.Globalization.CultureInfo.InvariantCulture .CompareInfo.IndexOf(repo.Name, id, System.Globalization.CompareOptions.IgnoreCase); } if (pos != -1) { rl.Repositories.Add(repo); } } // Next di rl.Repositories.Sort( delegate(GitManager.GitRepository g1, GitManager.GitRepository g2) { //return g1.Name.CompareTo(g2.Name); // ASC // return g1.LastModified.CompareTo(g2.LastModified);// ASC return(g2.LastModified.CompareTo(g1.LastModified)); // DESC } ); return(View(rl)); } // End Action Index
public bool IsContinueUpdateAfterMultiplePK <T>(T entity, out EFReturnValue returnValue) where T : class { // if true, continue to next query returnValue = new EFReturnValue { IsSuccessConnection = false, IsSuccessQuery = false, ErrorMessage = ErrorMessage.EntityCannotBeNull, ReturnValue = null }; bool result = true; if (isUsingMultiplePK) { List <SearchField> lsfMultiplePK = new List <SearchField>(); bool isMultiple = this.CheckIsMultiplePKUpdate <T>(entity, out lsfMultiplePK); if (isMultiple) { RepoList repoList = new RepoList(); var cekList = repoList.ListData <T>(lsfMultiplePK); if (cekList.IsSuccessConnection & cekList.IsSuccessQuery) { if (cekList.ReturnValue.ReturnValue != null) { var dataList = (List <T>)cekList.ReturnValue.ReturnValue; if (dataList != null) { if (dataList.Count >= 1) { result = false; var PIdentity = ColumnPropGet.GetInstance.GetIdentityColumnProps <T>();// Identity PK/identity PK like, means ordinary position must set to 0 in database table foreach (var item in lsfMultiplePK) { if (item.Name != PIdentity.Name) { multipleErrorMessage += item.Name + " , "; } } multipleErrorMessage += " columns"; returnValue.SetEFReturnValue(returnValue, false, 0, multipleErrorMessage); } } } } } } return(result); }
public bool IsContinueSaveAfterMultiplePK <T>(T entity, out EFReturnValue returnValue) where T : class { // if true, continue to next query returnValue = new EFReturnValue { IsSuccessConnection = false, IsSuccessQuery = false, ErrorMessage = ErrorMessage.EntityCannotBeNull, ReturnValue = null }; bool result = true; if (isUsingMultiplePK) { List <SearchField> lsfMultiplePK = new List <SearchField>(); bool isMultiple = this.CheckIsMultiplePKSave <T>(entity, out lsfMultiplePK); if (isMultiple) { RepoList repoList = new RepoList(); var cekList = repoList.ListData <T>(lsfMultiplePK); if (cekList.IsSuccessConnection & cekList.IsSuccessQuery) { if (cekList.ReturnValue.ReturnValue != null) { var dataList = (List <T>)cekList.ReturnValue.ReturnValue; if (dataList != null) { if (dataList.Count >= 1) { result = false; foreach (var item in lsfMultiplePK) { multipleErrorMessage += item.Name + ","; } multipleErrorMessage += " columns"; returnValue.SetEFReturnValue(returnValue, false, 0, multipleErrorMessage); } } } } } } return(result); }
public int Save(Layout elem) { RepoList.Add(elem as Layout); return(elem.Id); }
public int Save(Event elem) { RepoList.Add(elem as Event); return(elem.Id); }
public int Save(Venue elem) { RepoList.Add(elem as Venue); return(elem.Id); }
public int Save(Area elem) { RepoList.Add(elem as Area); return(elem.Id); }
public int Save(Seat elem) { RepoList.Add(elem as Seat); return(elem.Id); }