public Purpose Delete(Purpose request) { DeletePurposeHandler handler = _serviceProvider.GetService <DeletePurposeHandler>(); Purpose response = handler.Execute(request); return(response); }
public Purpose Post(Purpose request) { CreatePurposeHandler handler = _serviceProvider.GetService <CreatePurposeHandler>(); Purpose response = handler.Execute(request); return(response); }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Purpose != null) { result.AddRange(Purpose.Validate()); } if (Name != null) { result.AddRange(Name.Validate()); } if (Telecom != null) { Telecom.ForEach(elem => result.AddRange(elem.Validate())); } if (Address != null) { result.AddRange(Address.Validate()); } if (Gender != null) { result.AddRange(Gender.Validate()); } return(result); }
public ActionResult Create(Purpose purpose, ICollection <PurposeCulture> purposeCulture, ICollection <SpongeSolutions.ServicoDireto.Model.HierarchyStructure> hierarchyStructure, FormCollection collection) { if (!ModelState.IsValid) { this.LoadViewBagData(purpose); return(View(purpose)); } int[] vinculatedStrucuture = new int[] { }; if (collection["IDHierachyStructureVinculated"] != null) { vinculatedStrucuture = collection["IDHierachyStructureVinculated"].Split(',').Select(n => int.Parse(n)).ToArray(); } if (!purpose.IDPurpose.HasValue) { purpose.CreateDate = DateTime.Now; purpose.CreatedBy = SiteContext.ActiveUserName; purpose.ModifyDate = DateTime.Now; purpose.ModifiedBy = SiteContext.ActiveUserName; ServiceContext.PurposeService.Insert(purpose, purposeCulture, vinculatedStrucuture); this.TempData["Message"] = Internationalization.Message.Record_Inserted_Successfully; } else { purpose.ModifyDate = DateTime.Now; purpose.ModifiedBy = SiteContext.ActiveUserName; ServiceContext.PurposeService.Update(purpose, purposeCulture, vinculatedStrucuture); this.TempData["Message"] = Internationalization.Message.Record_Updated_Successfully; } this.LoadViewBagData(purpose); return(RedirectToAction("create", new { id = purpose.IDPurpose.Value })); }
public static void GetFiles(List<object> data, Purpose purpose) { DirectoryInfo dir = null; string[] allowed = null; switch (purpose) { case Purpose.Info: dir = new DirectoryInfo(Resources.ContentDirectory); allowed = ContentExtensions; break; case Purpose.Game: dir = new DirectoryInfo(Resources.GameDirectory); allowed = GameExtensions; break; default: return; } foreach (var f in dir.GetFiles().Where(f => allowed.Contains(f.Extension))) { Console.Write(purpose + " filename = " + f.Name); // append the filename, and filesize to the builder data.Add(f.Name); Console.WriteLine(" length = " +f.Length); data.Add(f.Length); } }
// Use this for initialization void Start() { body_ = GetComponent <Rigidbody>(); gear_ = 0; respawnPoint_ = transform.position; //initialised_ = false; curLightIntensity_ = brakeLightIntensity_ * 0.5f; error_ = GetComponent <Error>(); purpose_ = GetComponent <Purpose>(); vision_ = GetComponent <Vision>(); personality_ = GetComponent <Personality>(); body_.centerOfMass = new Vector3(0, -0.95f); audioSource_ = GetComponent <AudioSource>(); audioSource_.volume = 0.5f; //gather all the lights lights_ = new List <GameObject>(); lights_.Add(transform.Find("Headlights").GetChild(0).gameObject); lights_.Add(transform.Find("Headlights").GetChild(1).gameObject); lights_.Add(transform.Find("Taillights").GetChild(0).gameObject); lights_.Add(transform.Find("Taillights").GetChild(1).gameObject); resetTimer_ = 0; //randomise the colour GetComponent <Renderer>().material.color = Random.ColorHSV(); stateText_ = transform.FindChild("StateText").gameObject; }
/// <summary> /// Returns true if CommonEmailAddress instances are equal /// </summary> /// <param name="other">Instance of CommonEmailAddress to be compared</param> /// <returns>Boolean</returns> public bool Equals(CommonEmailAddress other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( IsPreferred == other.IsPreferred || IsPreferred != null && IsPreferred.Equals(other.IsPreferred) ) && ( Purpose == other.Purpose || Purpose != null && Purpose.Equals(other.Purpose) ) && ( Address == other.Address || Address != null && Address.Equals(other.Address) )); }
/// <inheritdoc /> public void Init(IBlock block, Purpose purpose, ILog parentLog) { Block = block; var view = Block.View; Log.LinkTo(parentLog); var root = Helpers.TemplateHelpers.Init(Block.App, Log).AppPathRoot(view.IsShared, PathTypes.PhysRelative); var subPath = view.Path; var templatePath = TryToFindPolymorphPath(root, view, subPath) ?? Helpers.LinkPaths.ToAbsolute(root + "/", subPath); // Throw Exception if Template does not exist if (!File.Exists(Helpers.ServerPaths.FullAppPath(templatePath))) { // todo: change to some kind of "rendering exception" throw new SexyContentException("The template file '" + templatePath + "' does not exist."); } Template = view; TemplatePath = templatePath; App = Block.App; DataSource = Block.Data; Purpose = purpose; // check common errors CheckExpectedTemplateErrors(); // check access permissions - before initializing or running data-code in the template CheckTemplatePermissions(Block.Context.User); // Run engine-internal init stuff Init(); }
public async Task <IActionResult> Edit(int id, [Bind("PurposeID,Title,Message,Content")] Purpose purpose) { if (id != purpose.PurposeID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(purpose); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PurposeExists(purpose.PurposeID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(purpose)); }
private void btnAdd_Click(object sender, EventArgs e) { if (txtName.Text != "") { if (editScreen) { editPurpose.setName(txtName.Text); editPurpose.setDescription(txtDescription.Text); } else { btnDelete.Visible = false; Purpose purpose = new Purpose(); purpose.setName(txtName.Text); purpose.setDescription(txtDescription.Text); purpose.setId(Program.database.getId()); KeyValue parentItem = (KeyValue)cbbParrent.SelectedItem; Purpose parent = Program.database.getPurposeById(Convert.ToInt32(parentItem.key)); purpose.setParentId(parent.getId()); parent.AddSubComponent(purpose); } this.receiver.Updater(); exitform = true; this.Close(); } else { string message = "Het naamveld mag niet leeg zijn!"; MessageBox.Show(message, "Foutmelding", MessageBoxButtons.OK); } }
private IEnumerable <Purpose> GetDebitPurposesFromXmlFile() { var filePath = GetTempDebitVoucherXmlFilePath(); List <Purpose> purposes = new List <Purpose>(); var xmlData = XDocument.Load(filePath).Element("PurposeList")?.Elements(); if (xmlData != null) { foreach (XElement element in xmlData) { Purpose aPurpose = new Purpose(); var elementFirstAttribute = element.FirstAttribute.Value; aPurpose.Serial = elementFirstAttribute; var elementValue = element.Elements(); var xElements = elementValue as XElement[] ?? elementValue.ToArray(); aPurpose.PurposeCode = xElements[0].Value; aPurpose.Amounts = Convert.ToDecimal(xElements[1].Value); aPurpose.PurposeName = xElements[2].Value; aPurpose.Remarks = xElements[3].Value; aPurpose.DebitOrCredit = xElements[4].Value; purposes.Add(aPurpose); } } return(purposes); }
public Variable(Kind kind, Purpose purpose, Common.MemoryRegionSize memory_region_size = Common.MemoryRegionSize.Integer, int?min_value = null, int?max_value = null) { _ID = new IDManager(); switch (purpose) { case Purpose.Original: name = string.Concat("v_", ID); break; case Purpose.Temporary: name = string.Concat("t_", ID); break; case Purpose.Fake: name = string.Concat("f_", ID); break; case Purpose.ConstRecalculation: name = string.Concat("c_", ID); break; case Purpose.Parameter: name = string.Concat("p_", ID); break; default: throw new ObjectException("Unsupported Variable.Purpose value."); } memoryRegionSize = Convert.ToInt32(memory_region_size); pointer = false; fake = true; fixedMin = min_value; fixedMax = max_value; this.kind = kind; }
public JsonResult ChequeReceiveVoucher(FormCollection collection) { SuccessErrorModel aModel = new SuccessErrorModel(); try { List <Purpose> purposeList = new List <Purpose>(); Voucher voucher = new Voucher(); var amount = Convert.ToDecimal(collection["Amount"]); string bankCode = collection["BankCode"]; string purposeCode = collection["PurposeCode"]; var creditPurpose = new Purpose { PurposeCode = bankCode, Amounts = amount, Remarks = collection["Remarks"], DebitOrCredit = "Dr" }; purposeList.Add(creditPurpose); var anUser = (ViewUser)Session["user"]; var debitPurpose = new Purpose { PurposeCode = purposeCode, Amounts = amount, Remarks = collection["Remarks"], DebitOrCredit = "Cr" }; purposeList.Add(debitPurpose); //-------------Voucher type = Cheque receive voucher,transcation type 2 = Bank voucher.PurposeList = purposeList; voucher.Remarks = collection["Remarks"]; voucher.VoucherType = 4; voucher.VoucherName = "Cheque Receive Voucher"; voucher.TransactionTypeId = 2; voucher.VoucherDate = Convert.ToDateTime(collection["Date"]); voucher.Amounts = amount; voucher.VoucherByUserId = anUser.UserId; voucher.BranchId = Convert.ToInt32(Session["BranchId"]); voucher.CompanyId = Convert.ToInt32(Session["CompanyId"]); int rowAffected = _iAccountsManager.SaveVoucher(voucher); if (rowAffected > 0) { aModel.Message = "<p class='text-green'>Saved Cheque Receive voucher successfully!</p>"; } else { aModel.Message = "<p class='text-danger'>Failed to save Cheque receive voucher info !</p>"; } } catch (Exception exception) { var ex = exception.Message; aModel.Message = "<p style='color:red'>" + ex + "</p>"; Log.WriteErrorLog(exception); } return(Json(aModel, JsonRequestBehavior.AllowGet)); }
public ActionResult CreditVoucher(FormCollection collection) { try { var aPurpose = new Purpose { PurposeCode = collection["PurposeCode"], Amounts = Convert.ToDecimal(collection["PurposeAmounts"]), PurposeName = collection["PurposeName"], Remarks = collection["Remarks"], DebitOrCredit = "Cr" }; var filePath = GetTempCreditVoucherXmlFilePath(); var id = aPurpose.PurposeCode + "_" + Guid.NewGuid(); var xmlDocument = XDocument.Load(filePath); xmlDocument.Element("PurposeList")?.Add( new XElement("Purpose", new XAttribute("Id", id), new XElement("PurposeCode", aPurpose.PurposeCode), new XElement("Amounts", aPurpose.Amounts), new XElement("PurposeName", aPurpose.PurposeName), new XElement("Remarks", aPurpose.Remarks), new XElement("DebitOrCredit", aPurpose.DebitOrCredit) )); xmlDocument.Save(filePath); return(View()); } catch (Exception exception) { TempData["Error"] = exception.Message; Log.WriteErrorLog(exception); return(PartialView("_ErrorPartial", exception)); } }
public BookDescription(Item item, string description, DateTime purchaseDate, Purpose purpose, Kind kind) : base(item) { Description = description; PurchaseDate = purchaseDate; Purpose = purpose; Kind = kind; }
public void SavePurposeClicked(object sender, EventArgs e) { var thisPurpose = new Purpose() { Content = ContentText.Text, Notes = NotesText.Text, DueDate = DatePicker.Date, ProgressLevel = Slider.Value }; var mp = new ManagePurposes(); if (purpose == null) { mp.AddPurpose(thisPurpose); } else { thisPurpose.Id = purpose.Id; mp.UpdatePurpose(thisPurpose); } RefreshPurposeAction?.Invoke(); Navigation.PopAsync(); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Hides the popup only if the popup's current purpose indicator is the same as that /// specified. /// </summary> /// ------------------------------------------------------------------------------------ public void Hide(Purpose purposeIndicator) { if (m_purposeIndicator == purposeIndicator && Active()) { Hide(); } }
public ActionResult Purpose() { List <Purpose> CategoryList = new List <Purpose>(); Property p = new Property(); DataSet ds = new DataSet(); p.OnTable = "FetchPurpose"; ds = dl.FetchPurpose_sp(p); try { foreach (DataRow item in ds.Tables[0].Rows) { Purpose m = new Purpose(); m.PId = item["PId"].ToString(); m.PName = item["PName"].ToString(); m.AddedBy = item["AddedBy"].ToString(); m.Description = item["Description"].ToString(); m.IsActive = item["IsActive"].ToString(); CategoryList.Add(m); } ViewBag.CategoryList = CategoryList; } catch (Exception e) { } return(View()); }
public override KeySelectorResult select(javax.xml.crypto.dsig.keyinfo.KeyInfo keyInfo, Purpose purpose, AlgorithmMethod method, XMLCryptoContext context) {//throws KeySelectorException { return(new IAC_KeySelectorResult(this)); }
public static void Initialize(IServiceProvider serviceProvider) { var context = serviceProvider.GetRequiredService <ApplicationDbContext>(); context.Database.EnsureCreated(); var purposes = context.Purposes.ToList(); var policies = (new Policies()).GetPolicies(); foreach (var purpose in policies) { if (!purposes.Any(x => x.Title.ToLower() == purpose.Purpose.ToLower())) { var entity = new Purpose { Id = Guid.NewGuid(), Title = purpose.Purpose, Description = purpose.PII }; context.Purposes.Add(entity); } } context.SaveChanges(); }
private async Task CreatePurposeIfNotExist(DocumentViewModel viewModel) { if (viewModel.PurposeType == PurposeType.New) { var purposesExist = await _context.Purposes .FirstOrDefaultAsync(x => string.Equals(x.Name, viewModel.PurposeName, StringComparison.InvariantCultureIgnoreCase)); if (purposesExist == null) { var purposes = new Purpose { Name = viewModel.PurposeName, Id = Guid.NewGuid(), Character = null }; await _context.Purposes.AddAsync(purposes); await _context.SaveChangesAsync(); viewModel.PurposeId = purposes.Id; } else { viewModel.PurposeId = purposesExist.Id; } } }
public void Search(xDBDataContext db) { var users = db.Users.AsQueryable(); users = users.Where(x => x.Sex == Sex); if (Purpose.IsFilled()) { users = users.Where(x => SqlMethods.Like(x.Purpose, string.Format("%{0}%", Purpose))); } if (MinAge.HasValue) { users = users.Where(x => x.BirthDate.HasValue && x.BirthDate.Value.Date <= MinBirthDate.Value.Date); } if (MaxAge.HasValue) { users = users.Where(x => x.BirthDate.HasValue && x.BirthDate.Value.Date >= MaxBirthDate.Value.Date); } if (HasPhoto) { users = users.Where(x => x.UserPhotos.Any()); } if (IsOnline) { users = users.Where(x => x.LastVisitDate.HasValue && x.LastVisitDate.Value >= DateTime.Now.AddMinutes(-5)); } if (TownID.HasValue) { users = users.Where(x => x.TownID == TownID.Value); } Users = users.ToList().OrderByDescending(x => x.IsVip).ThenByDescending(x => x.IsUp).ThenByDescending(x => x.webpages_Membership.CreateDate).ToList(); }
public async Task <IActionResult> CreatePurpose(Purpose purpose) { db.Purposes.Add(purpose); await db.SaveChangesAsync(); return(RedirectToActionPermanent("Index")); }
public IKeySelectorResult select(KeyInfo keyInfo, Purpose purpose, AlgorithmMethod method, XMLCryptoContext context) { if (null == keyInfo) { throw new Exception("no ds:KeyInfo present"); } List <XMLStructure> keyInfoContent = keyInfo.Content; certChain.Clear(); foreach (XMLStructure keyInfoStructure in keyInfoContent) { if (!(keyInfoStructure is X509Data)) { continue; } X509Data x509Data = (X509Data)keyInfoStructure; List <Object> x509DataList = x509Data.Content; foreach (Object x509DataObject in x509DataList) { if (!(x509DataObject is X509Certificate)) { continue; } X509Certificate certificate = (X509Certificate)x509DataObject; certChain.Add(certificate); } } if (certChain.Count == 0) { throw new Exception("No key found!"); } return(this); }
public void AddPurpose(Purpose purpose) { lock (syncObject) { database.Database.Insert(purpose); } }
public ActionResult CreditVoucher(FormCollection collection) { try { Purpose aPurpose = new Purpose { PurposeCode = collection["PurposeCode"], Amounts = Convert.ToDecimal(collection["PurposeAmounts"]), PurposeName = collection["PurposeName"], Remarks = collection["Remarks"], DebitOrCredit = "Dr" }; List <Purpose> purposeList = (List <Purpose>)Session["PurposeList"]; if (purposeList != null) { purposeList.Add(aPurpose); } else { purposeList = new List <Purpose> { aPurpose }; Session["PurposeList"] = purposeList; ViewBag.Payments = purposeList; } return(View()); } catch (Exception exception) { TempData["Error"] = exception.Message; return(View()); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as ContactComponent; if (dest != null) { base.CopyTo(dest); if (Purpose != null) { dest.Purpose = (Hl7.Fhir.Model.CodeableConcept)Purpose.DeepCopy(); } if (Name != null) { dest.Name = (Hl7.Fhir.Model.HumanName)Name.DeepCopy(); } if (Telecom != null) { dest.Telecom = new List <Hl7.Fhir.Model.ContactPoint>(Telecom.DeepCopy()); } if (Address != null) { dest.Address = (Hl7.Fhir.Model.Address)Address.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public IActionResult Update([FromBody] Purpose data) { if (service.Get(x => x.Id == data.Id) != null) { return(Ok(service.Update(data))); } return(NotFound()); }
public static ERPStock_entry_type Create(Purpose purpose) { ERPStock_entry_type obj = new ERPStock_entry_type(); obj.purpose = purpose; return(obj); }
// Create a description formatter to format the given courseView. // Currently, the language for the text descriptions is taken from the language set for the event. It would be easy to make this // a parameter to the constructor (e.g., to allow printing in a different language), but this currently isn't required. public DescriptionFormatter(CourseView courseView, SymbolDB symbolDB, Purpose purpose) { this.courseView = courseView; this.eventDB = courseView.EventDB; this.symbolDB = symbolDB; this.language = QueryEvent.GetDescriptionLanguage(eventDB); this.purpose = purpose; }
// Use this for initialization void Start() { car_ = GetComponent <Car>(); body_ = GetComponent <Rigidbody>(); eventSender_ = GetComponent <EventSender>(); error_ = GetComponent <Error>(); purpose_ = GetComponent <Purpose>(); }
internal void setPurpose(RoleInGame role, ref List <string> notifyMsg, Purpose p) { this.purpose = p; if (role.playerType == RoleInGame.PlayerType.player) { this.SendPurposeOfCar((Player)role, this, ref notifyMsg); } //throw new NotImplementedException(); }
private AntennaPort addAntennaPort(int portNumber, Purpose purpose, int warehouseID) { WMScontext ctx = new WMScontext(); AntennaPort antennaPort = new AntennaPort { PortNumber = portNumber, Purpose = purpose, DateCreated = DateTime.Now, WarehouseID = warehouseID }; return antennaPort; }
private List<Purpose> fetchSubCategories(Purpose purp, List<Purpose> values) { values.Add(purp); foreach (ComponentModel pur in purp.getSubComponents()) { if (pur.GetType() == typeof(Purpose)) { values = this.fetchSubCategories((Purpose)pur, values); } } return values; }
public string SaveChanges(int id, string value, Purpose purpose) { try { switch (purpose) { case Purpose.DeleteGroupName: DeleteGroupName(id); break; case Purpose.DeleteGroupTitle: DeleteGroupTitle(id); break; case Purpose.DeleteTYpe: DeleteTitleType(id); break; case Purpose.EditGroupName: EditGroupName(value, id); break; case Purpose.EditGroupTitle: EditGroupTitle(value, id); break; case Purpose.EditType: EditTitleType(value, id); break; case Purpose.AddGroupName: AddGroupName(value); break; case Purpose.AddGroupTitle: AddGroupTitle(value); break; case Purpose.AddTitleType: AddTitleType(value); break; } using (EventOrganizerEntities db = new EventOrganizerEntities()) { ViewData["grouplist"] = db.EventGroupNames.ToList(); ViewData["EventGroupTitle"] = db.EventGroupTitles.ToList(); ViewData["EventTypeOne"] = db.EventTypeOnes.ToList(); } return "true"; } catch { return "false"; } }
/// <summary>Register the hotkey</summary> public short RegisterGlobalHotkey(Key hotkey, int modifiers, Purpose purpose) { try { HotkeySignature signature = new HotkeySignature(hotkey, modifiers); this.hotkeys.Add(signature, purpose); return hotkeyCount++; } catch (Exception ex) { // clean up if hotkey registration failed Dispose(); Console.WriteLine(ex); } return -1; }
private void SetColor(Purpose purpose) { switch (purpose) { case Purpose.Error: Console.ForegroundColor = ConsoleColor.Red; break; case Purpose.Success: Console.ForegroundColor = ConsoleColor.Green; break; case Purpose.Info: Console.ForegroundColor = ConsoleColor.Yellow; break; default: throw new ArgumentOutOfRangeException("purpose"); } }
private void btnNewDatabase_Click(object sender, EventArgs e) { Program.database = new Database(); Program.database.id = 0; Scope scope = new Scope(); scope.setName("Scope"); scope.setId(Program.database.getId()); scope.setDescription("Head of hierachy"); Purpose purpose = new Purpose(); purpose.setName("Purpose"); purpose.setId(Program.database.getId()); purpose.setDescription("Head of hierachy"); Program.database.setHeadScope(scope); Program.database.setHeadPurpose(purpose); Program.frmEditor.Show(); Program.frmStart.Hide(); }
/// <summary> /// /// </summary> /// <param name="purpose"></param> internal AccessTokenResponse(Purpose purpose) { this.purpose = purpose; }
private List<Pattern> fetchSharedPattern(Purpose purpose, Scope scope) { List<Pattern> returnList = new List<Pattern>(); List<Pattern> aList = new List<Pattern>(); List<Pattern> bList = new List<Pattern>(); aList = this.fetchSubPatterns(purpose, aList); bList = this.fetchSubPatterns(scope, bList); foreach (Pattern pattern in aList) { Pattern patternA = pattern; foreach (Pattern pattern2 in bList) { Pattern patternB = pattern2; if (patternA.getId() == patternB.getId()) { returnList.Add(patternA); } } } return returnList; }
private void fetchSubCategories(Purpose purp, string prefix, ListBox lbox) { KeyValue keyValue = new KeyValue(); keyValue.key = purp.getId().ToString(); keyValue.value = prefix + purp.getName(); lbox.Items.Add(keyValue); foreach (ComponentModel pur in purp.getSubComponents()) { if (pur.GetType() == typeof(Purpose)) { this.fetchSubCategories((Purpose)pur, "- " + prefix, lbox); } } }
public ServerTask(int userId, int taskId, Purpose purpose) { this.UserId = userId; this.TaskId = taskId; this.Purpose = purpose; }
/** * Attempts to find a key that satisfies the specified constraints. * * @param keyInfo a <code>KeyInfo</code> (may be <code>null</code>) * @param purpose the key's purpose ({@link Purpose#SIGN}, * {@link Purpose#VERIFY}, {@link Purpose#ENCRYPT}, or * {@link Purpose#DECRYPT}) * @param method the algorithm method that this key is to be used for. * Only keys that are compatible with the algorithm and meet the * constraints of the specified algorithm should be returned. * @param context an <code>XMLCryptoContext</code> that may contain * useful information for finding an appropriate key. If this key * selector supports resolving {@link RetrievalMethod} types, the * context's <code>baseURI</code> and <code>dereferencer</code> * parameters (if specified) should be used by the selector to * resolve and dereference the URI. * @return the result of the key selector * @throws KeySelectorException if an exceptional condition occurs while * attempting to find a key. Note that an inability to find a key is not * considered an exception (<code>null</code> should be * returned in that case). However, an error condition (ex: network * communications failure) that prevented the <code>KeySelector</code> * from finding a potential key should be considered an exception. * @throws ClassCastException if the data type of <code>method</code> * is not supported by this key selector */ public abstract KeySelectorResult select(javax.xml.crypto.dsig.keyinfo.KeyInfo keyInfo, Purpose purpose, AlgorithmMethod method, XMLCryptoContext context);
protected override void DoWriteLine(Purpose purpose, string text) { writer.WriteLine(text); }
protected override void DoWriteLine(Purpose purpose, string text) { SetColor(purpose); Console.WriteLine(text); Console.ForegroundColor = ConsoleColor.White; }
protected abstract void DoWriteLine(Purpose purpose, string text);
public void WriteLine(Purpose purpose, string text) { DoWriteLine(purpose, startOfLine && indentationLevel > 0 ? string.Join("", new string('\t', indentationLevel), text) : text); startOfLine = true; }
/// <summary>Register the hotkey</summary> public short RegisterGlobalHotkey(Key hotkey, int modifiers, Purpose purpose, IntPtr handle) { return RegisterGlobalHotkey(hotkey, modifiers, purpose); }
public void Open(Purpose purpose, string defaultLocation, IEnumerable<TorrentViewModel> torrents = null) { if (purpose == Purpose.Add && torrents != null) { throw new ArgumentException("Passed Purpose.Add ad a non-empty enumerable of torrents"); } if (!IsOpen) { _defaultLocation = defaultLocation; Location = defaultLocation; Purpose = purpose; IsOpen = true; FavouriteLocations.Add(_defaultLocation); var favouriteLocations = _settingsHelper.GetFavouriteLocations(5); favouriteLocations.ForEach(x => { if (_defaultLocation != x) { FavouriteLocations.Add(x); } }); } if (torrents != null) { AddTorrentObjects(torrents); } }
public override KeySelectorResult select(javax.xml.crypto.dsig.keyinfo.KeyInfo keyInfo, Purpose purpose, AlgorithmMethod method, XMLCryptoContext context) { //throws KeySelectorException { return new IAC_KeySelectorResult(this); }
public void WriteLine(Purpose purpose, string format, params object[] args) { DoWriteLine(purpose, startOfLine && indentationLevel > 0 ? string.Join("", new string('\t', indentationLevel), format) : format, args); startOfLine = true; }
public ServerTask GetNext(Purpose purpose) { this.Send("get"); string reply, serverMessage; while (this.client.Connected && ((serverMessage = this.client.GetString()) != null)) { if (serverMessage == this.error) { this.Log("Server error, exiting..."); this.client.Close(); return null; } else this.Log("Processing..."); string purposeString = this.GetPurposeShortStr(purpose); this.Send(purposeString); reply = this.client.GetString(); if (reply == this.error) { this.Log("Some error happened..."); this.client.Close (); return null; } reply = this.client.GetString(); if (reply == this.nofile) { this.Log("There no file in the current queue..."); this.client.Close (); return null; } string line; StringBuilder sb = new StringBuilder(); while (this.client.Connected && ((line = this.client.GetString()) != null)) { if (line == this.eof) break; sb.Append(line); } this.client.Close(); return ServerTaskFactory.GetTask(purposeString, sb.ToString()); } return null; }
protected abstract void DoWriteLine(Purpose purpose, string format, params object[] args);
protected string GetPurposeShortStr(Purpose purpose) { // dummy method switch(purpose) { case Purpose.Result: return "result"; case Purpose.Run: return "run"; case Purpose.Temp: return "temp"; } return string.Empty; }
protected override void DoWriteLine(Purpose purpose, string format, params object[] args) { writer.WriteLine(format, args); }
/// <summary> /// /// </summary> public AccessTokenResponse() { purpose = Purpose.Authorized; }
protected override void DoWriteLine(Purpose purpose, string format, params object[] args) { SetColor(purpose); Console.WriteLine(format, args); Console.ForegroundColor = ConsoleColor.White; }
public void addPurpose(Purpose purp) { Ids ids = new Ids(); ids.id = purp.getId(); hasPurpose.Add(ids); }
public void setHeadPurpose(Purpose purpose) { headPurpose = purpose; }
public void removePurpose(Purpose purp) { foreach (Ids ids in hasPurpose) { if (purp.getId() == ids.id) { hasPurpose.Remove(ids); } } }