public void AddWindow(Graphics graphic, Point startPoint, Point endPoint, string sense) { PriceAndCost priceAndCost = PRICE_AND_COST_HANDLER.GetPriceAndCostWindow(); if (FreePosition(startPoint)) { Window window = new Window(startPoint, endPoint, sense); WINDOW_HANDLER.Add(this, window, priceAndCost); } }
public override void ExecuteFormat(DataValue Structure, DataValue Indicators) { RecordInfo recordFormat = RecordFormats[Structure.GetName().ToUpper()]; //Kick in gui.cs this.Write(Structure); foreach (View view in localFields.Values) { WindowHandler.Add(view); } WindowHandler.SetKeys(recordFormat.Function.Keys.ToArray()); Key result = WindowHandler.Run(); int indicator = 0; if (recordFormat.Function.ContainsKey(result)) { indicator = recordFormat.Function[result]; } for (int i = 1; i <= 99; i++) { Indicators.GetData("IN" + i.ToString().PadLeft(2, '0')).Set(i == indicator); } foreach (string varName in Structure.GetSubfieldNames()) { if (this.localFields[varName] is TextField) { Structure.GetData(varName).Set((this.localFields[varName] as TextField).Text.ToString()); } } localFields = new Dictionary <string, View>(); }
public override void ExecuteFormat(DataValue Structure, DataValue Indicators) { RecordInfo recordFormat = RecordFormats[Structure.GetName().ToUpper()]; bool isSubfile = recordFormat.Keywords.Keys.Contains("SFLCTL"); string subfileName = recordFormat.Keywords["SFLCTL"]; Subfile subfile; //Kick in gui.cs if (isSubfile) { subfile = Subfiles[subfileName]; int rows = subfile.PerPage; for (int row = 0; row < rows && row < subfile.rows.Count; row++) { this.WriteSubfileRow(RecordFormats[subfileName], row); } } else { this.Write(Structure, null); } foreach (View view in localFields.Values) { WindowHandler.Add(view); } WindowHandler.SetKeys(recordFormat.Function.Keys.ToArray()); Key result = WindowHandler.Run(); int indicator = 0; if (recordFormat.Function.ContainsKey(result)) { indicator = recordFormat.Function[result]; } for (int i = 1; i <= 99; i++) { Indicators.GetData("IN" + i.ToString().PadLeft(2, '0')).Set(i == indicator); } if (isSubfile) { //Store subfile results back into subfile.rows string[] pieces; int rowIndex; string value; this._EOF = true; this._RowPointer = -1; foreach (string field in this.localFields.Keys) { if (this.localFields[field] is TextField) { pieces = field.Split('-'); rowIndex = int.Parse(pieces[1]); value = (this.localFields[field] as TextField).Text.ToString(); if (value.Trim() != Subfiles[subfileName].rows[rowIndex].Columns[pieces[0]].Trim()) { Subfiles[subfileName].rows[rowIndex].Columns[pieces[0]] = value; Subfiles[subfileName].rows[rowIndex].Changed = true; } else { Subfiles[subfileName].rows[rowIndex].Changed = false; } } } } else { //Not a subfile, restore values back into fields from EXFMT structure foreach (string varName in Structure.GetSubfieldNames()) { if (this.localFields.ContainsKey(varName)) { if (this.localFields[varName] is TextField) { Structure.GetData(varName).Set((this.localFields[varName] as TextField).Text.ToString()); } } } } localFields = new Dictionary <string, View>(); }