public GridLabel(IMapName map, DataSource ds) : base(map as Rect) { _datasource = ds; _eventtype = (map as IGridEvent).EventType; _bshowatreal = (map as IGridEvent).bShowAtReal; _sortoption = (map as ISort).SortOption; }
public TravelOption(IMapName i_mapName, int i_optionIndex, IWorldMissionProgress i_missionProgress) : base() { mOptionIndex = i_optionIndex; string name = GetOptionName(i_mapName, i_missionProgress, mOptionIndex); SetOptionName(name); SetOptionAvailability(i_missionProgress, mOptionIndex); }
internal void Remove(IMapName c) { if (!Contains(c)) { return; } InnerList.Remove(c); }
internal int Add(IMapName c) { if (Contains(c)) { return(IndexOf(c)); } return(InnerList.Add(c)); }
public void Remove(string mapname) { IMapName map = this[mapname]; if (map != null) { Remove(map); } }
public int IndexOf(IMapName c) { if (!Contains(c)) { return(-1); } else { return(InnerList.IndexOf(c)); } }
public void WithGoodMissionProgress_TravelOptionNameIsMapName() { string testName = "Test"; IMapName mapName = Substitute.For <IMapName>(); mapName.GetStringName().Returns(testName); TravelOption optionUnderTest = GetBasicTravelOptionForTest(); string name = optionUnderTest.GetOptionName(mapName, GetGoodMissionProgress(), 0); Assert.AreEqual(testName, name); }
internal void AddAt(IMapName c, int index) { if (index < 0 || index > InnerList.Count - 1) { return; } if (Contains(c)) { return; } InnerList.Insert(index, c); }
internal int AddHeader(IMapName c) { if (Contains(c)) { return(IndexOf(c)); } for (int i = 0; i < Count; i++) { if ((c as Cell).X < (this[i] as Cell).X) { AddAt(c, i); return(i); } } return(InnerList.Add(c)); }
public void Add(IMapName value) { if (!(value is ICalculateSequence)) { return; } for (int i = 0; i < Count; i++) { if ((value as ICalculateSequence).CalculateIndex < (this[i] as ICalculateSequence).CalculateIndex) { this.InnerList.Insert(i, value); return; } } this.InnerList.Add(value); }
public GridProportionDecimal(IMapName map, DataSource ds) : base(map, ds) { _datasource = ds; _bcalcaftercross = false; _bsummary = (map as IGridCollect).bSummary; _bclue = (map as IGridCollect).bClue; _operator = (map as IGridCollect).Operator; _unit = (map as IGridCollect).Unit; _calculateindex = (map as IGridCollect).CalculateIndex; _eventtype = (map as IGridEvent).EventType; _bshowatreal = (map as IGridEvent).bShowAtReal; _precision = (map as IDecimal).Precision; _formatstring = (map as IDecimal).FormatString; _sortoption = (map as ISort).SortOption; _bshowwhenzero = (map as IDecimal).bShowWhenZero; _pointlength = (map as IDecimal).PointLength; }
public void AddColumn(IMapName map) { if (!(map is IDataSource) && !_datasources.Contains(map.MapName.Trim())) { DataType dt = DataType.String; if (map is IDecimal) { dt = DataType.Decimal; } else if (map is IDateTime || ((map is IBDateTime) && (map as IBDateTime).bDateTime)) { dt = DataType.DateTime; } else if (map is ICalculateColumn && !ExpressionService.bExpressionReallyNotADecimalType((map as ICalculateColumn).Expression, this.DataSources)) { dt = DataType.Decimal; } //DataSource ds = new DataSource(map.MapName.Trim(), dt); //ds.bAppend = true; //if (map is ICalculateColumn && map.MapName.ToLower() != (map as ICalculateColumn).Expression.ToLower()) // ds.Tag = (map as ICalculateColumn).Expression; //_datasources.Add(ds); if (!(map is ICalculateColumn) || map.MapName.ToLower() != (map as ICalculateColumn).Expression.ToLower()) { DataSource ds = new DataSource(map.MapName.Trim(), dt); ds.bAppend = true; if (map is ICalculateColumn && map.MapName.ToLower() != (map as ICalculateColumn).Expression.ToLower()) { ds.Tag = (map as ICalculateColumn).Expression; if (ds.Tag.Contains(@"/")) { ds.Tag = "isnull(" + ds.Tag + ",0)"; } } _datasources.Add(ds); } } }
private void _designer_DesignerCompileSupport(object sender, DesignerCompilerArgs e) { if (e.EditType != ExpressionDesigner.ExpressionDesigner.EditType.Script) { return; } ScriptHelper sh = null; Report report = null; string reportinitstring = null; string reportrowfiltermapkeys = null; if (_object is Report) { report = _object as Report; reportinitstring = report.InitEvent; report.InitEvent = e.ResultString; sh = new ScriptHelper(report); } else if (_object is RowFilter) { report = (_object as RowFilter).Parent; sh = new ScriptHelper(report); reportrowfiltermapkeys = (_object as RowFilter).MapKeys; (_object as RowFilter).MapKeys = e.ResultString; } else { #region cell (_object as Cell).GetReport(); report = (_object as Cell).Report; foreach (Section section in report.Sections) { foreach (Cell cell in section.Cells) { if (cell is IMapName) { IMapName map = cell as IMapName; if (!report.DataSources.Contains(map.MapName.Trim())) { DataType dt = DataType.String; if (map is IDecimal) { dt = DataType.Decimal; } else if (map is IDateTime) { dt = DataType.DateTime; } report.DataSources.Add(new DataSource(map.MapName.Trim(), dt)); } } } } sh = new ScriptHelper(report); string cellstring = sh.CellString(_object as Cell, e.ResultString, _type); AddScriptKey(e.ResultString, report, sh); foreach (string name in sh.DSFunctions.Keys) { cellstring = cellstring.Replace("current." + name, "current." + sh.DSFunctions.GetString(name).ToString()); cellstring = cellstring.Replace("previous." + name, "previous." + sh.DSFunctions.GetString(name).ToString()); } sh.AddScript(cellstring); #endregion } sh.References.Add(ExecutePath + "UFIDA.U8.UAP.Services.ReportData.dll"); sh.References.Add(ExecutePath + "UFIDA.U8.UAP.Services.ReportElements.dll"); sh.References.Add(ExecutePath + "UFIDA.U8.UAP.Services.ReportFilterService.dll"); //sh.References.Add(ExecutePath + "UFSoft.U8.Report.Exhibition.dll"); //sh.References.Add(ExecutePath + "UFSoft.U8.Ex.Filter.dll"); sh.OutputAssembly = null; CompilerResults cr = sh.Compile(); if (cr.Errors.Count > 0) { e.IsCompileSucceed = false; for (int i = 0; i < cr.Errors.Count; i++) { cr.Errors[i].Line -= 18; } e.Error = cr.Errors; } else { e.IsCompileSucceed = true; } if (reportinitstring != null) { (_object as Report).InitEvent = reportinitstring; } if (reportrowfiltermapkeys != null) { (_object as RowFilter).MapKeys = reportrowfiltermapkeys; } }
public bool Contains(IMapName c) { return(InnerList.Contains(c)); }
public string GetOptionName(IMapName i_mapName, IWorldMissionProgress i_missionProgress, int i_optionIndex) { bool isAvailable = IsOptionAvailable(i_missionProgress, i_optionIndex); return(isAvailable ? i_mapName.GetStringName() : GetUnavailableText(i_missionProgress, i_optionIndex)); }
public void Remove(IMapName map) { this.InnerList.Remove(map); }