protected override void OnRowsAdded(object sender, DataSheetRowEventArgs e) { base.OnRowsAdded(sender, e); this.m_AllowRowChangeEvents = false; DataTable dt = this.GetData(); Dictionary <string, bool> d = CreateExistingNamesDictionary(dt); foreach (DataRow dr in dt.Rows) { if (dr.RowState == DataRowState.Deleted) { continue; } if (dr[Strings.DATASHEET_NAME_COLUMN_NAME] == DBNull.Value) { string slxname = this.GetSlxName(dr); string slyname = this.GetSlyName(dr); string n = GetNextName(slxname + ":" + slyname, d); dr[Strings.DATASHEET_NAME_COLUMN_NAME] = n; dr[Strings.DATASHEET_IS_AUTO_NAME_COLUMN_NAME] = Booleans.BoolToInt(true); d.Add(n, true); } } this.m_AllowRowChangeEvents = true; }
public bool?ShouldParseBooleans(string value) { // when var parsed = Booleans.TryParse(value); // then return(parsed); }
public void AddBoolean(string key, string expression) { if (Booleans == null) { Booleans = new Dictionary <string, string>(); } Booleans.Add(key, expression); }
public void DisplayArray() { foreach (var b in Booleans.Reverse()) { Console.Write(b ? 1 : 0); } Console.WriteLine(); }
public static void SetAllScreensVisibility(Booleans isVisible) { var entityManager = World.Active.GetOrCreateManager<EntityManager>(); var requestEntity = entityManager.CreateEntity(); entityManager.AddComponentData(requestEntity, new SetAllScreensVisibilityRequest { isVisible = isVisible, }); }
private void CreateTransitionGroup(int id, string name) { DataRow dr = this.m_TGData.NewRow(); dr[this.m_TGDataSheet.PrimaryKeyColumn.Name] = id; dr[Strings.DATASHEET_NAME_COLUMN_NAME] = name; dr[Strings.IS_AUTO_COLUMN_NAME] = Booleans.BoolToInt(true); this.m_TGData.Rows.Add(dr); }
private void CreateFlowGroup(int id, string name) { DataRow dr = this.m_FlowGroupDataTable.NewRow(); dr[this.m_FlowGroupDataSheet.PrimaryKeyColumn.Name] = id; dr[Constants.NAME_COLUMN_NAME] = name; dr[Constants.IS_AUTO_COLUMN_NAME] = Booleans.BoolToInt(true); this.m_FlowGroupDataTable.Rows.Add(dr); }
/// <summary> /// Clears all script storage. /// </summary> public static void Clear() { Pokemons.Clear(); Strings.Clear(); Integers.Clear(); Booleans.Clear(); Items.Clear(); Singles.Clear(); Doubles.Clear(); }
private void CreateTransitionTypeGroup(int typeId, int groupId) { DataRow dr = this.m_TTGData.NewRow(); dr[Strings.DATASHEET_TRANSITION_TYPE_ID_COLUMN_NAME] = typeId; dr[Strings.DATASHEET_TRANSITION_GROUP_ID_COLUMN_NAME] = groupId; dr[Strings.IS_AUTO_COLUMN_NAME] = Booleans.BoolToInt(true); this.m_TTGData.Rows.Add(dr); }
private void FillOutputFilterFlows() { #if DEBUG Debug.Assert(this.m_FlowTypeLinkagesAdded); Debug.Assert(this.m_FlowGroupLinkagesAdded); Debug.Assert(!this.m_OutputFilterFlows.HasItems); #endif DataSheet ds = this.ResultScenario.GetDataSheet(Constants.DATASHEET_OUTPUT_FILTER_FLOWS); foreach (DataRow dr in ds.GetData().Rows) { this.m_OutputFilterFlows.Add( new OutputFilterFlows( Convert.ToInt32(dr[Constants.FLOW_GROUP_ID_COLUMN_NAME], CultureInfo.InvariantCulture), Booleans.BoolFromValue(dr[Constants.OUTPUT_SUMMARY_COLUMN_NAME]), Booleans.BoolFromValue(dr[Constants.OUTPUT_SPATIAL_COLUMN_NAME]), Booleans.BoolFromValue(dr[Constants.OUTPUT_AVG_SPATIAL_COLUMN_NAME]))); } foreach (FlowGroup g in this.m_FlowGroups) { Constants.OutputFilter f = Constants.OutputFilter.None; if (this.FilterIncludesTabularDataForFlowGroup(g.Id)) { f |= Constants.OutputFilter.Tabular; } if (this.FilterIncludesSpatialDataForFlowGroup(g.Id)) { f |= Constants.OutputFilter.Spatial; } if (this.FilterIncludesAvgSpatialDataForFlowGroup(g.Id)) { f |= Constants.OutputFilter.AvgSpatial; } g.OutputFilter = f; } foreach (FlowType t in this.m_FlowTypes) { Constants.OutputFilter f = Constants.OutputFilter.None; if (this.FilterIncludesSpatialDataForFlowType(t.Id)) { f |= Constants.OutputFilter.Spatial; } if (this.FilterIncludesAvgSpatialDataForFlowType(t.Id)) { f |= Constants.OutputFilter.AvgSpatial; } t.OutputFilter = f; } }
public void UserLogin() { ulog = new UserLogin(driver); browserOps.Goto("https://uitesting.eb-test.site/"); ulog.UserName.SendKeys("*****@*****.**"); ulog.Password.SendKeys("Qwerty@123"); ulog.LoginButton.Click(); Console.WriteLine("Login Success"); b = new Booleans(driver); browserOps.UrlToBe("https://uitesting.eb-test.site/UserDashBoard"); }
private void SetCheckBoxValueIfCondition(CheckBox cbSender, CheckBox cbCompare, CheckBox cbTarget, string columnName) { if (cbSender == cbCompare && cbCompare.Checked) { if (!cbTarget.Checked) { DataRow dr = this.DataFeed.GetDataSheet(Strings.DATASHEET_OO_SPATIAL_NAME).GetDataRow(); dr[columnName] = Booleans.BoolToInt(true); cbTarget.Checked = true; } } }
public void ToBooleanTest() { Assert.AreEqual(F, Booleans.ToBoolean(null)); Assert.AreEqual(F, Booleans.ToBoolean(GetRandom.String())); Assert.AreEqual(F, Booleans.ToBoolean(F.ToString())); Assert.AreEqual(T, Booleans.ToBoolean(T.ToString())); Assert.AreEqual(F, Booleans.ToBoolean("f")); Assert.AreEqual(T, Booleans.ToBoolean("t")); Assert.AreEqual(F, Booleans.ToBoolean("no")); Assert.AreEqual(T, Booleans.ToBoolean("yes")); Assert.AreEqual(F, Booleans.ToBoolean("n")); Assert.AreEqual(T, Booleans.ToBoolean("y")); }
public void IsFalseStringTest() { Assert.AreEqual(F, Booleans.IsFalseString(null)); Assert.AreEqual(F, Booleans.IsFalseString(GetRandom.String())); Assert.AreEqual(T, Booleans.IsFalseString(F.ToString())); Assert.AreEqual(F, Booleans.IsFalseString(T.ToString())); Assert.AreEqual(T, Booleans.IsFalseString("f")); Assert.AreEqual(F, Booleans.IsFalseString("t")); Assert.AreEqual(T, Booleans.IsFalseString("no")); Assert.AreEqual(F, Booleans.IsFalseString("yes")); Assert.AreEqual(T, Booleans.IsFalseString("n")); Assert.AreEqual(F, Booleans.IsFalseString("y")); }
public void IsTrueStringTest() { Assert.AreEqual(false, Booleans.IsTrueString(null)); Assert.AreEqual(false, Booleans.IsTrueString(GetRandom.String())); Assert.AreEqual(false, Booleans.IsTrueString(false.ToString())); Assert.AreEqual(true, Booleans.IsTrueString(true.ToString())); Assert.AreEqual(false, Booleans.IsTrueString("f")); Assert.AreEqual(true, Booleans.IsTrueString("t")); Assert.AreEqual(false, Booleans.IsTrueString("no")); Assert.AreEqual(true, Booleans.IsTrueString("yes")); Assert.AreEqual(false, Booleans.IsTrueString("n")); Assert.AreEqual(true, Booleans.IsTrueString("y")); }
public static Partly Generate(params Boolean[] Booleans) { if (Booleans.All(v => v == true)) { return(Partly.All); } if (Booleans.All(v => v == false)) { return(Partly.None); } return(Partly.Partly); }
private void InitUserInteractive() { DataSheet ds = this.Library.GetDataSheet(Shared.APPLICATION_DATASHEET_NAME); DataRow dr = ds.GetDataRow(); if (dr == null || dr[Shared.APPLICATION_DATASHEET_USER_INTERACTIVE_COLUMN_NAME] == DBNull.Value) { this.m_IsUserInteractive = false; } else { this.m_IsUserInteractive = Booleans.BoolFromValue( dr[Shared.APPLICATION_DATASHEET_USER_INTERACTIVE_COLUMN_NAME]); } }
public void ToBooleanStringTest() { Assert.AreEqual(null, Booleans.ToBooleanString(null)); var s = GetRandom.String(); Assert.AreEqual(s, Booleans.ToBooleanString(s)); Assert.AreEqual(Fs, Booleans.ToBooleanString(F.ToString())); Assert.AreEqual(Ts, Booleans.ToBooleanString(T.ToString())); Assert.AreEqual(Fs, Booleans.ToBooleanString("f")); Assert.AreEqual(Ts, Booleans.ToBooleanString("t")); Assert.AreEqual(Fs, Booleans.ToBooleanString("no")); Assert.AreEqual(Ts, Booleans.ToBooleanString("yes")); Assert.AreEqual(Fs, Booleans.ToBooleanString("n")); Assert.AreEqual(Ts, Booleans.ToBooleanString("y")); }
public void CrossCheck_Dynamic_Binary_ExclusiveOr() { var f = CrossCheck_Dynamic_BinaryCore("^"); var ls = Integers.Concat(Booleans).Concat(Booleans); var rs = Integers2.Concat(Booleans).Concat(Booleans.Reverse()); var values = ls.Zip(rs, (l, r) => new { l, r }); foreach (var lr in values) { f(lr.l, lr.r); } f(BindingFlags.Public, BindingFlags.Instance); }
private void OnColumnChanged(object sender, DataColumnChangeEventArgs e) { if (e.Row.RowState == DataRowState.Detached) { return; } if (!this.m_AllowRowChangeEvents) { return; } DataTable dt = this.GetData(); Dictionary <string, bool> d = CreateExistingNamesDictionary(dt); this.m_AllowRowChangeEvents = false; if (e.Column.ColumnName == Strings.DATASHEET_NAME_COLUMN_NAME) { if (e.Row[Strings.DATASHEET_NAME_COLUMN_NAME] != DBNull.Value && Convert.ToString(e.Row[Strings.DATASHEET_NAME_COLUMN_NAME], CultureInfo.InvariantCulture) != TEMP_NAME_VALUE) { e.Row[Strings.DATASHEET_IS_AUTO_NAME_COLUMN_NAME] = Booleans.BoolToInt(false); } } else if ( e.Column.ColumnName == Strings.DATASHEET_STATECLASS_STATE_LABEL_X_ID_COLUMN_NAME || e.Column.ColumnName == Strings.DATASHEET_STATECLASS_STATE_LABEL_Y_ID_COLUMN_NAME) { bool IsAutoName = DataTableUtilities.GetDataBool(e.Row, Strings.DATASHEET_IS_AUTO_NAME_COLUMN_NAME); if (IsAutoName) { string slxname = this.GetSlxName(e.Row); string slyname = this.GetSlyName(e.Row); string CurrentName = Convert.ToString(e.Row[Strings.DATASHEET_NAME_COLUMN_NAME], CultureInfo.InvariantCulture); string ProposedName = slxname + ":" + slyname; if (CurrentName != ProposedName) { ProposedName = GetNextName(ProposedName, d); e.Row[Strings.DATASHEET_NAME_COLUMN_NAME] = ProposedName; } } } this.m_AllowRowChangeEvents = true; }
public virtual int Compare(KeyValuePair <AsyncLogger, QJournalProtocolProtos.PrepareRecoveryResponseProto > a, KeyValuePair <AsyncLogger, QJournalProtocolProtos.PrepareRecoveryResponseProto > b) { QJournalProtocolProtos.PrepareRecoveryResponseProto r1 = a.Value; QJournalProtocolProtos.PrepareRecoveryResponseProto r2 = b.Value; // A response that has data for a segment is always better than one // that doesn't. if (r1.HasSegmentState() != r2.HasSegmentState()) { return(Booleans.Compare(r1.HasSegmentState(), r2.HasSegmentState())); } if (!r1.HasSegmentState()) { // Neither has a segment, so neither can be used for recover. // Call them equal. return(0); } // They both have a segment. QJournalProtocolProtos.SegmentStateProto r1Seg = r1.GetSegmentState(); QJournalProtocolProtos.SegmentStateProto r2Seg = r2.GetSegmentState(); Preconditions.CheckArgument(r1Seg.GetStartTxId() == r2Seg.GetStartTxId(), "Should only be called with responses for corresponding segments: " + "%s and %s do not have the same start txid.", r1, r2); // If one is in-progress but the other is finalized, // the finalized one is greater. if (r1Seg.GetIsInProgress() != r2Seg.GetIsInProgress()) { return(Booleans.Compare(!r1Seg.GetIsInProgress(), !r2Seg.GetIsInProgress())); } if (!r1Seg.GetIsInProgress()) { // If both are finalized, they should match lengths if (r1Seg.GetEndTxId() != r2Seg.GetEndTxId()) { throw new Exception("finalized segs with different lengths: " + r1 + ", " + r2); } return(0); } // Both are in-progress. long r1SeenEpoch = Math.Max(r1.GetAcceptedInEpoch(), r1.GetLastWriterEpoch()); long r2SeenEpoch = Math.Max(r2.GetAcceptedInEpoch(), r2.GetLastWriterEpoch()); return(ComparisonChain.Start().Compare(r1SeenEpoch, r2SeenEpoch).Compare(r1.GetSegmentState ().GetEndTxId(), r2.GetSegmentState().GetEndTxId()).Result()); }
private static List <int> GetInternalDistributionTypeIds(Project project) { List <int> ids = new List <int>(); DataSheet ds = project.GetDataSheet(Strings.DISTRIBUTION_TYPE_DATASHEET_NAME); foreach (DataRow dr in ds.GetData().Rows) { if (dr.RowState != DataRowState.Deleted) { if (Booleans.BoolFromValue(dr[Strings.DISTRIBUTION_TYPE_IS_INTERNAL_COLUMN_NAME])) { ids.Add(Convert.ToInt32(dr[ds.PrimaryKeyColumn.Name], CultureInfo.InvariantCulture)); } } } return(ids); }
protected HttpWebRequest(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) { #if DEBUG using (GlobalLog.SetThreadKind(ThreadKinds.User)) { #endif _webHeaderCollection = (WebHeaderCollection)serializationInfo.GetValue("_HttpRequestHeaders", typeof(WebHeaderCollection)); Proxy = (IWebProxy)serializationInfo.GetValue("_Proxy", typeof(IWebProxy)); KeepAlive = serializationInfo.GetBoolean("_KeepAlive"); Pipelined = serializationInfo.GetBoolean("_Pipelined"); AllowAutoRedirect = serializationInfo.GetBoolean("_AllowAutoRedirect"); if (!serializationInfo.GetBoolean("_AllowWriteStreamBuffering")) { _Booleans &= ~Booleans.AllowWriteStreamBuffering; } _maximumAllowedRedirections = serializationInfo.GetInt32("_MaximumAllowedRedirections"); AllowAutoRedirect = serializationInfo.GetInt32("_AutoRedirects") > 0; Timeout = serializationInfo.GetInt32("_Timeout"); try { ReadWriteTimeout = serializationInfo.GetInt32("_ReadWriteTimeout"); } catch { // default } try { MaximumResponseHeadersLength = serializationInfo.GetInt32("_MaximumResponseHeadersLength"); } catch { // default } ContentLength = serializationInfo.GetInt64("_ContentLength"); MediaType = serializationInfo.GetString("_MediaType"); _originVerb = serializationInfo.GetString("_OriginVerb"); ConnectionGroupName = serializationInfo.GetString("_ConnectionGroupName"); ProtocolVersion = (Version)serializationInfo.GetValue("_Version", typeof(Version)); _requestUri = (Uri)serializationInfo.GetValue("_OriginUri", typeof(Uri)); #if DEBUG } #endif }
public void DisplayInfo() { Console.WriteLine($"length is {_length}"); Console.WriteLine($"Mask is "); foreach (var b in Mask.Reverse()) { Console.Write(b ? "1" : "0"); } Console.WriteLine(); Console.WriteLine($"Array is"); foreach (var b in Booleans.Reverse()) { Console.Write(b ? 1 : 0); } Console.WriteLine(); Console.WriteLine(); }
private void InitializeRunControl() { DataRow dr = this.ResultScenario.GetDataSheet(Shared.DATASHEET_RUN_CONTROL_NAME).GetDataRow(); DateTime Start = (DateTime)dr[Shared.DATASHEET_RUN_CONTROL_START_DATE_COLUMN_NAME]; DateTime End = (DateTime)dr[Shared.DATASHEET_RUN_CONTROL_END_DATE_COLUMN_NAME]; Start = new DateTime(Start.Year, Start.Month, Start.Day, 0, 0, 0); End = new DateTime(End.Year, End.Month, End.Day, 0, 0, 0); int TotalDays = (End - Start).Days + 1; //Timesteps this.MinimumTimestep = 1; this.MaximumTimestep = TotalDays; //Iterations this.MinimumIteration = Convert.ToInt32(dr[Shared.DATASHEET_RUN_CONTROL_MIN_ITERATION_COLUMN_NAME]); this.MaximumIteration = Convert.ToInt32(dr[Shared.DATASHEET_RUN_CONTROL_MAX_ITERATION_COLUMN_NAME]); //Historical deaths this.m_ModelHistoricalDeaths = Booleans.BoolFromValue( dr[Shared.DATASHEET_RUN_CONTROL_MODEL_HISTORICAL_DEATHS_COLUMN_NAME]); }
private void SetNumVar_Click(object sender, EventArgs e) { varNames.Clear(); for (int i = 0; i < numVarUpDown.Value; i++) { varNames.Add(((char)(i + 0x61)).ToString()); } List <Token> tokens = new List <Token>(); foreach (string s in varNames) { tokens.Add(new Token(TokenType.Text, s)); } Token result = Booleans.FillBool("fillbool", tokens); if (result.TokenType == TokenType.Error) { MessageBox.Show("Something's is wrong with your luck! Operation failed. Variables may be corrupt!"); return; } this.createTableButton.Enabled = true; this.addColButton.Enabled = true; }
/// <summary> /// Normalizes the tabular output options data feed /// </summary> /// <remarks></remarks> private void NormalizeTabularOutputOptions() { DataSheet dsrc = this.ResultScenario.GetDataSheet(Strings.DATASHEET_RUN_CONTROL_NAME); DataRow drrc = dsrc.GetDataRow(); int MaxTimestep = Convert.ToInt32(drrc[Strings.RUN_CONTROL_MAX_TIMESTEP_COLUMN_NAME], CultureInfo.InvariantCulture); DataSheet dsoo = this.ResultScenario.GetDataSheet(Strings.DATASHEET_OO_TABULAR_NAME); DataRow droo = dsoo.GetDataRow(); if (droo == null) { droo = dsoo.GetData().NewRow(); dsoo.GetData().Rows.Add(droo); } bool AnyTabular = this.AnyTabularOutputOptionsSelected(); bool AnySpatial = this.AnySpatialOutputOptionsSelected(); bool AnySpatialAvg = this.AnySpatialAveragingOutputOptionsSelected(); if (!AnyTabular && !AnySpatial && !AnySpatialAvg) { DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SC_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TR_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TRSC_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SA_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TA_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SC_AGES_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TR_AGES_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SA_AGES_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TA_AGES_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SC_TIMESTEPS_COLUMN_NAME, 1); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TR_TIMESTEPS_COLUMN_NAME, 1); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TRSC_TIMESTEPS_COLUMN_NAME, 1); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SA_TIMESTEPS_COLUMN_NAME, 1); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TA_TIMESTEPS_COLUMN_NAME, 1); if (this.m_IsSpatial) { this.SetSpatialOutputDefaults(MaxTimestep); } this.RecordStatus(StatusType.Information, MessageStrings.STATUS_NO_OUTPUT_OPTIONS_WARNIING); } this.ValidateTimesteps(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SC_COLUMN_NAME, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SC_TIMESTEPS_COLUMN_NAME, "Summary state classes", MaxTimestep); this.ValidateTimesteps(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TR_COLUMN_NAME, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TR_TIMESTEPS_COLUMN_NAME, "Summary transitions", MaxTimestep); this.ValidateTimesteps(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TRSC_COLUMN_NAME, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TRSC_TIMESTEPS_COLUMN_NAME, "Summary transitions by state class", MaxTimestep); this.ValidateTimesteps(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SA_COLUMN_NAME, Strings.DATASHEET_OO_SUMMARY_OUTPUT_SA_TIMESTEPS_COLUMN_NAME, "Summary state attributes", MaxTimestep); this.ValidateTimesteps(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TA_COLUMN_NAME, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TA_TIMESTEPS_COLUMN_NAME, "Summary transition attributes", MaxTimestep); this.ValidateTimesteps(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_EV_COLUMN_NAME, Strings.DATASHEET_OO_SUMMARY_OUTPUT_EV_TIMESTEPS_COLUMN_NAME, "Summary external variables", MaxTimestep); this.ValidateTimesteps(droo, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TST_COLUMN_NAME, Strings.DATASHEET_OO_SUMMARY_OUTPUT_TST_TIMESTEPS_COLUMN_NAME, "Summary TST", MaxTimestep); }
private void SetSpatialOutputDefaults(int MaxTimestep) { Debug.Assert(this.m_IsSpatial); DataSheet dsoo = this.ResultScenario.GetDataSheet(Strings.DATASHEET_OO_SPATIAL_NAME); DataRow droo = dsoo.GetDataRow(); if (droo == null) { droo = dsoo.GetData().NewRow(); dsoo.GetData().Rows.Add(droo); } DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SPATIAL_RASTER_OUTPUT_SC_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SPATIAL_RASTER_OUTPUT_SC_TIMESTEPS_COLUMN_NAME, MaxTimestep); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SPATIAL_RASTER_OUTPUT_TR_COLUMN_NAME, Booleans.BoolToInt(true)); DataTableUtilities.SetRowValue(droo, Strings.DATASHEET_OO_SPATIAL_RASTER_OUTPUT_TR_TIMESTEPS_COLUMN_NAME, MaxTimestep); }
/// <summary> /// Returns storage content. /// </summary> /// <param name="type">The type of the storage content.</param> /// <param name="name">The name of the storage content.</param> public static object GetObject(string type, string name) { switch (type.ToLower()) { case "pokemon": if (Pokemons.ContainsKey(name)) { return(Pokemons[name]); } break; case "string": case "str": if (Strings.ContainsKey(name)) { return(Strings[name]); } break; case "integer": case "int": if (Integers.ContainsKey(name)) { return(Integers[name]); } break; case "boolean": case "bool": if (Booleans.ContainsKey(name)) { return(Booleans[name]); } break; case "item": if (Items.ContainsKey(name)) { return(Items[name]); } break; case "single": case "sng": if (Singles.ContainsKey(name)) { return(Singles[name]); } break; case "double": case "dbl": if (Doubles.ContainsKey(name)) { return(Doubles[name]); } break; } return(ScriptVersion2.ScriptComparer.DefaultNull); }
/// <summary> /// Adds or updates storage content. /// </summary> /// <param name="type">The type of the storage content.</param> /// <param name="name">The name of the storage content.</param> /// <param name="newContent">The new storage content.</param> public static void SetObject(string type, string name, object newContent) { switch (type.ToLower()) { case "pokemon": if (Pokemons.ContainsKey(name)) { Pokemons[name] = (BasePokemon)newContent; } else { Pokemons.Add(name, (BasePokemon)newContent); } break; case "string": case "str": if (Strings.ContainsKey(name)) { Strings[name] = Convert.ToString(newContent); } else { Strings.Add(name, Convert.ToString(newContent)); } break; case "integer": case "int": if (Integers.ContainsKey(name)) { Integers[name] = @int(newContent); } else { Integers.Add(name, @int(newContent)); } break; case "boolean": case "bool": if (Booleans.ContainsKey(name)) { Booleans[name] = Convert.ToBoolean(newContent); } else { Booleans.Add(name, Convert.ToBoolean(newContent)); } break; case "item": if (Items.ContainsKey(name)) { Items[name] = (BaseItem)newContent; } else { Items.Add(name, (BaseItem)newContent); } break; case "single": case "sng": if (Singles.ContainsKey(name)) { Singles[name] = sng(newContent); } else { Singles.Add(name, sng(newContent)); } break; case "double": case "dbl": if (Doubles.ContainsKey(name)) { Doubles[name] = dbl(newContent); } else { Doubles.Add(name, dbl(newContent)); } break; } }
/*private*/ protected HttpWebRequest(SerializationInfo serializationInfo, StreamingContext streamingContext):base(serializationInfo, streamingContext) { #if DEBUG using (GlobalLog.SetThreadKind(ThreadKinds.User)) { #endif ExceptionHelper.WebPermissionUnrestricted.Demand(); if(Logging.On)Logging.Enter(Logging.Web, this, "HttpWebRequest", serializationInfo); _HttpRequestHeaders = (WebHeaderCollection)serializationInfo.GetValue("_HttpRequestHeaders", typeof(WebHeaderCollection)); _Proxy = (IWebProxy)serializationInfo.GetValue("_Proxy", typeof(IWebProxy)); KeepAlive = serializationInfo.GetBoolean("_KeepAlive"); Pipelined = serializationInfo.GetBoolean("_Pipelined"); AllowAutoRedirect = serializationInfo.GetBoolean("_AllowAutoRedirect"); if (!serializationInfo.GetBoolean("_AllowWriteStreamBuffering")) { _Booleans &= ~Booleans.AllowWriteStreamBuffering; } HttpWriteMode = (HttpWriteMode)serializationInfo.GetInt32("_HttpWriteMode"); _MaximumAllowedRedirections = serializationInfo.GetInt32("_MaximumAllowedRedirections"); _AutoRedirects = serializationInfo.GetInt32("_AutoRedirects"); _Timeout = serializationInfo.GetInt32("_Timeout"); m_ContinueTimeout = DefaultContinueTimeout; // This ctor is deprecated. Just set the default value. m_ContinueTimerQueue = s_ContinueTimerQueue; try { _ReadWriteTimeout = serializationInfo.GetInt32("_ReadWriteTimeout"); } catch { _ReadWriteTimeout = DefaultReadWriteTimeout; } try { _MaximumResponseHeadersLength = serializationInfo.GetInt32("_MaximumResponseHeadersLength"); } catch { _MaximumResponseHeadersLength = DefaultMaximumResponseHeadersLength; } _ContentLength = serializationInfo.GetInt64("_ContentLength"); _MediaType = serializationInfo.GetString("_MediaType"); _OriginVerb = KnownHttpVerb.Parse(serializationInfo.GetString("_OriginVerb")); _ConnectionGroupName = serializationInfo.GetString("_ConnectionGroupName"); ProtocolVersion = (Version)serializationInfo.GetValue("_Version", typeof(Version)); _OriginUri = (Uri)serializationInfo.GetValue("_OriginUri", typeof(Uri)); #if HTTP_HEADER_EXTENSIONS_SUPPORTED _NextExtension = serializationInfo.GetInt32("_NextExtension"); #endif // HTTP_HEADER_EXTENSIONS_SUPPORTED SetupCacheProtocol(_OriginUri); if(Logging.On)Logging.Exit(Logging.Web, this, "HttpWebRequest", null); #if DEBUG } #endif }
// This ctor is used to override the default behavior of throwing exceptions if the server responds with a // final status code other than 2xx. If returnResponseOnFailureStatusCode is set to true, HWR will return a // HttpWebResponse object without throwing exceptions even if the server returned 3xx, 4xx, 5xx status codes. // This is also the case if the user provided e.g. credentials and authentication failed. In that case the // final 401/407 response from the server will be returned to the caller. Similar, if AllowAutoRedirect is set // to true, and the number of redirections was exceeded the last 3xx response is returned to the caller. // This ctor overload also takes a delegate ('resendRequestContent') that is used to resend the content, as // opposed to buffering the content (AllowWriteStreamBuffering). internal HttpWebRequest(Uri uri, bool returnResponseOnFailureStatusCode, string connectionGroupName, Action<Stream> resendRequestContent) : this(uri, null) { if (Logging.On) Logging.Enter(Logging.Web, this, "HttpWebRequest", "uri: '" + uri + "', connectionGroupName: '" + connectionGroupName + "'"); _returnResponseOnFailureStatusCode = returnResponseOnFailureStatusCode; _resendRequestContent = resendRequestContent; // This ctor uses the 'resendRequestContent' delegate to resend content. We don't do buffering in this case. _Booleans &= ~Booleans.AllowWriteStreamBuffering; // Make sure we don't share connection groups with user-defined connection groups. m_InternalConnectionGroup = true; _ConnectionGroupName = connectionGroupName; if(Logging.On)Logging.Exit(Logging.Web, this, "HttpWebRequest", null); }