public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.CompleteRecycler, container, false); view.FindViewById(Resource.Id.loading).Visibility = ViewStates.Visible; EmptyView = view.FindViewById <TextView>(Resource.Id.empty); ListView = view.FindViewById <RecyclerView>(Resource.Id.recycler); ListView.SetLayoutManager(new LinearLayoutManager(Android.App.Application.Context)); ListView.SetItemAnimator(new DefaultItemAnimator()); adapter = new BrowseAdapter((song, position) => { song = LocalManager.CompleteItem(song); SongManager.Play(song); }, (song, position) => { MainActivity.instance.More(song); }, (position) => { LocalManager.ShuffleAll(); }); ListView.SetAdapter(adapter); #pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed PopulateList(); #pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed return(view); }
public async Task <ActionResult> SaveFullEditChanges(EditLocalAdminViewModel model) { if (ModelState.IsValid) { ApplicationUser user = await UserManager.FindByEmailAsync(model.Email); bool error = false; if (!string.IsNullOrEmpty(model.NewPassword)) { var result = UserManager.ChangePassword(user.Id, model.Password, model.NewPassword); if (!result.Succeeded) { ModelState["Password"].Errors.Add("Senha incorreta"); error = true; } } if (!error) { user = await UserManager.FindByEmailAsync(model.Email); LocalManager localAdmin = model.ToLocalAdmin(user.PasswordHash); BusinessManager.Instance.LocalManagers.Update(localAdmin); return(RedirectToAction("Index", "GlobalAdmin")); } } return(View("FullEdit", model)); }
public AutoMove(RandomWalker randomWalker, LocalManager lm) { this.randomWalker = randomWalker; this.localManager = lm; randomWalker.StartCoroutine(MoveAround()); }
public IActionResult About() { ViewData["StartupTimeDate"] = ""; ViewData["Alive"] = ""; ViewData["Stats"] = ""; if (_signInManager.IsSignedIn(User)) { TZone tzone = LocalManager.GetUserTimeZone(HttpContext, User, _userManager, _signInManager, _db) .GetAwaiter().GetResult(); ViewData["StartupTimeDate"] = "Startup Time " + tzone.Local(Globals.StartupDateTime).ToShortTimeString() + " " + tzone.Local(Globals.StartupDateTime).ToShortDateString() + " " + tzone.Abbreviation; TimeSpan timeSpan = Globals.Uptime(); ViewData["Alive"] = "System up: " + timeSpan.Days + " Days " + timeSpan.Hours + " Hours " + timeSpan.Minutes + " Minutes " + timeSpan.Seconds + " Seconds"; long count = _db.NoteHeader.Count(); long basenotes = _db.NoteHeader .Count(p => p.ResponseOrdinal == 0); ViewData["Stats"] = "Base Notes: " + basenotes + ", Responses: " + (count - basenotes) + ", Total Notes: " + count; } ViewData["Message"] = "About Notes 2021 : " + ViewData["StartupTimeDate"]; return(View()); }
public void Start() { /*TODO: I want these Console calls to be done via some ILogger interface. In this class it's useless, but since I don't want * Console to be used in other namespaces - I want them to receive the ILogger and just write stuff to Debug, Error etc log. * So for Console app I'd be able to use simple class that would write to Console as an ILogger implementation.*/ var backupsFolder = LoadGoogleBackupsFolder(); var localDataRoot = LocalManager.GetTree(@"G:\Coding\GoogleDriveClient\Data"); PrintTree(backupsFolder, localDataRoot); var navigator = new TreeNavigator(backupsFolder, localDataRoot, GoogleManager, LocalManager, FileCacheManager); /*TODO: Here's one big todo. I have an issue with INodes children because sometimes I have only IDs there, and sometimes - full data. * Another thing is that I use GetTree to get children names. * So my assumption is - Children should _always_ have objects. Maybe I'd better hide list of IDs in some private property of a Node and Children collection would be empty until I'll fill it * It's also worth to check if it's faster to ask Google for object info by ID - without getting any children info - I mean it could be useful for getting children names*/ while (true) { Console.WriteLine("Enter a name of a folder to open or press enter to go up"); var folderToOpen = Console.ReadLine(); if (String.IsNullOrEmpty(folderToOpen)) { navigator.NavigateBothTreesUp(); } else { navigator.NavigateBothTreesDown(folderToOpen); } PrintTree(navigator.GetCurrentGoogleNode(), navigator.GetCurrentLocalNode()); } }
static void RunLocal(string[] config) { var mng = new LocalManager() { inputConn_Port = int.Parse(config[1]), outputConn_Host = config[2], outputConn_Port = int.Parse(config[3]) }; Console.WriteLine($"当前为 本地端口转发工具:"); Console.WriteLine($"inputConn_Port:{mng.inputConn_Port}"); Console.WriteLine($"outputConn_Host:{mng.outputConn_Host}"); Console.WriteLine($"outputConn_Port:{mng.outputConn_Port}"); //定义显示输出 if (config.Length <= 4 || "NoPrint" != config[4]) { mng.ConsoleWriteLine = Console.WriteLine; } mng.ConsoleWriteLine("开始..."); mng.StartLinstening(); }
private void ListView_ItemClick(object sender, int position) { if (sections[position].contentType == SectionType.Shuffle) { LocalManager.ShuffleAll(); } }
private void Canvas_ExamineMode_SettingReference(object sender, SettingReferenceEventArgs e) { aimMetaInfo = e.AimMarker.GetComponent <MetaInfo>(); examineMetaInfo = e.ExamineMarker.GetComponent <MetaInfo>(); pcLocalManager = e.PC.GetComponent <LocalManager>(); }
/// <summary> /// Созадает младший состав работников отдела (Вспомогательный метод) /// </summary> /// <param name="count">Количество работников</param> /// <param name="dep">Экземпляр отдела</param> /// <returns>Коллекцию работников</returns> ObservableCollection <Person> First_Level_Employees(int count, AbsDepartment dep) { Random random = new Random(Guid.NewGuid().GetHashCode()); ObservableCollection <Person> employees = new ObservableCollection <Person>(); int interns = random.Next(0, count / 3); int empl = count - interns; int hw = (count / random.Next(4, 9)) + 1; for (int i = 0; i < interns; i++) { Intern inter = new Intern($"Интерн_{i}", $"Отдела_{dep.Id}", "Интерн", dep); inter.Salary = 25000; employees.Add(inter); } for (int i = 0; i < empl; i++) { Employee emp = new Employee($"Рабочий{i}", $"Отдела_{dep.Id}", "Сотрудник", dep); emp.Salary = 150; emp.Hours = random.Next(0, 200); employees.Add(emp); } for (int i = 0; i < hw; i++) { LocalManager wkr = new LocalManager($"Главарь{i}", $"Отдела_{dep.Id}", "Руководитель отдела", dep); wkr.CoefSalary = 0.15; wkr.LowSalary = 1000; employees.Add(wkr); } return(employees); }
// GET: Sequencers/Create public IActionResult Create() { // Get a list of all file names for dropdown IEnumerable <SelectListItem> items = LocalManager.GetFileNameSelectList(_db); List <SelectListItem> list2 = new List <SelectListItem> { new SelectListItem { Value = "", Text = "-- Select a File --" } }; list2.AddRange(items); Notes2021.Models.ExportViewModel it = new Notes2021.Models.ExportViewModel { AFiles = list2 }; // Get a list of all file titles for dropdown items = LocalManager.GetFileTitleSelectList(_db); list2 = new List <SelectListItem> { new SelectListItem { Value = "", Text = "-- Select a Title --" } }; list2.AddRange(items); it.ATitles = list2; return(View(it)); }
void Awake() { _Resolutions = Screen.resolutions; _LManager = GameObject.Find("Manager").GetComponent <LocalManager> (); _MainPauseContainer = transform.parent.Find("Main").gameObject; _OptionsContainer = transform.parent.Find("Options").gameObject; _ResolutionList = transform.parent.Find("Options").Find("Deroulant").Find("Resolutions").gameObject; }
public void Build(ILGenerator il) { this.il = il; this.locman = new LocalManager(il); this.protoman = new ProtoNameManager(); GenReadObject(root); il.Emit(OpCodes.Ret); }
public void Add_Deck(int rid) { Comm_UserDatas.Instance.Add_Deck(rid); LocalManager localManager = new LocalManager(); if (localManager.UserInfo != null) { localManager.UserInfo.__UpdateDeck__(); } }
public PlayStageState (Timer timer, PanelManager panelManager, LocalManager localManager, float timeLimit, int LimitOfCheck) : base(timer) { this.panelManager = panelManager; this.localManager = localManager; this.timer = timer; this.timeLimit = timeLimit; RemainingTime = timeLimit; HighScore = 0; RemainingCheckNum = LimitOfCheck; EndCondition = EndConditionType.time_over; }
public List <int> Add_Ship(List <int> ship_ids) { List <int> result = Comm_UserDatas.Instance.Add_Ship(ship_ids); LocalManager localManager = new LocalManager(); if (localManager.UserInfo != null) { localManager.UserInfo.__UpdateShips__(); } return(result); }
public override void OnStartLocalPlayer() { CmdSetPlayerId(PlayerPrefs.GetInt("player_id")); Piece.MyPointer = this; // カラーを設定 // 操作方法の決定 LocalManager localManager = FindObjectOfType <LocalManager> (); localManager.AddStartStageClient(this); localManager.AddEndStageClient(this); }
/// <summary> /// Create File Rename Command. /// </summary> /// <param name="dataSourceDefinition"></param> /// <param name="sourceFileName"></param> /// <param name="destinationFileName"></param> /// <param name="localManager"></param> /// <returns></returns> public static GatewayCommandFileRename CreateFileRenameCommand(DataSourceDefinition sourceDataSourceDefinition, DataSourceDefinition destinationDataSourceDefinition, LocalManager localManager) { GatewayCommandFileRename fileRenameCommand = new GatewayCommandFileRename(); fileRenameCommand.DataSourceDefinition = sourceDataSourceDefinition; fileRenameCommand.DestinationDataSourceDefinition = destinationDataSourceDefinition; fileRenameCommand.LocalManager = localManager; return(fileRenameCommand); }
public int AddLocalVar(ZCLocalVar localSymbol) { int index = LocalManager.Add(localSymbol); if (!localSymbol.IsAutoGenerated) { this.ProcSegmenter.AddWord(localSymbol.ZName); //localDefDict.Add(localSymbol.ZName, localSymbol); } return(index); }
public void Build(ILGenerator il) { this.il = il; this.locman = new LocalManager(il); this.protoman = new ProtoNameManager(); // Load root il.Emit(OpCodes.Ldarg_1); GenWriteObject(root); il.Emit(OpCodes.Ret); }
/// <summary> /// Create Gateway DbDisconnect command. /// </summary> /// <param name="localManager"></param> /// <param name="databaseName"></param> /// <returns></returns> public static GatewayCommandDbDisconnect CreateGatewayCommandDbDisconnect(LocalManager localManager, string databaseName) { GatewayCommandDbDisconnect dbDisconnectCommand = new GatewayCommandDbDisconnect(); dbDisconnectCommand.LocalManager = localManager; DataSourceDefinition datasourceDefinition = new DataSourceDefinition(); datasourceDefinition.DBaseName = databaseName.ToUpper(); dbDisconnectCommand.DataSourceDefinition = datasourceDefinition; return(dbDisconnectCommand); }
public async Task <ActionResult> Register(RegisterCollaboratorViewModel model) { if (ModelState.IsValid) { ApplicationUser user = model.ToApplicationUser(UserType.Collaborator); IdentityResult result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { Collaborator collaborator = model.ToCollaborator(user.PasswordHash); ApplicationUser localUser = User.Identity.GetApplicationUser(); LocalManager localManager = BusinessManager.Instance.LocalManagers.FindAll().SingleOrDefault(l => localUser.Email == l.Email); try { collaborator.Parking = BusinessManager.Instance.Parkings.FindAll().SingleOrDefault(p => p.LocalManager.CPF == localManager.CPF); BusinessManager.Instance.Collaborators.Add(collaborator); } catch (UniqueKeyViolationException ex) { ModelState["CPF"].Errors.Add(ex.Message); } // Enviar um email com este link string code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); await UserManager.SendEmailAsync(user.Id, "Confirmar sua conta Smart Parking System", "Olá, " + model.FirstName + "!<br/> Para começar a utilizar sua nova conta Smart Parking System,<br/> clique <a href=\"" + callbackUrl + "\">aqui</a>"); ViewBag.EmailSent = model.Email; return(RedirectToAction("Index", "LocalAdmin")); } else { var emailErrors = result.Errors.Where(e => e.Contains("email")); if (emailErrors.Count() > 0) { foreach (var error in emailErrors) { ModelState["Email"].Errors.Add(error); } } } } // Se chegamos até aqui e houver alguma falha, exiba novamente o formulário return(View(model)); }
// GET: NoteFileList /// <summary> /// Display list of NoteFiles /// </summary> /// <returns></returns> public async Task <IActionResult> Index() { HttpContext.Session.SetInt32("IsSearch", 0); TZone tz = await LocalManager.GetUserTimeZone(Request.HttpContext, User, _userManager, _signInManager, _db); ViewBag.TZ = tz; List <NoteFile> nf = await NoteDataManager.GetNoteFilesOrderedByName(_db); return(View(nf)); }
private void Canvas_World_CreatedWorld(object sender, EventArgs e) { GameObject pc = GetComponent <SearchObject>().Search(SubTag.PC)[0]; GameObject aim = GetComponent <SearchObject>().Search( SubTag.AimMarker)[0]; uiObjects = GetComponent <SearchUI>().Search(canvasTag); skillManager = pc.GetComponent <PCSkillManager>(); localManager = pc.GetComponent <LocalManager>(); aimMetaInfo = aim.GetComponent <MetaInfo>(); ClearModeline(); }
void Awake() { DontDestroyOnLoad(this.gameObject); if (_Manager == null) { _Manager = this; } else { Destroy(this.gameObject); } }
private void ProgressBar_EndingTurn(object sender, EndingTurnEventArgs e) { GameObject pc = GetComponent <SearchObject>().Search(SubTag.PC)[0]; LocalManager manager = pc.GetComponent <LocalManager>(); if (!manager.MatchID(e.ObjectID)) { return; } RemoveBar(); XCoordinate = GetXCoordinate(XCoordinate, minX, maxX); CreateBar(); }
public static Manager Fabriquer(string gestionnaire, Configuration laConfig = null) { Manager unManager = null; if (gestionnaire == "$LocalManager") { unManager = new LocalManager(new ElementFolder(@"d:\")); } else { unManager = new DistantManager(laConfig); } return(unManager); }
void Awake() { //Phone Bar if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } //Level Bar _csvLeveling = CSVLeveling.Instance; EventDispatcher.StartListening(Vars.LocalClientDisconnect, NetworkDisconnect); ImageTarget = GameObject.Find("ImageTarget"); }
/// <summary> /// Create Gateway SQL execute command. /// </summary> /// <param name="localManager"></param> /// <param name="databaseName"></param> /// <returns></returns> public static GatewayCommandSQLExecute CreateGatewayCommandSQLExecute(LocalManager localManager, string databaseName, string sqlStatement, StorageAttribute[] storageAtrributes, DBField[] dbFields) { GatewayCommandSQLExecute gatewayCommandSQLExecute = new GatewayCommandSQLExecute(); gatewayCommandSQLExecute.LocalManager = localManager; DataSourceDefinition datasourceDefinition = new DataSourceDefinition(); datasourceDefinition.DBaseName = databaseName.ToUpper(); gatewayCommandSQLExecute.DataSourceDefinition = datasourceDefinition; gatewayCommandSQLExecute.sqlStatement = sqlStatement; gatewayCommandSQLExecute.storageAttributes = storageAtrributes; gatewayCommandSQLExecute.dbFields = dbFields; return(gatewayCommandSQLExecute); }
public async Task <ActionResult> Register(RegisterViewModel model) { if (ModelState.IsValid) { ApplicationUser user = model.ToApplicationUser(UserType.LocalAdmin); IdentityResult result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { LocalManager client = model.ToUser <LocalManager>(user.PasswordHash); try { BusinessManager.Instance.LocalManagers.Add(client); } catch (UniqueKeyViolationException ex) { ModelState["CPF"].Errors.Add(ex.Message); } var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = model.Password }, protocol: Request.Url.Scheme); var message = @"<p>Olá, {0}!</p><p>Segue os dados de acesso para sua conta.</p><p>Usuário: {1}</p><p>Senha: {2}</p> <p><b>Nunca compartilhe esses dados com ninguém. Caso contrário, ações admistrativas serão tomadas.</b></p>"; message = string.Format(message, client.FirstName, client.Email, model.Password); await UserManager.SendEmailAsync(user.Id, "Sua conta no Smart Parking System", message); return(RedirectToAction("Index", "GlobalAdmin")); } else { var emailErrors = result.Errors.Where(e => e.Contains("email")); if (emailErrors.Count() > 0) { foreach (var error in emailErrors) { ModelState["Email"].Errors.Add(error); } } } } // Se chegamos até aqui e houver alguma falha, exiba novamente o formulário return(View(model)); }
private void DownloadITranfert(object sender, EventArgs e, ITransfer unDossierOuFichier) { if (_mesGestionnaires.ContainsKey("$DistantManager")) { DistantManager monManager = (DistantManager)_mesGestionnaires["$DistantManager"]; if (!string.IsNullOrEmpty(trv_arboLocal.SelectedNode.Text)) { if (!string.IsNullOrEmpty(lst_itransfertDistant.SelectedItems[0].Text)) { if (!string.IsNullOrEmpty(trv_arboDistant.SelectedNode.Text)) { ITransfer unTranferable = (ITransfer)lst_itransfertDistant.SelectedItems[0].Tag; ElementFolder unElementFolder = unElementFolder = (ElementFolder)trv_arboLocal.SelectedNode.Tag; if (unTranferable.EstUnDossier()) { DownloadDossier(sender, e, monManager, unTranferable); } else { DownloadFichier(monManager, unTranferable); } trv_arboLocal.SelectedNode.Nodes.Clear(); unElementFolder.Rafraichir(); ExtraireNode(_mesGestionnaires["$LocalManager"].ListerContenu(unElementFolder), trv_arboLocal.SelectedNode); LocalManager monLocalManager = (LocalManager)_mesGestionnaires["$LocalManager"]; trv_arboLocal_AfterSelect(sender, e); trv_arboDistant.SelectedNode.Nodes.Clear(); ExtraireNode(_mesGestionnaires["$DistantManager"].ListerContenu((ITransfer)trv_arboDistant.SelectedNode.Tag), trv_arboDistant.SelectedNode); trv_arboDistant_AfterSelect(sender, e); } else { } } } } }