/// <summary> /// Attempts to create a Photon Cloud Account. /// Check ReturnCode, Message and AppId to get the result of this attempt. /// </summary> /// <param name="email">Email of the account.</param> /// <param name="origin">Marks which channel created the new account (if it's new).</param> public void RegisterByEmail(string email, Origin origin) { this.registrationCallback = null; this.AppId = string.Empty; this.Message = string.Empty; this.ReturnCode = -1; string result; try { WebRequest req = HttpWebRequest.Create(this.RegistrationUri(email, (byte)origin)); HttpWebResponse resp = req.GetResponse() as HttpWebResponse; // now read result StreamReader reader = new StreamReader(resp.GetResponseStream()); result = reader.ReadToEnd(); } catch (Exception ex) { this.Message = "Failed to connect to Cloud Account Service. Please register via account website."; this.Exception = ex; return; } this.ParseResult(result); }
public override void GiveRewards(bool bDialogResult, Sim sim, string icon, Origin origin) { if (bDialogResult) { if (RewardsManager.CheckForWin(mChanceToWin, mModifiersList, sim)) { base.ShowEventTNS(Common.LocalizeEAString(sim.IsFemale, mYesResultText, new object[] { sim }), sim.ObjectId, icon); RewardsManager.GiveRewards(mYesRewardsList, sim, origin); RewardInfoEx.GiveRewards(sim, null, mYesRewardsList); } else { base.ShowEventTNS(Common.LocalizeEAString(sim.IsFemale, mYesLoseResultText, new object[] { sim }), sim.ObjectId, icon); RewardsManager.GiveRewards(mYesLoseRewardsList, sim, origin); RewardInfoEx.GiveRewards(sim, null, mYesLoseRewardsList); } } else { base.ShowEventTNS(Common.LocalizeEAString(sim.IsFemale, mNoResultText, new object[] { sim }), sim.ObjectId, icon); RewardsManager.GiveRewards(mNoRewardsList, sim, origin); RewardInfoEx.GiveRewards(sim, null, mNoRewardsList); } }
private static Vector2f CreateOrigin(LObject o, Origin origin) { Vector2f v = new Vector2f(o.X(), o.Y()); switch (origin) { case Origin.CENTER: v.Set(o.GetWidth() / 2f, o.GetHeight() / 2f); return v; case Origin.TOP_LEFT: v.Set(0.0f, o.GetHeight()); return v; case Origin.TOP_RIGHT: v.Set(o.GetWidth(), o.GetHeight()); return v; case Origin.BOTTOM_LEFT: v.Set(0.0f, 0.0f); return v; case Origin.BOTTOM_RIGHT: v.Set(o.GetWidth(), 0.0f); return v; case Origin.LEFT_CENTER: v.Set(0.0f, o.GetHeight() / 2f); return v; case Origin.TOP_CENTER: v.Set(o.GetWidth() / 2f, o.GetHeight()); return v; case Origin.BOTTOM_CENTER: v.Set(o.GetWidth() / 2f, 0.0f); return v; case Origin.RIGHT_CENTER: v.Set(o.GetWidth(), o.GetHeight() / 2f); return v; default: return v; } }
public MoodletSymptom(XmlDbRow row) : base(row) { if (BooterLogger.Exists(row, "BuffName", Guid)) { if (!row.TryGetEnum<BuffNames>("BuffName", out mBuff, BuffNames.Undefined)) { mBuff = (BuffNames)row.GetUlong("BuffName", 0); if (mBuff == 0) { mBuff = (BuffNames)ResourceUtils.HashString64(row.GetString("BuffName")); } if (!BuffManager.BuffDictionary.ContainsKey((ulong)mBuff)) { BooterLogger.AddError(Guid + " Unknown BuffName: " + row.GetString("BuffName")); } } } mMoodValue = row.GetInt("MoodValue", 0); mDuration = row.GetInt("Duration", 30); if (mDuration <= 0) { mDuration = -1; } mOrigin = (Origin)row.GetUlong("Origin", 0); if (mOrigin == Origin.None) { mOrigin = (Origin)ResourceUtils.HashString64(row.GetString("Origin")); } }
public static List<Vector2f> MakeOrigins(Origin origin, params LObject[] objs) { List<Vector2f> result = new List<Vector2f>(objs.Length); foreach (LObject o in objs) { CollectionUtils.Add(result, CreateOrigin(o, origin)); } return result; }
public TextPanel(int leftPoint, int topPoint, int panelWidth, int panelHeight, string fontAddress, string displayText, Color colour, float scale, Origin origin, float spacing, float layer, bool transform) : base(leftPoint, topPoint, panelWidth, panelHeight, colour, layer, transform) { font = TextureManager.GetFont(fontAddress); m_spacing = spacing; text = displayText; stringOffset = new Vector2(this.Bounds.Width * 0.5f, this.Bounds.Height * 0.5f); switch (origin) { case Origin.TOP_LEFT: stringOrigin = Vector2.Zero; break; case Origin.TOP_RIGHT: stringOrigin.X = font.MeasureString(displayText).X; stringOrigin.Y = 0; break; case Origin.TOP_CENTRE: stringOrigin.X = font.MeasureString(displayText).X * 0.5f; stringOrigin.Y = 0; break; case Origin.BOTTOM_LEFT: stringOrigin.X = 0; stringOrigin.Y = font.MeasureString(displayText).Y; break; case Origin.BOTTOM_RIGHT: stringOrigin.X = font.MeasureString(displayText).X; stringOrigin.Y = font.MeasureString(displayText).Y; break; case Origin.BOTTOM_CENTRE: stringOrigin.X = font.MeasureString(displayText).X * 0.5f; stringOrigin.Y = font.MeasureString(displayText).Y; break; case Origin.CENTRE_LEFT: stringOffset.X = 0; stringOrigin.Y = font.MeasureString(displayText).Y * 0.5f; break; case Origin.CENTRE_RIGHT: stringOrigin.X = font.MeasureString(displayText).X; stringOrigin.Y = font.MeasureString(displayText).Y * 0.5f; break; case Origin.CENTRE: stringOrigin.X = font.MeasureString(displayText).X * 0.5f; stringOrigin.Y = font.MeasureString(displayText).Y * 0.5f; break; default: //default to centre stringOrigin.X = font.MeasureString(displayText).X * 0.5f; stringOrigin.Y = font.MeasureString(displayText).Y * 0.5f; break; } this.scale = scale; }
public static Altaxo.Data.ColumnKind OriginToAltaxoColumnKind(Origin.COLTYPES originType) { Altaxo.Data.ColumnKind altaxoType; switch (originType) { case COLTYPES.COLTYPE_ERROR: altaxoType = ColumnKind.Err; break; case COLTYPES.COLTYPE_GROUP: altaxoType = ColumnKind.V; break; case COLTYPES.COLTYPE_LABEL: altaxoType = ColumnKind.Label; break; case COLTYPES.COLTYPE_NONE: altaxoType = ColumnKind.V; break; case COLTYPES.COLTYPE_NO_CHANGE: altaxoType = ColumnKind.V; break; case COLTYPES.COLTYPE_SUBJECT: altaxoType = ColumnKind.V; break; case COLTYPES.COLTYPE_X: altaxoType = ColumnKind.X; break; case COLTYPES.COLTYPE_X_ERROR: altaxoType = ColumnKind.Err; break; case COLTYPES.COLTYPE_Y: altaxoType = ColumnKind.V; break; case COLTYPES.COLTYPE_Z: altaxoType = ColumnKind.Y; break; default: altaxoType = ColumnKind.V; break; } return altaxoType; }
/// <summary> /// Create a new <see cref="AbilityScores"/>. /// </summary> /// <param name="primaryOrigin"> /// The character's primary <see cref="Origin"/>. /// </param> /// <param name="secondaryOrigin"> /// The character's secondary <see cref="Origin"/>. /// </param> /// <param name="abilityScores"> /// Additional ability scores. This must contain at least 4 values or at least 5 when /// the primary ability score of the primary and secondary origins are /// the same. /// </param> /// <exception cref="ArgumentNullException"> /// No argument can be null. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="abilityScores"/> must contain at least 4 values or at least 5 when /// the primary ability score of the primary and secondary origins are /// </exception> internal AbilityScores(Origin primaryOrigin, Origin secondaryOrigin, IEnumerable<int> abilityScores) : base("Ability Scores", "Ability Scores") { if (primaryOrigin == null) { throw new ArgumentNullException("primaryOrigin"); } if (secondaryOrigin == null) { throw new ArgumentNullException("secondaryOrigin"); } if (abilityScores == null) { throw new ArgumentNullException("abilityScores"); } if ((secondaryOrigin.AbilityScore == primaryOrigin.AbilityScore && abilityScores.Count() < 5) || abilityScores.Count() < 4) { throw new ArgumentException("Too few ability scores", "abilityScores"); } if (abilityScores.Any(x => !ScoreHelper.IsValidAbilityScore(x))) { throw new ArgumentException("Invalid attribute value", "abilityScores"); } IEnumerator<int> currentAbilityScore; scores = CreateScores(); // As per p30 if (secondaryOrigin.AbilityScore == primaryOrigin.AbilityScore) { scores[primaryOrigin.AbilityScore] = 20; } else { scores[primaryOrigin.AbilityScore] = 18; scores[secondaryOrigin.AbilityScore] = 16; } // Assign in order for determinism currentAbilityScore = abilityScores.GetEnumerator(); currentAbilityScore.MoveNext(); foreach (ScoreType scoreType in ScoreTypeHelper.AbilityScores) { if (scores[scoreType] == 0) { scores[scoreType] = currentAbilityScore.Current; currentAbilityScore.MoveNext(); } } }
public static bool Parse(string value, out Origin result) { if (!ParserFunctions.TryParseEnum<Origin>(value, out result, Origin.None)) { result = (Origin)ResourceUtils.HashString64(value); if (!Localization.HasLocalizationString("Gameplay/Excel/Buffs/BuffOrigins:" + Simulator.GetEnumSimpleName(typeof(Origin), (ulong)result))) { return false; } } return true; }
private void archive_Click(object sender, EventArgs e) { try { Origin myOrigins = new Origin(); Exclusion myExclusions = new Exclusion(); ArchiverChooser chooser = new ArchiverChooser(myOrigins, myExclusions); ArchiverConfiguration config = new ArchiverConfiguration(); Archiver myArchiver = new Archiver(config); myArchiver.Archive(chooser.GetProcessedFileSystemInfos()); myArchiver.CleanOldDirectories(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
static void Main(string[] args) { bool _logAtctive = false; bool _waitKeyPress = false; // Interperto as opcoes de rotina GetVariables(args, ref _logAtctive, ref _waitKeyPress); try { // Carrego as origens e exclusoes Origin myOrigins = new Origin(); Exclusion myExclusions = new Exclusion(); // Carrego a classe responsavel por fazer a escolha de arquivos ArchiverChooser chooser = new ArchiverChooser(myOrigins, myExclusions); // Carrego a configuracao basica de diretorios ArchiverConfiguration config = new ArchiverConfiguration(); // Carrego a classe responsavel pelo arquivamento. Archiver myArchiver = new Archiver(config); // Arquivo os itens selecionados myArchiver.Archive(chooser.GetProcessedFileSystemInfos()); // Limpo diretorios antigos myArchiver.CleanOldDirectories(); } catch (Exception ex) { Console.WriteLine(ex.Message); if (_logAtctive) { System.IO.File.WriteAllText("Log_" + DateTime.Now.ToString("yyyy-MM-dd_hhmmss") + ".txt", ex.Message); } } if (_waitKeyPress) { Console.ReadKey(); } }
/// <summary> /// Parse the RopSeekStreamRequest structure. /// </summary> /// <param name="s">An stream containing RopSeekStreamRequest structure.</param> public override void Parse(Stream s) { base.Parse(s); this.RopId = (RopIdType)ReadByte(); this.LogonId = ReadByte(); this.InputHandleIndex = ReadByte(); this.Origin = (Origin)ReadByte(); this.Offset = ReadUlong(); }
///** // * Gets the vertex for the edge's origin // * // * @return the origin vertex // */ //public Vertex Origin //{ // return vertex; //} ///** // * Gets the vertex for the edge's destination // * // * @return the destination vertex // */ //public final Vertex dest() { // return sym().orig(); //} ///<summary> /// Gets the length of the geometry of this quadedge. ///</summary> /// <returns>the length of the quadedge</returns> public double GetLength() { return(Origin.GetDistanceTo(Destination)); }
public bool JoinVoters(List <Origin> voters, Origin voterToJoin) => VoteCounter.Join(voters, voterToJoin);
public JsonResult AjaxCreate(Origin origin) { db.Origins.Add(origin); db.SaveChanges(); return(Json(origin)); }
//public Vector3[] list2 = new Vector3[550]; void Start () { OO = this; }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); this.hoverOrigin = Origin.None; this.Invalidate(); }
///** // * Place random stairs at (x, y). // */ //static void place_random_stairs(Cave c, int y, int x) { // int feat = randint0(100) < 50 ? FEAT_LESS : FEAT_MORE; // if (cave_canputitem(c, y, x)) // place_stairs(c, y, x, feat); //} /** * Place a random object at (x, y). */ public static void place_object(Cave c, int y, int x, int level, bool good, bool great, Origin origin) { int rating = 0; Object.Object otype; Misc.assert(cave_in_bounds(c, y, x)); if (!cave_canputitem(c, y, x)) return; otype = new Object.Object(); //object_wipe(&otype); if (!Object.Object.make_object(c, ref otype, level, good, great, ref rating)) return; otype.origin = origin; otype.origin_depth = (byte)c.depth; /* Give it to the floor */ /* XXX Should this be done in floor_carry? */ if (Object.Object.floor_carry(c, y, x, otype) == 0) { if (otype.artifact != null) otype.artifact.created = false; return; } else { if (otype.artifact != null) c.good_item = true; c.obj_rating += (uint)rating; } }
} // end of TriggerEndEvent #endregion #region ToString public override string ToString() { return(Name + ": " + Origin.ToString() + "-" + Destination.ToString()); } // end of ToString
} // end of AffectedEntities #endregion //-------------------------------------------------------------------------------------------------- // Events //-------------------------------------------------------------------------------------------------- #region TriggerStartEvent /// <summary> /// Actual state change, calls the leaving method of the origin control unit and scheduled the end event /// </summary> /// <param name="time"> Time of activity start</param> /// <param name="simEngine"> SimEngine the handles the activity triggering</param> override public void StateChangeStartEvent(DateTime time, ISimulationEngine simEngine) { Origin.EntityLeaveControlUnit(time, simEngine, MovingEntity, DelegateOrigin); _endTime = time + Duration; simEngine.AddScheduledEvent(EndEvent, time + Duration); } // end of TriggerStartEvent
async Task RunAsync() { Address customerAddress = new Address { Id = selectedshipment.Customer.AddressId, Name = cName.Text, Streetname = cAddress.Text, City = cCity.Text, Email = cEmail.Text, Postalcode = cZipCode.Text, Province = cProvince.SelectedValue.ToString(), Phone = cPhoneNumber.Text }; Address originAddress = new Address { Id = selectedshipment.Origin.Address.Id, Name = oName.Text, Streetname = oAddress.Text, City = oCity.Text, Email = oEmail.Text, Postalcode = oZipCode.Text, Province = oProvince.SelectedValue.ToString(), Phone = oPhoneNumber.Text }; Address destinationAddress = new Address { Id = selectedshipment.Destination.Address.Id, Name = destName.Text, Streetname = destAddress.Text, City = destCity.Text, Email = destEmail.Text, Postalcode = destZipCode.Text, Province = destProvince.SelectedValue.ToString(), Phone = destPhoneNumber.Text }; Customer customer = new Customer { Id = selectedshipment.Customer.Id, Address = customerAddress }; Broker broker = new Broker { Id = selectedshipment.Broker.Id, AddressId = selectedshipment.Broker.AddressId, Address = customerAddress, Mc = "9652365" }; Origin origin = new Origin { Id = selectedshipment.Origin.Id, AddressId = selectedshipment.Origin.AddressId, Address = originAddress }; Destination destination = new Destination { Id = selectedshipment.Destination.Id, AddressId = selectedshipment.Destination.AddressId, Address = destinationAddress }; DateTime odatetime = new DateTime(oDate.Date.Year, oDate.Date.Month, oDate.Date.Day, oTime.Time.Hours, oTime.Time.Minutes, oTime.Time.Seconds); DateTime destdatetime = new DateTime(destDate.Date.Year, destDate.Date.Month, destDate.Date.Day, destTime.Time.Hours, destTime.Time.Minutes, destTime.Time.Seconds); Shipment shipment = new Shipment { Id = selectedshipment.Id, BrokerId = broker.Id, CustomerId = customer.Id, DestinationId = destination.Id, OriginId = origin.Id, Broker = broker, Customer = customer, Origin = origin, Destination = destination, Commodity = commodity.Text, BrokerRate = decimal.Parse(shipmentRate.Text), EquipmentType = "43\" Trailer", FreightType = Freighttype.SelectedValue.ToString(), Weight = double.Parse(weight.Text), DestinationApptNumber = DestinationReferenceNumber.Text, OriginApptNumber = OriginReferenceNumber.Text, Notes = "note for shipment", DestinationApptDatetime = destdatetime, OriginApptDatetime = odatetime }; client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Add("apikey", "NbqYQDjspLDvorREUZAnyHZyCC3GoPGs"); string json = JsonConvert.SerializeObject(shipment); Debug.WriteLine(json); HttpContent content; HttpResponseMessage response; content = new StringContent(json, Encoding.UTF8, "application/json"); Debug.WriteLine(client.DefaultRequestHeaders); response = await client.PutAsync("http://tamasdeep1624-eval-test.apigee.net/proxyfleetapi/api/Shipments/" + selectedshipment.Id, content); if (response.IsSuccessStatusCode) { success.Text = "Successfully Updated Shipment"; } Debug.WriteLine(response); }
public Exchange(Request request, Origin origin) { _origin = origin; _currentRequest = request; _timestamp = DateTime.Now; }
/// <summary> /// Sets the current file position pointer. /// </summary> /// <param name="offset">Offset in bytes from the origin</param> /// <param name="seekOrigin">Origin reference</param> /// <returns>ReturnCode indicating success or failure.</returns> public abstract ReturnCode Seek(long offset, Origin seekOrigin);
public PropagateBuffScenario(SimDescription source, BuffNames buff, float timeoutLength, Origin origin) { mFocus = source; mBuff = buff; mTimeoutLength = timeoutLength; mOrigin = origin; }
public PropagateBuffScenario(SimDescription source, BuffNames buff, Origin origin) : this(source, buff, float.MaxValue, origin) { }
protected PropagateEnemyScenario(SimDescription primary, SimDescription enemy, BuffNames buff, Origin origin, int delta) : base(primary, buff, origin) { mEnemy = enemy; mDelta = delta; }
public PropagateClanDelightScenario(SimDescription center, StoryProgressionObject clan, Origin origin) : base(center, BuffNames.Delighted, origin) { mClan = clan as SimPersonality; }
public override string ToString() { return($"{Origin.ToString()} {Width} {Height}"); }
/** * Allocates 'num' random objects in the dungeon. * * See alloc_object() for more information. */ static void alloc_objects(Cave c, int set, int typ, int num, int depth, Origin origin) { int k; int l = 0; for (k = 0; k < num; k++) { bool ok = alloc_object(c, set, typ, depth, origin); if (!ok) l++; } }
public MessageAttribute(Origin direction) { Direction = direction; }
/// <summary> /// Collects a lists of all worksheets in the provided folder and its subfolders. /// </summary> /// <param name="folder">The folder to begin the collection with.</param> /// <param name="path">The current path name of the provided <paramref name="folder"/>.</param> /// <param name="list">The list used to collect all worksheets.</param> private void ListAllWorksheetsInFolderAndSubfolders(Origin.Folder folder, string path, List<Tuple<string, Origin.WorksheetPage>> list) { for (int i = 0; i < folder.PageBases.Count; ++i) { var page = folder.PageBases[i]; if (page.Type == (int)Origin.PAGETYPES.OPT_WORKSHEET) list.Add(new Tuple<string, Origin.WorksheetPage>(path, page as Origin.WorksheetPage)); } for (int i = 0; i < folder.Folders.Count; ++i) { var newPath = path + (!string.IsNullOrEmpty(folder.Folders[i].LongName) ? folder.Folders[i].LongName : folder.Folders[i].Name) + '\\'; ListAllWorksheetsInFolderAndSubfolders(folder.Folders[i], newPath, list); } }
public string ToMSBuildString() { const string originApp = Constants.ILLink; string origin = Origin?.ToString() ?? originApp; StringBuilder sb = new StringBuilder(); sb.Append(origin).Append(":"); if (!string.IsNullOrEmpty(SubCategory)) { sb.Append(" ").Append(SubCategory); } string cat; switch (Category) { case MessageCategory.Error: case MessageCategory.WarningAsError: cat = "error"; break; case MessageCategory.Warning: cat = "warning"; break; default: cat = ""; break; } if (!string.IsNullOrEmpty(cat)) { sb.Append(" ") .Append(cat) .Append(" IL") .Append(Code.Value.ToString("D4")) .Append(": "); } else { sb.Append(" "); } if (Origin?.MemberDefinition != null) { if (Origin?.MemberDefinition is MethodDefinition method) { sb.Append(method.GetDisplayName()); } else { sb.Append(Origin?.MemberDefinition.FullName); } sb.Append(": "); } // Expected output $"{FileName(SourceLine, SourceColumn)}: {SubCategory}{Category} IL{Code}: ({MemberDisplayName}: ){Text}"); sb.Append(Text); return(sb.ToString()); }
public PropagateBuffScenario(BuffNames buff, float timeoutLength, Origin origin) : this(null, buff, timeoutLength, origin) { }
public string GetDownloadUrl() { return(Origin.IsNullOrEmpty() ? Large : Origin); }
protected BaseDefinition(VisitRabbitHoleEx.InteractionParameters parameters) { mPrefix = parameters.mPrefix; VisitBuffOrigin = parameters.mOrigin; VisitTuning = parameters.mTuning; }
public bool Equals(Nuid other) { return(Origin.Equals(other.Origin) && Unique.Equals(other.Unique)); }
/// <summary> /// Checks for equality among <see cref="Ray"/> classes /// </summary> /// <param name="other">The other <see cref="Ray"/> to compare it to</param> /// <returns>True if equal</returns> public bool Equals(Ray other) => Origin.Equals(other.Origin) && Direction.Equals(other.Direction);
public Directory(string path, string name, IDirectoryService directoryService, Origin origin) { FullName = path; Name = name; DirectoryService = directoryService; Origin = origin; SubDirectories = new ObservableCollection <Directory>(); PropertyChanged += OnIsExpandedChanged; IconSource = "pack://application:,,,/Icons/FolderIcon.png"; }
/// <summary> /// 更新数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>修改记录编号</returns> /// <remarks>2015-08-21 王耀发 创建</remarks> public abstract int Update(Origin entity);
public Mesh GetMesh(string id, Table.Table table, Origin origin = Origin.Global, bool asRightHanded = true) => _meshGenerator.GetMesh(id, table, origin, asRightHanded);
public ElevationBorder(Origin o, Border b, Corner c, Corner n, float d) { this.origin = o; this.border = b; this.corner = c; this.nextCorner = n; this.distanceToPlateBoundary = d; }
protected internal sealed override Span <byte> _GetSpan(int index, int count) { return(new Span <byte>(Unsafe.Add <byte>(Origin.ToPointer(), Idx(index)), count)); }
public bool run(Database db) { Console.WriteLine("Initialise BulkDataLoader sample ..."); // Console.WriteLine("Enter Container Uri"); lCont = Convert.ToInt64(Console.ReadLine()); // create an origin to use for this sample. Look it up first just so you can rerun the code. m_origin = db.FindTrimObjectByName(BaseObjectTypes.Origin, "Bulk Loader Sample") as Origin; if (m_origin == null) { m_origin = new Origin(db, OriginType.Custom1); m_origin.Name = "Bulk Loader Sample"; m_origin.OriginLocation = "n.a"; // sample code assumes you have a record type defined called "Document" m_origin.DefaultRecordType = db.FindTrimObjectByUri(BaseObjectTypes.RecordType,2) as RecordType; // don't bother with other origin defaults for the sample, just save it so we can use it m_origin.Save(); } // construct a BulkDataLoader for this origin m_loader = new BulkDataLoader(m_origin); // initialise it as per instructions if (!m_loader.Initialise()) { // this sample has no way of dealing with the error. Console.WriteLine(m_loader.ErrorMessage); return false; } Console.WriteLine("Starting up an import run ..."); // the sample is going to do just one run, let's get started... // you will need to specify a working folder that works for you (see programming guide) m_loader.LogFileName = "Logtest"; m_loader.StartRun("Simulated Input Data", "C:\\junk"); //13 13 HP TRIM Bulk Data Importing Programming Guide // setup the property array that will be used to transfer record metadata PropertyOrFieldValue[] recordFields = new PropertyOrFieldValue[4]; recordFields[0] = new PropertyOrFieldValue(PropertyIds.RecordTitle); recordFields[1] = new PropertyOrFieldValue(PropertyIds.RecordDateCreated); recordFields[2] = new PropertyOrFieldValue(PropertyIds.RecordNotes); recordFields[3] = new PropertyOrFieldValue(PropertyIds.RecordContainer); //recordFields[3] = new PropertyOrFieldValue(PropertyIds.RecordAuthor); // now lets add some records while (getNextRecord(recordFields)) { Console.WriteLine("Importing record #" + System.Convert.ToString(m_recordCount) + " ..."); Record importRec = m_loader.NewRecord(); // set the record properties m_loader.SetProperties(importRec, recordFields); // attach an electronic. The sample just does this for the first record, and uses // a mail message to avoid having to find a document on the hard drive somewhere. //InputDocument doc = new InputDocument(); // doc.SetAsMailMessage(); // doc.Subject = "Imported mail message #" + System.Convert.ToString(m_recordCount); // doc.Content = "Some mail messages have very little content"; // doc.SentDate = new TrimDateTime(2007, 12, 14, 10, 30, 15); // doc.ReceivedDate = new TrimDateTime(2007, 12, 14, 14, 30, 30); // EmailParticipant mailContactFrom = new EmailParticipant("*****@*****.**","Random Kindness", "SMTP"); // doc.SetAuthor(mailContactFrom); // EmailParticipant mailContactTo = new EmailParticipant("*****@*****.**", "Little Animals", "SMTP"); // doc.AddRecipient(MailRecipientType.To, mailContactTo); // m_loader.SetDocument(importRec, doc, BulkLoaderCopyMode.WindowsCopy); // submit it to the bulk loader m_loader.SubmitRecord(importRec); } // by now the loader has accumulated 5 record inserts and 5 location inserts // if you set a breakpoint here and look into the right subfolder of your working folder // you will see a bunch of temporary files ready to be loaded into the SQL engine // process this batch Console.WriteLine("Processing import batch ..."); m_loader.ProcessAccumulatedData(); // grab a copy of the history object (it is not available in bulk loader after we end the run Int64 runHistoryUri = m_loader.RunHistoryUri; // we're done, lets end the run now Console.WriteLine("Processing complete ..."); m_loader.EndRun(); // just for interest, lets look at the origin history object and output what it did OriginHistory hist = new OriginHistory(db, runHistoryUri); Console.WriteLine("Number of records created ..... " + System.Convert.ToString(hist.RecordsCreated)); Console.WriteLine("Number of locations created ... " + System.Convert.ToString(hist.LocationsCreated)); Console.WriteLine("Logfile; " + m_loader.LogFileName); return true; }
public string ToString(string fmt) { return(string.Format("[Frame3f: Origin={0}, X={1}, Y={2}, Z={3}]", Origin.ToString(fmt), X.ToString(fmt), Y.ToString(fmt), Z.ToString(fmt))); }
/** * Place a random amount of gold at (x, y). */ public static void place_gold(Cave c, int y, int x, int level, Origin origin) { Object.Object i_ptr; //object_type object_type_body; Misc.assert(cave_in_bounds(c, y, x)); if (!cave_canputitem(c, y, x)) return; //i_ptr = &object_type_body; //object_wipe(i_ptr); i_ptr = new Object.Object(); Object.Object.make_gold(ref i_ptr, level, (int)SVal.sval_gold.SV_GOLD_ANY); i_ptr.origin = origin; i_ptr.origin_depth = (byte)level; Object.Object.floor_carry(c, y, x, i_ptr); }
public static void Draw(SpriteFont Font, Vector2 Position, Origin Origin, Color Fore, Color? Back = null, float Angle = 0, float Scale = 1, SpriteEffects Effect = SpriteEffects.None, float Layer = 0) { Draw(Globe.Batches[0], Font, Position, Origin, Fore, Back, Angle, Scale, Effect, Layer); }
/** * Allocates a single random object in the dungeon. * * 'set' controls where the object is placed (corridor, room, either). * 'typ' conrols the kind of object (rubble, trap, gold, item). */ static bool alloc_object(Cave c, int set, int typ, int depth, Origin origin) { int x = 0, y = 0; int tries = 0; bool room; /* Pick a "legal" spot */ while (tries < 2000) { tries++; find_empty(c, out y, out x); /* See if our spot is in a room or not */ room = (c.info[y][x] & CAVE_ROOM) != 0 ? true : false; /* If we are ok with a corridor and we're in one, we're done */ if ((set & SET_CORR) != 0 && !room) break; /* If we are ok with a room and we're in one, we're done */ if ((set & SET_ROOM) != 0 && room) break; } if (tries == 2000) return false; /* Place something */ switch (typ) { case TYP_RUBBLE: place_rubble(c, y, x); break; case TYP_TRAP: Trap.place_trap(c, y, x); break; case TYP_GOLD: place_gold(c, y, x, depth, origin); break; case TYP_OBJECT: place_object(c, y, x, depth, false, false, origin); break; case TYP_GOOD: place_object(c, y, x, depth, true, false, origin); break; case TYP_GREAT: place_object(c, y, x, depth, true, true, origin); break; } return true; }
/// <summary> /// Attempts to create a Photon Cloud Account asynchronously. /// Once your callback is called, check ReturnCode, Message and AppId to get the result of this attempt. /// </summary> /// <param name="email">Email of the account.</param> /// <param name="origin">Marks which channel created the new account (if it's new).</param> /// <param name="callback">Called when the result is available.</param> public void RegisterByEmailAsync(string email, Origin origin, Action<AccountService> callback) { this.registrationCallback = callback; this.AppId = string.Empty; this.Message = string.Empty; this.ReturnCode = -1; try { HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(this.RegistrationUri(email, (byte)origin)); req.Timeout = 5000; req.BeginGetResponse(this.OnRegisterByEmailCompleted, req); } catch (Exception ex) { this.Message = "Failed to connect to Cloud Account Service. Please register via account website."; this.Exception = ex; if (this.registrationCallback != null) { this.registrationCallback(this); } } }
/// <summary> /// 插入数据 /// </summary> /// <param name="entity">数据实体</param> /// <returns>新增记录编号</returns> /// <remarks>2015-08-06 王耀发 创建</remarks> public abstract int Insert(Origin entity);
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); Size buttonSize = GetButtonSize(); int hoverInt = 0; hoverInt += Math.Min(2, e.X / buttonSize.Width); hoverInt += 3 * Math.Min(2, e.Y / buttonSize.Height); Origin lastHover = this.hoverOrigin; this.hoverOrigin = (Origin)hoverInt; if (lastHover != this.hoverOrigin) { this.Invalidate(); } }
public JsonResult AjaxEdit(Origin origin) { db.Entry(origin).State = EntityState.Modified; db.SaveChanges(); return(Json(origin)); }
public LocalObject(string _uniqueName, Race _race, CharacterClass _cclass, Background _background, Origin _origin, int experience) { uniqueName = _uniqueName; race = _race; cclass = _cclass; background = _background; origin = _origin; xp = new Experience(experience, this); skills = new Skills(this); inventory = new Inventory(6, 1, "", true, null, this); hp = new HPComponent(this); movement = new Movement(this); defence = new Defence(this); attack = new Attack(this); abilities = new Abilities(this); fatigue = new Fatigue(this); eating = new Eating(this); }
public PartialViewResult OriginEdit(int id) { Origin origin = db.Origins.Find(id); return(PartialView(origin)); }
/// <summary> /// Initializes a new instance of the <see cref="OriginOf{TValue}"/> class. /// </summary> /// <param name="origin"><see cref="Origin"/> to filter on.</param> public OriginOf(Origin origin) { // Predicate = dataPoint => dataPoint.Origin == origin; Origin = origin; }
public PropagateBuffScenario(BuffNames buff, Origin origin) : this(null, buff, float.MaxValue, origin) { }
public static void Draw(Batch Batch, SpriteFont Font, Vector2 Position, Origin Origin, Color Fore, Color? Back = null, float Angle = 0, float Scale = 1, SpriteEffects Effect = SpriteEffects.None, float Layer = 0) { Batch.DrawString( string.Format("Update FPS: {0} (Avg. {1})\nDraw FPS: {2} (Avg. {3})", Math.Round(UpdateFramesPerSecond), Math.Round(AverageUpdateFramesPerSecond), DrawFramesPerSecond, Math.Round(AverageDrawFramesPerSecond)), Font, Position, Origin, Fore, Back, Angle, Scale, Effect, Layer); }
/// <summary> /// Configure what origin for a <see cref="DataPointsOf{T}"/>. /// </summary> /// <typeparam name="TValue">Type of <see cref="IMeasurement">measurement</see> for the <see cref="DataPoint{T}"/>.</typeparam> /// <param name="filter"><see cref="DataPointsOf{T}"/> to configure.</param> /// <param name="origin"><see cref="Origin"/>.</param> /// <returns>Continued <see cref="DataPointsOf{T}"/>.</returns> public static DataPointsOf <TValue> OriginatingFrom <TValue>(this DataPointsOf <TValue> filter, Origin origin) where TValue : IMeasurement { filter.ValueSpecification = filter.ValueSpecification.And(new OriginOf <TValue>(origin)); return(filter); }
private ReturnCode OnAiFileSeekProc(IntPtr file, UIntPtr offset, Origin seekOrigin) { if(m_filePtr != file) return ReturnCode.Failure; ReturnCode code = ReturnCode.Failure; try { code = Seek((long) offset.ToUInt64(), seekOrigin); } catch(Exception) { /*Assimp will report an IO error*/ } return code; }
public RenderObjectGroup GetRenderObjects(Table.Table table, Origin origin = Origin.Global, bool asRightHanded = true) { return(_meshGenerator.GetRenderObjects(table, asRightHanded)); }