void OnLayoutUpdated(object sender, EventArgs e) { if(!IsLoaded) return; LayoutUpdated -= OnLayoutUpdated; Rows rows = new Rows(this); PrepareColumns(rows); CorrectColumnsWidth(rows); }
public Move(Columns column, Rows row, Values value, int score = 0) : this() { Row = row; Column = column; Value = value; Score = score; }
public GantChart() { InitializeComponent(); items = new Rows(); graphField1.SelectItem += new GraphField.ItemChanged(GraphFieldItemChanged); graphField1.SelectLostItem += new GraphField.ItemChanged(GraphFieldItemChangedLost); }
/// <summary> /// Initializes a new instance of <see cref="Workspace"/> for a given <see cref="Token"/> with a given <see cref="ICommunication"/> /// </summary> /// <param name="token"><see cref="Token">Access token to use</see></param> /// <param name="communication"><see cref="ICommunication"/> to use</param> public Workspace(Token token, ICommunication communication) { _communication = communication; Groups = new Groups(token, communication); Datasets = new Datasets(token, communication); Tables = new Tables(token, communication); Rows = new Rows(token, communication); Dashboards = new Dashboards(token, communication); Reports = new Reports(token, communication); Tiles = new Tiles(token, communication); }
Rows _Data; // set dynamically when needed internal MatrixEntry(MatrixEntry p, int rowCount) { _HashData = new Hashtable(); _ColumnGroup = null; _RowGroup = null; _SortedData = null; _Data = null; _rowCount = rowCount; _Rows = null; _Parent = p; _FirstRow = -1; _LastRow = -1; }
internal Worksheet(XlsDocument doc) { _doc = doc; _visibility = WorksheetVisibilities.Default; _sheettype = WorksheetTypes.Default; _streamByteLength = 0; _dbCellOffsets = new int[0]; _cells = new Cells(this); _rows = new Rows(); _rowBlocks = new RowBlocks(this); _cachedBlockRow = CachedBlockRow.Empty; _columnInfos = new List<ColumnInfo>(); }
/// <summary> /// Gets a textual representation of the section - eg. to be used in Examine. /// </summary> /// <returns>Returns an instance of <see cref="System.String"/> representing the value of the section.</returns> public virtual string GetSearchableText() { return(Rows.Aggregate("", (current, row) => current + row.GetSearchableText())); }
public void clearRowsAndColumns() { Rows.Clear(); Columns.Clear(); }
public Values GetCellValue(Columns column, Rows row) { return this._BoardValues[(int)column, (int)row]; }
public IEnumerable<Values> GetValueOptions(Columns column, Rows row) { var usedValues = GetDeniedValues(column, row); for (int i = 0; i < 9; i++) { Values candidate = (Values)(1 << i); if ((usedValues & candidate) == Values.None) yield return candidate; } }
internal void RunPage(Pages pgs, Rows rs, int start, int end, float footerHeight) { // if no rows output or rows just leave if (rs == null || rs.Data == null) return; if (this.Visibility != null && Visibility.IsHidden(pgs.Report, rs.Data[start])) return; // not visible Page p; Row row; for (int r=start; r <= end; r++) { p = pgs.CurrentPage; // this can change after running a row row = rs.Data[r]; float hrows = HeightOfRows(pgs, row); // height of all the rows in the details float height = p.YOffset + hrows; if (r == end) height += footerHeight; // on last row; may need additional room for footer if (height > pgs.BottomOfPage) { p = OwnerTable.RunPageNew(pgs, p); OwnerTable.RunPageHeader(pgs, row, false, null); _TableRows.RunPage(pgs, row, true); // force checking since header + hrows might be > BottomOfPage } else _TableRows.RunPage(pgs, row, hrows > pgs.BottomOfPage); } return; }
int _RowNumber; // Original row # #endregion Fields #region Constructors // Constructor that uses existing Row data internal Row(Rows r, Row rd) { _R = r; _Data = rd.Data; _Level = rd.Level; }
protected override void RenderFieldForInput(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0"); writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0"); writer.AddAttribute(HtmlTextWriterAttribute.Border, "0"); writer.RenderBeginTag(HtmlTextWriterTag.Table); writer.RenderBeginTag(HtmlTextWriterTag.Tr); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); writer.AddAttribute(HtmlTextWriterAttribute.Title, Field.Title); writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClass); if (!Width.IsEmpty) { writer.AddStyleAttribute(HtmlTextWriterStyle.Width, Width.ToString()); } if (!AllowFillIn) { writer.AddAttribute(HtmlTextWriterAttribute.ReadOnly, "readonly"); } if (Rows == 1) { writer.AddAttribute(HtmlTextWriterAttribute.Value, Convert.ToString(Value)); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); // input } else { writer.AddAttribute(HtmlTextWriterAttribute.Rows, Rows.ToString()); writer.RenderBeginTag(HtmlTextWriterTag.Textarea); writer.Write(Value); writer.RenderEndTag(); // textarea } writer.RenderEndTag(); // td writer.AddAttribute(HtmlTextWriterAttribute.Valign, "top"); writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingLeft, "3px"); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)"); writer.AddAttribute(HtmlTextWriterAttribute.Title, "Browser"); writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("__Dialog__{0}()", ClientID)); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.AddAttribute(HtmlTextWriterAttribute.Alt, "Browser"); writer.AddStyleAttribute(HtmlTextWriterStyle.BorderWidth, "0"); writer.AddAttribute(HtmlTextWriterAttribute.Src, "/_layouts/images/addressbook.gif"); writer.RenderBeginTag(HtmlTextWriterTag.Img); writer.RenderEndTag(); // img writer.RenderEndTag(); // a writer.RenderEndTag(); // td writer.RenderEndTag(); // tr writer.RenderEndTag(); // table RenderValidationMessage(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript"); writer.RenderBeginTag(HtmlTextWriterTag.Script); var serverRelativeUrl = GetContextWeb(Context).ServerRelativeUrl; if (!serverRelativeUrl.EndsWith("/")) { serverRelativeUrl += "/"; } var urlToEncode = SPHttpUtility.UrlPathEncode(serverRelativeUrl, false); writer.Write(string.Format("function __Dialog__{0}(){{", ClientID)); writer.Write(string.Format("var dialogUrl = '{0}_layouts/Picker.aspx?MultiSelect={1}&CustomProperty={5}&DefaultSearch=&DialogTitle={2}&DialogImage={3}&PickerDialogType={4}&ForceClaims=False&DisableClaims=False&EnabledClaimProviders=&EntitySeparator=\u00253B\u0025EF\u0025BC\u00259B\u0025EF\u0025B9\u002594\u0025EF\u0025B8\u002594\u0025E2\u00258D\u0025AE\u0025E2\u002581\u00258F\u0025E1\u00258D\u0025A4\u0025D8\u00259B';", urlToEncode, AllowMultipleValues ? "True" : "False", SPHttpUtility.UrlKeyValueEncode(DialogTitle), SPHttpUtility.UrlKeyValueEncode(DialogImage), SPHttpUtility.UrlKeyValueEncode(typeof(PeoplePickerDialog).AssemblyQualifiedName), SelectPeopleOnly ? "User;;15;;;False" : "User,SecGroup,SPGroup;;15;;;False")); writer.Write(string.Format("var features = 'resizable: yes; status: no; scroll: no; help: no; center: yes; dialogWidth : {0}px; dialogHeight : {1}px; zoominherit : 1';", DialogWidth, DialogHeight)); writer.Write(string.Format("commonShowModalDialog(dialogUrl, features, CallbackWrapper_{0});", ClientID)); writer.Write("}"); writer.WriteLine(); writer.Write(string.Format("function CallbackWrapper_{0}(result){{", ClientID)); writer.Write("var entities = GetEntities(result);"); writer.Write("if (entities == null) return;"); writer.Write("var values = [];"); writer.Write("for(var x = 0; x < entities.childNodes.length; x++){"); // begin for writer.Write("var entity = entities.childNodes[x];"); writer.Write("var accountName = entity.getAttribute(\"Key\");"); writer.Write("var displayName = entity.getAttribute(\"DisplayText\");"); writer.Write("var email = '';"); writer.Write("var extraData = EntityEditor_SelectSingleNode(entity, \"ExtraData\");"); writer.Write("if(extraData){"); // begin if writer.Write("var arrayOfDictionaryEntry = EntityEditor_SelectSingleNode(extraData, \"ArrayOfDictionaryEntry\");"); writer.Write("if(arrayOfDictionaryEntry){"); // begin if writer.Write("for(var y = 0; y < arrayOfDictionaryEntry.childNodes.length; y++){"); // begin for writer.Write("var key = EntityEditor_SelectSingleNode(arrayOfDictionaryEntry.childNodes[y], \"Key\");"); writer.Write("if(key.childNodes[0].nodeValue == 'Email'){"); writer.Write("var value = EntityEditor_SelectSingleNode(arrayOfDictionaryEntry.childNodes[y], \"Value\");"); writer.Write("if(value){email = value.childNodes[0].nodeValue;}"); writer.Write("}"); // end if writer.Write("}"); // end for // Append data switch (Format) { case ExtraUserFieldFormat.DisplayName: writer.Write("values.push(displayName);"); break; case ExtraUserFieldFormat.AccountName: writer.Write("values.push(accountName);"); break; case ExtraUserFieldFormat.Email: writer.Write("values.push(email);"); break; case ExtraUserFieldFormat.Custom: writer.Write(string.Format("values.push(__Dialog_CustomFormat_{0}(displayName, accountName, email));", ClientID)); break; default: throw new ArgumentOutOfRangeException(); } writer.Write("}"); // end if writer.Write("}"); // end if writer.Write("}"); // end for // Set value for textbox if (OverrideValue) { writer.Write(string.Format("document.getElementById('{0}').value = values.join('; ');", ClientID)); } else { writer.Write(string.Format("var element = document.getElementById('{0}');", ClientID)); writer.Write("var oldValue = element.value + '';"); writer.Write("var separate = ' ';"); writer.Write("if(oldValue == ''){separate = '';}"); writer.Write("element.value = oldValue + separate + values.join('; ');"); } writer.Write("}"); // end function writer.WriteLine(); if (Format == ExtraUserFieldFormat.Custom) { writer.Write(string.Format("function __Dialog_CustomFormat_{0}(displayName, accountName, email){{", ClientID)); writer.Write("var str = '{0}';", CustomFormat); writer.Write("str = str.replace(new RegExp(\"\\\\{0\\\\}\", \"gm\"), displayName);"); writer.Write("str = str.replace(new RegExp(\"\\\\{1\\\\}\", \"gm\"), accountName);"); writer.Write("str = str.replace(new RegExp(\"\\\\{2\\\\}\", \"gm\"), email);"); writer.Write("return str;"); writer.Write("}"); // end function } writer.RenderEndTag(); // script }
/** * @see https://www.openoffice.org/sc/excelfileformat.pdf */ private static Function[] ProduceFunctions() { Function[] retval = new Function[368]; retval[0] = new Count(); // COUNT retval[FunctionID.IF] = new IfFunc(); //nominally 1 retval[2] = LogicalFunction.ISNA; // IsNA retval[3] = LogicalFunction.ISERROR; // IsERROR retval[FunctionID.SUM] = AggregateFunction.SUM; //nominally 4 retval[5] = AggregateFunction.AVERAGE; // AVERAGE retval[6] = AggregateFunction.MIN; // MIN retval[7] = AggregateFunction.MAX; // MAX retval[8] = new Row(); // ROW retval[9] = new Column(); // COLUMN retval[10] = new Na(); // NA retval[11] = new Npv(); // NPV retval[12] = AggregateFunction.STDEV; // STDEV retval[13] = NumericFunction.DOLLAR; // DOLLAR retval[14] = new Fixed(); // FIXED retval[15] = NumericFunction.SIN; // SIN retval[16] = NumericFunction.COS; // COS retval[17] = NumericFunction.TAN; // TAN retval[18] = NumericFunction.ATAN; // ATAN retval[19] = new Pi(); // PI retval[20] = NumericFunction.SQRT; // SQRT retval[21] = NumericFunction.EXP; // EXP retval[22] = NumericFunction.LN; // LN retval[23] = NumericFunction.LOG10; // LOG10 retval[24] = NumericFunction.ABS; // ABS retval[25] = NumericFunction.INT; // INT retval[26] = NumericFunction.SIGN; // SIGN retval[27] = NumericFunction.ROUND; // ROUND retval[28] = new Lookup(); // LOOKUP retval[29] = new Index(); // INDEX retval[30] = new Rept(); // REPT retval[31] = TextFunction.MID; // MID retval[32] = TextFunction.LEN; // LEN retval[33] = new Value(); // VALUE retval[34] = new True(); // TRUE retval[35] = new False(); // FALSE retval[36] = new And(); // AND retval[37] = new Or(); // OR retval[38] = new Not(); // NOT retval[39] = NumericFunction.MOD; // MOD retval[40] = new NotImplementedFunction("DCOUNT"); // DCOUNT retval[41] = new NotImplementedFunction("DSUM"); // DSUM retval[42] = new NotImplementedFunction("DAVERAGE"); // DAVERAGE retval[43] = new DStarRunner(DStarRunner.DStarAlgorithmEnum.DMIN); // DMIN retval[44] = new NotImplementedFunction("DMAX"); // DMAX retval[45] = new NotImplementedFunction("DSTDEV"); // DSTDEV retval[46] = AggregateFunction.VAR; // VAR retval[47] = new NotImplementedFunction("DVAR"); // DVAR retval[48] = TextFunction.TEXT; // TEXT retval[49] = new NotImplementedFunction("LINEST"); // LINEST retval[50] = new NotImplementedFunction("TREND"); // TREND retval[51] = new NotImplementedFunction("LOGEST"); // LOGEST retval[52] = new NotImplementedFunction("GROWTH"); // GROWTH retval[53] = new NotImplementedFunction("GOTO"); // GOTO retval[54] = new NotImplementedFunction("HALT"); // HALT retval[56] = FinanceFunction.PV; // PV retval[57] = FinanceFunction.FV; // FV retval[58] = FinanceFunction.NPER; // NPER retval[59] = FinanceFunction.PMT; // PMT retval[60] = new Rate(); // RATE retval[61] = new Mirr(); // MIRR retval[62] = new Irr(); // IRR retval[63] = new Rand(); // RAND retval[64] = new Match(); // MATCH retval[65] = DateFunc.instance; // DATE retval[66] = new TimeFunc(); // TIME retval[67] = CalendarFieldFunction.DAY; // DAY retval[68] = CalendarFieldFunction.MONTH; // MONTH retval[69] = CalendarFieldFunction.YEAR; // YEAR retval[70] = WeekdayFunc.instance; // WEEKDAY retval[71] = CalendarFieldFunction.HOUR; retval[72] = CalendarFieldFunction.MINUTE; retval[73] = CalendarFieldFunction.SECOND; retval[74] = new Now(); retval[75] = new NotImplementedFunction("AREAS"); // AREAS retval[76] = new Rows(); // ROWS retval[77] = new Columns(); // COLUMNS retval[FunctionID.OFFSET] = new Offset(); //nominally 78 retval[79] = new NotImplementedFunction("ABSREF"); // ABSREF retval[80] = new NotImplementedFunction("RELREF"); // RELREF retval[81] = new NotImplementedFunction("ARGUMENT"); // ARGUMENT retval[82] = TextFunction.SEARCH; retval[83] = new NotImplementedFunction("TRANSPOSE"); // TRANSPOSE retval[84] = new NotImplementedFunction("ERROR"); // ERROR retval[85] = new NotImplementedFunction("STEP"); // STEP retval[86] = new NotImplementedFunction("TYPE"); // TYPE retval[87] = new NotImplementedFunction("ECHO"); // ECHO retval[88] = new NotImplementedFunction("SetNAME"); // SetNAME retval[89] = new NotImplementedFunction("CALLER"); // CALLER retval[90] = new NotImplementedFunction("DEREF"); // DEREF retval[91] = new NotImplementedFunction("WINDOWS"); // WINDOWS retval[92] = new NotImplementedFunction("SERIES"); // SERIES retval[93] = new NotImplementedFunction("DOCUMENTS"); // DOCUMENTS retval[94] = new NotImplementedFunction("ACTIVECELL"); // ACTIVECELL retval[95] = new NotImplementedFunction("SELECTION"); // SELECTION retval[96] = new NotImplementedFunction("RESULT"); // RESULT retval[97] = NumericFunction.ATAN2; // ATAN2 retval[98] = NumericFunction.ASIN; // ASIN retval[99] = NumericFunction.ACOS; // ACOS retval[FunctionID.CHOOSE] = new Choose(); //nominally 100 retval[101] = new Hlookup(); // HLOOKUP retval[102] = new Vlookup(); // VLOOKUP retval[103] = new NotImplementedFunction("LINKS"); // LINKS retval[104] = new NotImplementedFunction("INPUT"); // INPUT retval[105] = LogicalFunction.ISREF; // IsREF retval[106] = new NotImplementedFunction("GetFORMULA"); // GetFORMULA retval[107] = new NotImplementedFunction("GetNAME"); // GetNAME retval[108] = new NotImplementedFunction("SetVALUE"); // SetVALUE retval[109] = NumericFunction.LOG; // LOG retval[110] = new NotImplementedFunction("EXEC"); // EXEC retval[111] = TextFunction.CHAR; // CHAR retval[112] = TextFunction.LOWER; // LOWER retval[113] = TextFunction.UPPER; // UPPER retval[114] = TextFunction.PROPER; // PROPER retval[115] = TextFunction.LEFT; // LEFT retval[116] = TextFunction.RIGHT; // RIGHT retval[117] = TextFunction.EXACT; // EXACT retval[118] = TextFunction.TRIM; // TRIM retval[119] = new Replace(); // Replace retval[120] = new Substitute(); // SUBSTITUTE retval[121] = new Code(); // CODE retval[122] = new NotImplementedFunction("NAMES"); // NAMES retval[123] = new NotImplementedFunction("DIRECTORY"); // DIRECTORY retval[124] = TextFunction.FIND; // Find retval[125] = new NotImplementedFunction("CELL"); // CELL retval[126] = LogicalFunction.ISERR; // IsERR retval[127] = LogicalFunction.ISTEXT; // IsTEXT retval[128] = LogicalFunction.ISNUMBER; // IsNUMBER retval[129] = LogicalFunction.ISBLANK; // IsBLANK retval[130] = new T(); // T retval[131] = new NotImplementedFunction("N"); // N retval[132] = new NotImplementedFunction("FOPEN"); // FOPEN retval[133] = new NotImplementedFunction("FCLOSE"); // FCLOSE retval[134] = new NotImplementedFunction("FSIZE"); // FSIZE retval[135] = new NotImplementedFunction("FReadLN"); // FReadLN retval[136] = new NotImplementedFunction("FRead"); // FRead retval[137] = new NotImplementedFunction("FWriteLN"); // FWriteLN retval[138] = new NotImplementedFunction("FWrite"); // FWrite retval[139] = new NotImplementedFunction("FPOS"); // FPOS retval[140] = new NotImplementedFunction("DATEVALUE"); // DATEVALUE retval[141] = new NotImplementedFunction("TIMEVALUE"); // TIMEVALUE retval[142] = new NotImplementedFunction("SLN"); // SLN retval[143] = new NotImplementedFunction("SYD"); // SYD retval[144] = new NotImplementedFunction("DDB"); // DDB retval[145] = new NotImplementedFunction("GetDEF"); // GetDEF retval[146] = new NotImplementedFunction("REFTEXT"); // REFTEXT retval[147] = new NotImplementedFunction("TEXTREF"); // TEXTREF retval[FunctionID.INDIRECT] = null; // Indirect.Evaluate has different signature retval[149] = new NotImplementedFunction("REGISTER"); // REGISTER retval[150] = new NotImplementedFunction("CALL"); // CALL retval[151] = new NotImplementedFunction("AddBAR"); // AddBAR retval[152] = new NotImplementedFunction("AddMENU"); // AddMENU retval[153] = new NotImplementedFunction("AddCOMMAND"); // AddCOMMAND retval[154] = new NotImplementedFunction("ENABLECOMMAND"); // ENABLECOMMAND retval[155] = new NotImplementedFunction("CHECKCOMMAND"); // CHECKCOMMAND retval[156] = new NotImplementedFunction("RenameCOMMAND"); // RenameCOMMAND retval[157] = new NotImplementedFunction("SHOWBAR"); // SHOWBAR retval[158] = new NotImplementedFunction("DELETEMENU"); // DELETEMENU retval[159] = new NotImplementedFunction("DELETECOMMAND"); // DELETECOMMAND retval[160] = new NotImplementedFunction("GetCHARTITEM"); // GetCHARTITEM retval[161] = new NotImplementedFunction("DIALOGBOX"); // DIALOGBOX retval[162] = TextFunction.CLEAN; // CLEAN retval[163] = new NotImplementedFunction("MDETERM"); // MDETERM retval[164] = new NotImplementedFunction("MINVERSE"); // MINVERSE retval[165] = new NotImplementedFunction("MMULT"); // MMULT retval[166] = new NotImplementedFunction("FILES"); // FILES retval[167] = new IPMT(); retval[168] = new PPMT(); retval[169] = new Counta(); // COUNTA retval[170] = new NotImplementedFunction("CANCELKEY"); // CANCELKEY retval[175] = new NotImplementedFunction("INITIATE"); // INITIATE retval[176] = new NotImplementedFunction("REQUEST"); // REQUEST retval[177] = new NotImplementedFunction("POKE"); // POKE retval[178] = new NotImplementedFunction("EXECUTE"); // EXECUTE retval[179] = new NotImplementedFunction("TERMINATE"); // TERMINATE retval[180] = new NotImplementedFunction("RESTART"); // RESTART retval[181] = new NotImplementedFunction("HELP"); // HELP retval[182] = new NotImplementedFunction("GetBAR"); // GetBAR retval[183] = AggregateFunction.PRODUCT; // PRODUCT retval[184] = NumericFunction.FACT; // FACT retval[185] = new NotImplementedFunction("GetCELL"); // GetCELL retval[186] = new NotImplementedFunction("GetWORKSPACE"); // GetWORKSPACE retval[187] = new NotImplementedFunction("GetWINDOW"); // GetWINDOW retval[188] = new NotImplementedFunction("GetDOCUMENT"); // GetDOCUMENT retval[189] = new NotImplementedFunction("DPRODUCT"); // DPRODUCT retval[190] = LogicalFunction.ISNONTEXT; // IsNONTEXT retval[191] = new NotImplementedFunction("GetNOTE"); // GetNOTE retval[192] = new NotImplementedFunction("NOTE"); // NOTE retval[193] = new NotImplementedFunction("STDEVP"); // STDEVP retval[194] = AggregateFunction.VARP; // VARP retval[195] = new NotImplementedFunction("DSTDEVP"); // DSTDEVP retval[196] = new NotImplementedFunction("DVARP"); // DVARP retval[197] = NumericFunction.TRUNC; // TRUNC retval[198] = LogicalFunction.ISLOGICAL; // IsLOGICAL retval[199] = new NotImplementedFunction("DCOUNTA"); // DCOUNTA retval[200] = new NotImplementedFunction("DELETEBAR"); // DELETEBAR retval[201] = new NotImplementedFunction("UNREGISTER"); // UNREGISTER retval[204] = new NotImplementedFunction("USDOLLAR"); // USDOLLAR retval[205] = new NotImplementedFunction("FindB"); // FindB retval[206] = new NotImplementedFunction("SEARCHB"); // SEARCHB retval[207] = new NotImplementedFunction("ReplaceB"); // ReplaceB retval[208] = new NotImplementedFunction("LEFTB"); // LEFTB retval[209] = new NotImplementedFunction("RIGHTB"); // RIGHTB retval[210] = new NotImplementedFunction("MIDB"); // MIDB retval[211] = new NotImplementedFunction("LENB"); // LENB retval[212] = NumericFunction.ROUNDUP; // ROUNDUP retval[213] = NumericFunction.ROUNDDOWN; // ROUNDDOWN retval[214] = new NotImplementedFunction("ASC"); // ASC retval[215] = new NotImplementedFunction("DBCS"); // DBCS retval[216] = new Rank(); // RANK retval[219] = new Address(); // AddRESS retval[220] = new Days360(); // DAYS360 retval[221] = new Today(); // TODAY retval[222] = new NotImplementedFunction("VDB"); // VDB retval[227] = AggregateFunction.MEDIAN; // MEDIAN retval[228] = new Sumproduct(); // SUMPRODUCT retval[229] = NumericFunction.SINH; // SINH retval[230] = NumericFunction.COSH; // COSH retval[231] = NumericFunction.TANH; // TANH retval[232] = NumericFunction.ASINH; // ASINH retval[233] = NumericFunction.ACOSH; // ACOSH retval[234] = NumericFunction.ATANH; // ATANH retval[235] = new DStarRunner(DStarRunner.DStarAlgorithmEnum.DGET); // DGet retval[236] = new NotImplementedFunction("CreateOBJECT"); // CreateOBJECT retval[237] = new NotImplementedFunction("VOLATILE"); // VOLATILE retval[238] = new NotImplementedFunction("LASTERROR"); // LASTERROR retval[239] = new NotImplementedFunction("CUSTOMUNDO"); // CUSTOMUNDO retval[240] = new NotImplementedFunction("CUSTOMREPEAT"); // CUSTOMREPEAT retval[241] = new NotImplementedFunction("FORMULAConvert"); // FORMULAConvert retval[242] = new NotImplementedFunction("GetLINKINFO"); // GetLINKINFO retval[243] = new NotImplementedFunction("TEXTBOX"); // TEXTBOX retval[244] = new NotImplementedFunction("INFO"); // INFO retval[245] = new NotImplementedFunction("GROUP"); // GROUP retval[246] = new NotImplementedFunction("GetOBJECT"); // GetOBJECT retval[247] = new NotImplementedFunction("DB"); // DB retval[248] = new NotImplementedFunction("PAUSE"); // PAUSE retval[250] = new NotImplementedFunction("RESUME"); // RESUME retval[252] = new NotImplementedFunction("FREQUENCY"); // FREQUENCY retval[253] = new NotImplementedFunction("AddTOOLBAR"); // AddTOOLBAR retval[254] = new NotImplementedFunction("DELETETOOLBAR"); // DELETETOOLBAR retval[FunctionID.EXTERNAL_FUNC] = null; // ExternalFunction is a FreeREfFunction retval[256] = new NotImplementedFunction("RESetTOOLBAR"); // RESetTOOLBAR retval[257] = new NotImplementedFunction("EVALUATE"); // EVALUATE retval[258] = new NotImplementedFunction("GetTOOLBAR"); // GetTOOLBAR retval[259] = new NotImplementedFunction("GetTOOL"); // GetTOOL retval[260] = new NotImplementedFunction("SPELLINGCHECK"); // SPELLINGCHECK retval[261] = new Errortype(); // ERRORTYPE retval[262] = new NotImplementedFunction("APPTITLE"); // APPTITLE retval[263] = new NotImplementedFunction("WINDOWTITLE"); // WINDOWTITLE retval[264] = new NotImplementedFunction("SAVETOOLBAR"); // SAVETOOLBAR retval[265] = new NotImplementedFunction("ENABLETOOL"); // ENABLETOOL retval[266] = new NotImplementedFunction("PRESSTOOL"); // PRESSTOOL retval[267] = new NotImplementedFunction("REGISTERID"); // REGISTERID retval[268] = new NotImplementedFunction("GetWORKBOOK"); // GetWORKBOOK retval[269] = AggregateFunction.AVEDEV; // AVEDEV retval[270] = new NotImplementedFunction("BETADIST"); // BETADIST retval[271] = new NotImplementedFunction("GAMMALN"); // GAMMALN retval[272] = new NotImplementedFunction("BETAINV"); // BETAINV retval[273] = new NotImplementedFunction("BINOMDIST"); // BINOMDIST retval[274] = new NotImplementedFunction("CHIDIST"); // CHIDIST retval[275] = new NotImplementedFunction("CHIINV"); // CHIINV retval[276] = NumericFunction.COMBIN; // COMBIN retval[277] = new NotImplementedFunction("CONFIDENCE"); // CONFIDENCE retval[278] = new NotImplementedFunction("CRITBINOM"); // CRITBINOM retval[279] = new Even(); // EVEN retval[280] = new NotImplementedFunction("EXPONDIST"); // EXPONDIST retval[281] = new NotImplementedFunction("FDIST"); // FDIST retval[282] = new NotImplementedFunction("FINV"); // FINV retval[283] = new NotImplementedFunction("FISHER"); // FISHER retval[284] = new NotImplementedFunction("FISHERINV"); // FISHERINV retval[285] = NumericFunction.FLOOR; // FLOOR retval[286] = new NotImplementedFunction("GAMMADIST"); // GAMMADIST retval[287] = new NotImplementedFunction("GAMMAINV"); // GAMMAINV retval[288] = NumericFunction.CEILING; // CEILING retval[289] = new NotImplementedFunction("HYPGEOMDIST"); // HYPGEOMDIST retval[290] = new NotImplementedFunction("LOGNORMDIST"); // LOGNORMDIST retval[291] = new NotImplementedFunction("LOGINV"); // LOGINV retval[292] = new NotImplementedFunction("NEGBINOMDIST"); // NEGBINOMDIST retval[293] = new NotImplementedFunction("NORMDIST"); // NORMDIST retval[294] = new NotImplementedFunction("NORMSDIST"); // NORMSDIST retval[295] = new NotImplementedFunction("NORMINV"); // NORMINV retval[296] = new NotImplementedFunction("NORMSINV"); // NORMSINV retval[297] = new NotImplementedFunction("STANDARDIZE"); // STANDARDIZE retval[298] = new Odd(); // ODD retval[299] = new NotImplementedFunction("PERMUT"); // PERMUT retval[300] = NumericFunction.POISSON; // POISSON retval[301] = new NotImplementedFunction("TDIST"); // TDIST retval[302] = new NotImplementedFunction("WEIBULL"); // WEIBULL retval[303] = new Sumxmy2(); // SUMXMY2 retval[304] = new Sumx2my2(); // SUMX2MY2 retval[305] = new Sumx2py2(); // SUMX2PY2 retval[306] = new NotImplementedFunction("CHITEST"); // CHITEST retval[307] = new NotImplementedFunction("CORREL"); // CORREL retval[308] = new NotImplementedFunction("COVAR"); // COVAR retval[309] = new NotImplementedFunction("FORECAST"); // FORECAST retval[310] = new NotImplementedFunction("FTEST"); // FTEST retval[311] = new Intercept(); // INTERCEPT retval[312] = new NotImplementedFunction("PEARSON"); // PEARSON retval[313] = new NotImplementedFunction("RSQ"); // RSQ retval[314] = new NotImplementedFunction("STEYX"); // STEYX retval[315] = new Slope(); // SLOPE retval[316] = new NotImplementedFunction("TTEST"); // TTEST retval[317] = new NotImplementedFunction("PROB"); // PROB retval[318] = AggregateFunction.DEVSQ; // DEVSQ retval[319] = new NotImplementedFunction("GEOMEAN"); // GEOMEAN retval[320] = new NotImplementedFunction("HARMEAN"); // HARMEAN retval[321] = AggregateFunction.SUMSQ; // SUMSQ retval[322] = new NotImplementedFunction("KURT"); // KURT retval[323] = new NotImplementedFunction("SKEW"); // SKEW retval[324] = new NotImplementedFunction("ZTEST"); // ZTEST retval[325] = AggregateFunction.LARGE; // LARGE retval[326] = AggregateFunction.SMALL; // SMALL retval[327] = new NotImplementedFunction("QUARTILE"); // QUARTILE retval[328] = AggregateFunction.PERCENTILE; // PERCENTILE retval[329] = new NotImplementedFunction("PERCENTRANK"); // PERCENTRANK retval[330] = new Mode(); // MODE retval[331] = new NotImplementedFunction("TRIMMEAN"); // TRIMMEAN retval[332] = new NotImplementedFunction("TINV"); // TINV retval[334] = new NotImplementedFunction("MOVIECOMMAND"); // MOVIECOMMAND retval[335] = new NotImplementedFunction("GetMOVIE"); // GetMOVIE retval[336] = TextFunction.CONCATENATE; // CONCATENATE retval[337] = NumericFunction.POWER; // POWER retval[338] = new NotImplementedFunction("PIVOTAddDATA"); // PIVOTAddDATA retval[339] = new NotImplementedFunction("GetPIVOTTABLE"); // GetPIVOTTABLE retval[340] = new NotImplementedFunction("GetPIVOTFIELD"); // GetPIVOTFIELD retval[341] = new NotImplementedFunction("GetPIVOTITEM"); // GetPIVOTITEM retval[342] = NumericFunction.RADIANS; ; // RADIANS retval[343] = NumericFunction.DEGREES; // DEGREES retval[344] = new Subtotal(); // SUBTOTAL retval[345] = new Sumif(); // SUMIF retval[346] = new Countif(); // COUNTIF retval[347] = new Countblank(); // COUNTBLANK retval[348] = new NotImplementedFunction("SCENARIOGet"); // SCENARIOGet retval[349] = new NotImplementedFunction("OPTIONSLISTSGet"); // OPTIONSLISTSGet retval[350] = new NotImplementedFunction("IsPMT"); // IsPMT retval[351] = new NotImplementedFunction("DATEDIF"); // DATEDIF retval[352] = new NotImplementedFunction("DATESTRING"); // DATESTRING retval[353] = new NotImplementedFunction("NUMBERSTRING"); // NUMBERSTRING retval[354] = new Roman(); // ROMAN retval[355] = new NotImplementedFunction("OPENDIALOG"); // OPENDIALOG retval[356] = new NotImplementedFunction("SAVEDIALOG"); // SAVEDIALOG retval[357] = new NotImplementedFunction("VIEWGet"); // VIEWGet retval[358] = new NotImplementedFunction("GetPIVOTDATA"); // GetPIVOTDATA retval[359] = new Hyperlink(); // HYPERLINK retval[360] = new NotImplementedFunction("PHONETIC"); // PHONETIC retval[361] = new NotImplementedFunction("AVERAGEA"); // AVERAGEA retval[362] = MinaMaxa.MAXA; // MAXA retval[363] = MinaMaxa.MINA; // MINA retval[364] = new NotImplementedFunction("STDEVPA"); // STDEVPA retval[365] = new NotImplementedFunction("VARPA"); // VARPA retval[366] = new NotImplementedFunction("STDEVA"); // STDEVA retval[367] = new NotImplementedFunction("VARA"); // VARA return(retval); }
protected override void AddAttributesToRender(HtmlTextWriter w) { Page page = Page; if (page != null) { page.VerifyRenderingInServerForm(this); } switch (TextMode) { case TextBoxMode.MultiLine: if (Columns != 0) { w.AddAttribute(HtmlTextWriterAttribute.Cols, Columns.ToString(), false); } #if NET_2_0 else { w.AddAttribute(HtmlTextWriterAttribute.Cols, "20", false); } #endif if (Rows != 0) { w.AddAttribute(HtmlTextWriterAttribute.Rows, Rows.ToString(), false); } #if NET_2_0 else { w.AddAttribute(HtmlTextWriterAttribute.Rows, "2", false); } #endif if (!Wrap) { w.AddAttribute(HtmlTextWriterAttribute.Wrap, "off", false); } break; case TextBoxMode.SingleLine: case TextBoxMode.Password: if (TextMode == TextBoxMode.Password) { w.AddAttribute(HtmlTextWriterAttribute.Type, "password", false); } else { w.AddAttribute(HtmlTextWriterAttribute.Type, "text", false); if (Text.Length > 0) { w.AddAttribute(HtmlTextWriterAttribute.Value, Text); } } if (Columns != 0) { w.AddAttribute(HtmlTextWriterAttribute.Size, Columns.ToString(), false); } if (MaxLength != 0) { w.AddAttribute(HtmlTextWriterAttribute.Maxlength, MaxLength.ToString(), false); } #if NET_2_0 if (AutoCompleteType != AutoCompleteType.None && TextMode == TextBoxMode.SingleLine) { if (AutoCompleteType != AutoCompleteType.Disabled) { w.AddAttribute(HtmlTextWriterAttribute.VCardName, VCardValues [(int)AutoCompleteType]); } else { w.AddAttribute(HtmlTextWriterAttribute.AutoComplete, "off", false); } } #endif break; } #if NET_2_0 if (AutoPostBack) { w.AddAttribute("onkeypress", "if (WebForm_TextBoxKeyHandler(event) == false) return false;", false); if (page != null) { string onchange = page.ClientScript.GetPostBackEventReference(GetPostBackOptions(), true); onchange = String.Concat("setTimeout('", onchange.Replace("\\", "\\\\").Replace("'", "\\'"), "', 0)"); w.AddAttribute(HtmlTextWriterAttribute.Onchange, BuildScriptAttribute("onchange", onchange)); } } else if (page != null) { page.ClientScript.RegisterForEventValidation(UniqueID, String.Empty); } #else if (page != null && AutoPostBack) { w.AddAttribute(HtmlTextWriterAttribute.Onchange, BuildScriptAttribute("onchange", page.ClientScript.GetPostBackClientHyperlink(this, ""))); } #endif if (ReadOnly) { w.AddAttribute(HtmlTextWriterAttribute.ReadOnly, "ReadOnly", false); } w.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); base.AddAttributesToRender(w); }
public IMatrix SoftmaxActivation() { var activation = Rows.Select(r => r.Softmax().AsIndexable()).ToList(); return(new CpuMatrix(DenseMatrix.Create(RowCount, ColumnCount, (x, y) => activation[x][y]))); }
/// <summary> /// 功能描述:加载column /// 作 者:HZH /// 创建日期:2019-08-08 17:51:50 /// 任务编号:POS /// </summary> private void LoadColumns() { try { if (DesignMode) { return; } ControlHelper.FreezeControl(this.panHead, true); this.panColumns.Controls.Clear(); this.panColumns.ColumnStyles.Clear(); if (m_columns != null && m_columns.Count() > 0) { int intColumnsCount = m_columns.Count(); if (m_isShowCheckBox) { intColumnsCount++; } this.panColumns.ColumnCount = intColumnsCount; for (int i = 0; i < intColumnsCount; i++) { Control c = null; if (i == 0 && m_isShowCheckBox) { this.panColumns.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(SizeType.Absolute, 30F)); UCCheckBox box = new UCCheckBox(); box.TextValue = ""; box.Size = new Size(30, 30); box.CheckedChangeEvent += (a, b) => { Rows.ForEach(p => p.IsChecked = box.Checked); if (HeadCheckBoxChangeEvent != null) { HeadCheckBoxChangeEvent(a, b); } }; c = box; } else { var item = m_columns[i - (m_isShowCheckBox ? 1 : 0)]; this.panColumns.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(item.WidthType, item.Width)); Label lbl = new Label(); lbl.Name = "dgvColumns_" + i; lbl.Text = item.HeadText; lbl.Font = m_headFont; lbl.ForeColor = m_headTextColor; lbl.TextAlign = ContentAlignment.MiddleCenter; lbl.AutoSize = false; lbl.Dock = DockStyle.Fill; lbl.MouseDown += (a, b) => { if (HeadColumnClickEvent != null) { HeadColumnClickEvent(a, b); } }; c = lbl; } this.panColumns.Controls.Add(c, i, 0); } } } finally { ControlHelper.FreezeControl(this.panHead, false); } }
public WT_ScheduleTaskRow findByPrimaryKey(String WTST_ScheduleTaskId) { return((WT_ScheduleTaskRow)(Rows.Find(new object[] { WTST_ScheduleTaskId }))); }
public void InitializeStruct(DataTable tableInNAlg, DataTable tableOutNAlg, DataTable tableComp, Dictionary <int, object[]> dict_profile, DataTable tableRatio) { this.CellValueChanged -= new DataGridViewCellEventHandler(cellEndEdit); this.Rows.Clear(); this.Columns.Clear(); DataRow[] colums_in; DataRow[] colums_out; DataRow[] rows; List <DataRow> col_in = new List <DataRow>(); List <DataRow> col_out = new List <DataRow>(); m_dbRatio = tableRatio.Copy(); switch (m_ViewValues) { case INDEX_VIEW_VALUES.Block: rows = tableComp.Select("ID_COMP=1000 or ID_COMP=1"); break; case INDEX_VIEW_VALUES.Output: //colums_in = nAlgTable.Select("N_ALG='2'"); //colums_out = nAlgOutTable.Select("N_ALG='2'"); rows = tableComp.Select("ID_COMP=2000 or ID_COMP=1"); break; case INDEX_VIEW_VALUES.TeploBL: //colums_in = nAlgTable.Select("N_ALG='3'"); //colums_out = nAlgOutTable.Select("N_ALG='3'"); rows = tableComp.Select("ID_COMP=1"); break; case INDEX_VIEW_VALUES.TeploOP: //colums_in = nAlgTable.Select("N_ALG='4'"); //colums_out = nAlgOutTable.Select("N_ALG='4'"); rows = tableComp.Select("ID_COMP=1"); break; case INDEX_VIEW_VALUES.Param: //colums_in = nAlgTable.Select("N_ALG='5'"); //colums_out = nAlgOutTable.Select("N_ALG='5'"); rows = tableComp.Select("ID_COMP=1"); break; case INDEX_VIEW_VALUES.PromPlozsh: //colums_in = nAlgTable.Select("N_ALG='6'"); //colums_out = nAlgOutTable.Select("N_ALG='6'"); rows = tableComp.Select("ID_COMP=3000 or ID_COMP=1"); break; default: //colums_in = nAlgTable.Select(); //colums_out = nAlgOutTable.Select(); rows = tableComp.Select(); break; } foreach (object[] list in dict_profile[(int)m_ViewValues]) { if ((TepCommon.HandlerDbTaskCalculate.TaskCalculate.TYPE)list[1] == TepCommon.HandlerDbTaskCalculate.TaskCalculate.TYPE.IN_VALUES) { m_dict_ProfileNALG_IN = (Dictionary <string, HTepUsers.DictionaryProfileItem>)list[2]; foreach (Double id in (double[])list[0]) { col_in.Add(tableInNAlg.Select("N_ALG='" + id.ToString().Trim().Replace(',', '.') + "'")[0]); } } else { ; } if ((TepCommon.HandlerDbTaskCalculate.TaskCalculate.TYPE)list[1] == TepCommon.HandlerDbTaskCalculate.TaskCalculate.TYPE.OUT_VALUES) { m_dict_ProfileNALG_OUT = (Dictionary <string, HTepUsers.DictionaryProfileItem>)list[2]; foreach (Double id in (double[])list[0]) { col_out.Add(tableOutNAlg.Select("N_ALG='" + id.ToString().Trim().Replace(',', '.') + "'")[0]); } } else { ; } } colums_in = col_in.ToArray(); colums_out = col_out.ToArray(); this.AddColumn("Компонент", true, "Comp"); foreach (DataRow c in colums_in) { this.AddColumn(c["NAME_SHR"].ToString().Trim(), true, c["NAME_SHR"].ToString().Trim(), (c["N_ALG"]).ToString(), true); } foreach (DataRow c in colums_out) { this.AddColumn(c["NAME_SHR"].ToString().Trim(), true, c["NAME_SHR"].ToString().Trim(), (c["N_ALG"]).ToString(), false); } foreach (DataRow r in rows) { this.Rows.Add(new object[this.ColumnCount]); this.Rows[Rows.Count - 1].Cells[0].Value = r["DESCRIPTION"].ToString().Trim(); this.Rows[Rows.Count - 1].HeaderCell.Value = r["ID"]; } if (Rows.Count > 1) { Rows.RemoveAt(0); this.Rows.Add(); this.Rows[Rows.Count - 1].Cells[0].Value = "Итого"; this.Rows[Rows.Count - 1].HeaderCell.Value = rows[0]["ID"].ToString().Trim(); } else { ; } this.CellValueChanged += new DataGridViewCellEventHandler(cellEndEdit); }
internal void SetData(Report rpt, IEnumerable ie, Fields flds, Filters f) { if (ie == null) // Does user want to remove user data? { SetMyUserData(rpt, null); return; } Rows rows = new Rows(rpt, null,null,null); // no sorting and grouping at base data List<Row> ar = new List<Row>(); rows.Data = ar; int rowCount=0; int maxRows = _RowLimit > 0? _RowLimit: int.MaxValue; int fieldCount = flds.Items.Count; foreach (object dt in ie) { // Get the type. Type myType = dt.GetType(); // Build the row Row or = new Row(rows, fieldCount); // Go thru each field and try to obtain a value foreach (Field fld in flds) { // Get the type and fields of FieldInfoClass. FieldInfo fi = myType.GetField(fld.Name.Nm, BindingFlags.Instance | BindingFlags.Public); if (fi != null) { or.Data[fld.ColumnNumber] = fi.GetValue(dt); } } // Apply the filters if (f == null || f.Apply(rpt, or)) { or.RowNumber = rowCount; // rowCount++; ar.Add(or); } if (--maxRows <= 0) // don't retrieve more than max break; } ar.TrimExcess(); // free up any extraneous space; can be sizeable for large # rows if (f != null) f.ApplyFinalFilters(rpt, rows, false); SetMyUserData(rpt, rows); }
internal void SetData(Report rpt, DataTable dt, Fields flds, Filters f) { if (dt == null) // Does user want to remove user data? { SetMyUserData(rpt, null); return; } Rows rows = new Rows(rpt,null,null,null); // no sorting and grouping at base data List<Row> ar = new List<Row>(); rows.Data = ar; int rowCount=0; int maxRows = _RowLimit > 0? _RowLimit: int.MaxValue; int fieldCount = flds.Items.Count; foreach (DataRow dr in dt.Rows) { Row or = new Row(rows, fieldCount); // Loop thru the columns obtaining the data values by name foreach (Field fld in flds.Items.Values) { or.Data[fld.ColumnNumber] = dr[fld.DataField]; } // Apply the filters if (f == null || f.Apply(rpt, or)) { or.RowNumber = rowCount; // rowCount++; ar.Add(or); } if (--maxRows <= 0) // don't retrieve more than max break; } ar.TrimExcess(); // free up any extraneous space; can be sizeable for large # rows if (f != null) f.ApplyFinalFilters(rpt, rows, false); SetMyUserData(rpt, rows); }
public void SetHeader(params string[] headers) { HeaderSet = true; Rows.Add(new Row(_rowIndex++, true, headers)); }
internal void AddPageExpressionRow(Report rpt, string exprname, Row r) { if (exprname == null || r == null) return; if (_PageExprReferences == null) _PageExprReferences = new Dictionary<string, Rows>(); Rows rows=null; _PageExprReferences.TryGetValue(exprname, out rows); if (rows == null) { rows = new Rows(rpt); rows.Data = new List<Row>(); _PageExprReferences.Add(exprname, rows); } Row row = new Row(rows, r); // have to make a new copy row.RowNumber = rows.Data.Count; rows.Data.Add(row); // add row to rows return; }
private void AddRow(bool isHeader = false, params object[] values) { Rows.Add(new Row(_rowIndex++, isHeader, values)); }
private void calculateSnapPoints() { if (!EnableSnapTo) { return; } // build up a full set of snap points/details, from (a) the static snap points for the grid, and // (b) calculated snap points for this move (ie. other elements in the row[s]). // iterate through the rows, calculating snap points for every single element in each row that has any selected elements foreach (Row row in Rows.Where(x => x.Visible)) { // This would skip generating snap points for elements on any rows that have nothing selected. // However, we still need to do that; as we might be dragging elements vertically into rows that // (currently) have nothing selected. So we'll generate for everything, but that's going to be // quite overkill. So, the big TODO: here is to regenerate element snap points for only rows with // selected elements, but also regenerate them whenever we move vertically. foreach (Element element in row) { // skip it if it's a selected element; we don't want to snap to them, as they'll be moving as well if (element.Selected) { continue; } // if it's a non-selected element, generate snap points for it; for the start and end times. Also record the // row its from in the generated point, so when snapping we can check against only elements from this row. SnapDetails details = CalculateSnapDetailsForPoint(element.StartTime, SnapPriorityForElements, Color.Empty, false, false); details.SnapRow = row; if (!CurrentDragSnapPoints.ContainsKey(details.SnapTime)) { CurrentDragSnapPoints[details.SnapTime] = new List <SnapDetails>(); } CurrentDragSnapPoints[details.SnapTime].Add(details); details = CalculateSnapDetailsForPoint(element.EndTime, SnapPriorityForElements, Color.Empty, false, false); details.SnapRow = row; if (!CurrentDragSnapPoints.ContainsKey(details.SnapTime)) { CurrentDragSnapPoints[details.SnapTime] = new List <SnapDetails>(); } CurrentDragSnapPoints[details.SnapTime].Add(details); } } //Add in our static snap points as a copy so they are not modified foreach (var staticSnapPoint in StaticSnapPoints) { if (CurrentDragSnapPoints.ContainsKey(staticSnapPoint.Key)) { CurrentDragSnapPoints[staticSnapPoint.Key].AddRange(staticSnapPoint.Value); } else { CurrentDragSnapPoints.Add(staticSnapPoint.Key, staticSnapPoint.Value); } } }
private void btnSubmit_Click(object sender, EventArgs e) { Button oBtn = sender as Button; DataTable dt = new DataTable(); IList <TLCSV_PuchaseOrderDetail> PODetail = new List <TLCSV_PuchaseOrderDetail>(); IList <TLCSV_StockOnHand> SOHDetail = new List <TLCSV_StockOnHand>(); List <DATA> SOHGrouped = new List <DATA>(); BindingSource bindingSource1 = new BindingSource(); if (oBtn != null && formloaded) { if (UserD._External) { if (QueryParms.Customers.Count == 0) { MessageBox.Show("Please select a customer from the drop down list"); return; } if (QueryParms.Whses.Count == 0) { MessageBox.Show("Please select a warehouse fro the drop down list"); return; } } using (var context = new TTI2Entities()) { DGVOutput.DataSource = null; DGVOutput.Rows.Clear(); if (rbAvailable.Checked || rbGrossStock.Checked) { //============================================================ // Can be either Gross Stock or Available stock data needed // Start with Gross Stock always //------------------------------------------------------- SOHDetail = repo.GrossSOHQuery(QueryParms).ToList(); if (rbAvailable.Checked) { // Available Stock only //---------------------------------------------------------- SOHDetail = SOHDetail.Where(x => !x.TLSOH_Picked).ToList(); } if (SOHDetail.Count == 0) { DGVOutput.Visible = false; MessageBox.Show("No records found for selection made"); return; } var GroupedData = SOHDetail.GroupBy(x => new { x.TLSOH_Style_FK, x.TLSOH_Colour_FK, x.TLSOH_Size_FK }).ToList(); foreach (var Grouped in GroupedData) { var Sty = Grouped.FirstOrDefault().TLSOH_Style_FK; var Clr = Grouped.FirstOrDefault().TLSOH_Colour_FK; var xSize = Grouped.FirstOrDefault().TLSOH_Size_FK; var BoxQty = Grouped.Sum(x => (int?)x.TLSOH_BoxedQty ?? 0); var Record = SOHGrouped.Find(x => x._StyleFK == Sty && x._ColourFK == Clr && x._SizeFK == xSize); var index = SOHGrouped.IndexOf(Record); if (index < 0) { DATA dd = new DATA(); dd._BoxedQty = BoxQty; dd._ColourFK = Clr; dd._SizeFK = xSize; dd._StyleFK = Sty; SOHGrouped.Add(dd); } else { Record._BoxedQty += BoxQty; } } //now ready to display //------------------------------------------------- dt = new DataTable(); DataColumn column; // Create column 1 //---------------------------------------------- column = new DataColumn(); column.DataType = System.Type.GetType("System.String"); column.ColumnName = "Style"; dt.Columns.Add(column); // Create column 2 //---------------------------------------------- column = new DataColumn(); column.DataType = System.Type.GetType("System.String"); column.ColumnName = "Colour"; dt.Columns.Add(column); // Add the size names to the top of the grid box //------------------------------------------------------- foreach (var soh in SOHGrouped) { var xSize = context.TLADM_Sizes.Find(soh._SizeFK).SI_Description; if (!dt.Columns.Contains(xSize)) { dt.Columns.Add(xSize, typeof(Int32)); } else { continue; } } foreach (var soh in SOHGrouped) { var xStyle = context.TLADM_Styles.Find(soh._StyleFK).Sty_Description; var xColour = context.TLADM_Colours.Find(soh._ColourFK).Col_Display; var xSize = context.TLADM_Sizes.Find(soh._SizeFK).SI_Description; var index = dt.Columns.IndexOf(xSize); var SingleRow = (from Rows in dt.Rows.Cast <DataRow>() where Rows.Field <String>(0) == xStyle && Rows.Field <String>(1) == xColour select Rows).FirstOrDefault(); if (SingleRow != null) { SingleRow[index] = soh._BoxedQty; } else { var TheNewRow = dt.NewRow(); TheNewRow[0] = xStyle; TheNewRow[1] = xColour; TheNewRow[index] = soh._BoxedQty; dt.Rows.Add(TheNewRow); } } DataView DataV = dt.DefaultView; DataV.Sort = dt.Columns[0].ColumnName + "," + dt.Columns[1].ColumnName; DGVOutput.DataSource = DataV.ToTable(); DGVOutput.Visible = true; } else { //======================================================================= // this section of the code does the outstanding purchase orders //===================================================================== var Data = repo.POQuery(QueryParms); if (Data.Count() == 0) { DGVOutput.Visible = false; MessageBox.Show("No records found for selection made"); return; } var GroupedData = Data.GroupBy(x => new { x.TLCUSTO_Style_FK, x.TLCUSTO_Colour_FK, x.TLCUSTO_Size_FK }).ToList(); foreach (var Grouped in GroupedData) { var Sty = Grouped.FirstOrDefault().TLCUSTO_Style_FK; var Clr = Grouped.FirstOrDefault().TLCUSTO_Colour_FK; var xSize = Grouped.FirstOrDefault().TLCUSTO_Size_FK; var BoxQty = Grouped.Sum(x => (int?)x.TLCUSTO_Qty ?? 0); var Record = SOHGrouped.Find(x => x._StyleFK == Sty && x._ColourFK == Clr && x._SizeFK == xSize); var index = SOHGrouped.IndexOf(Record); if (index < 0) { DATA dd = new DATA(); dd._BoxedQty = BoxQty; dd._ColourFK = Clr; dd._SizeFK = xSize; dd._StyleFK = Sty; SOHGrouped.Add(dd); } else { Record._BoxedQty += BoxQty; } } //now ready to display //------------------------------------------------- dt = new DataTable(); DataColumn column; // Create column 1 //---------------------------------------------- column = new DataColumn(); column.DataType = System.Type.GetType("System.String"); column.ColumnName = "Style"; dt.Columns.Add(column); // Create column 2 //---------------------------------------------- column = new DataColumn(); column.DataType = System.Type.GetType("System.String"); column.ColumnName = "Colour"; dt.Columns.Add(column); // Add the size names to the top of the grid box //------------------------------------------------------- foreach (var soh in SOHGrouped) { var xSize = context.TLADM_Sizes.Find(soh._SizeFK).SI_Description; if (!dt.Columns.Contains(xSize)) { dt.Columns.Add(xSize, typeof(Int32)); } else { continue; } } foreach (var soh in SOHGrouped) { var xStyle = context.TLADM_Styles.Find(soh._StyleFK).Sty_Description; var xColour = context.TLADM_Colours.Find(soh._ColourFK).Col_Display; var xSize = context.TLADM_Sizes.Find(soh._SizeFK).SI_Description; var index = dt.Columns.IndexOf(xSize); var SingleRow = (from Rows in dt.Rows.Cast <DataRow>() where Rows.Field <String>(0) == xStyle && Rows.Field <String>(1) == xColour select Rows).FirstOrDefault(); if (SingleRow != null) { SingleRow[index] = soh._BoxedQty; } else { var TheNewRow = dt.NewRow(); TheNewRow[0] = xStyle; TheNewRow[1] = xColour; TheNewRow[index] = soh._BoxedQty; dt.Rows.Add(TheNewRow); } } DataView DataV = dt.DefaultView; DataV.Sort = dt.Columns[0].ColumnName + "," + dt.Columns[1].ColumnName; DGVOutput.DataSource = DataV.ToTable(); DGVOutput.Visible = true; } } } }
private int NumberOfSquaresInRegionCouldUseValue(Columns column, Rows row, Values value) { int r = (int)row / 3; int c = (int)column / 3; var result = 0; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j ++ ) { Rows ro = (Rows)(r*3+i); Columns co = (Columns)(c * 3 + i); if (CouldPutValueInSquare(co, ro, value)) result++; } return result; }
void DrawGrid() { if (Grid) { var n_Rpws = Grid_Rows * 1.0; var n_Columns = Grid_Columns * 1.0; for (int i = 1; i < n_Rpws; i++) { Control c; if (i < Rows.Count) { c = Rows[i]; } else { c = new Control(); Rows.Add(c); Controls.Add(c); } c.Visible = true; c.Left = 0; c.Top = (int)((i / n_Rpws) * Height); c.Width = this.Width; c.Height = 1; c.BackColor = Grid_Color; Controls.Add(c); } for (int i = 1; i < n_Columns; i++) { Control c; if (i < Columns.Count) { c = Columns[i]; } else { c = new Control(); Columns.Add(c); Controls.Add(c); } c.Visible = true; c.Left = (int)((i / n_Columns) * Width); c.Top = 0; c.Width = 1; c.Height = this.Height; c.BackColor = Grid_Color; } for (int i = (int)n_Rpws; i < Rows.Count; i++) { Rows[i].Visible = false; } for (int i = (int)n_Columns; i < Columns.Count; i++) { Columns[i].Visible = false; } } else { foreach (var c in Rows) { if (c != null) { c.Visible = false; } } foreach (var c in Columns) { if (c != null) { c.Visible = false; } } } pictureBox1.SendToBack(); }
public Values GetRegionValues(Columns oneCellColumn, Rows oneCellRow) { int column = (int)oneCellColumn; int row = (int)oneCellRow; return _RegionValues[column / 3, row / 3]; }
public void RemoveEmptyRows() { Rows.RemoveAll(r => !r.Fields.Any()); }
public void AddRow(params string[] cells) { Rows.Add(new ConsoleDisplayTableRow(cells)); }
//-------------------------------------------------------------------------------- public DataRow FindByID(uint id) { return((DataRow_security)Rows.Find(new object[] { id })); }
public void AddRowInternal(ArrayDataRecord rec) { Rows.AddInternal(new CdlRow(this, rec, CdlRowState.Unchanged, m_structure)); }
//-------------------------------------------------------------------------------- public void Add_Row(DataRow_timeframe row) { Rows.Add(row); }
// Obtain the data from the XML internal void GetData(Report rpt, string xmlData, Fields flds, Filters f) { Rows uData = this.GetMyUserData(rpt); if (uData != null) { this.SetMyData(rpt, uData); return; } int fieldCount = flds.Items.Count; XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = false; doc.LoadXml(xmlData); XmlNode xNode; xNode = doc.LastChild; if (xNode == null || !(xNode.Name == "Rows" || xNode.Name == "fyi:Rows")) { throw new Exception("Error: XML Data must contain top level rows."); } Rows _Data = new Rows(rpt, null,null,null); List<Row> ar = new List<Row>(); _Data.Data = ar; int rowCount=0; foreach(XmlNode xNodeRow in xNode.ChildNodes) { if (xNodeRow.NodeType != XmlNodeType.Element) continue; if (xNodeRow.Name != "Row") continue; Row or = new Row(_Data, fieldCount); foreach (XmlNode xNodeColumn in xNodeRow.ChildNodes) { Field fld = (Field) (flds.Items[xNodeColumn.Name]); // Find the column if (fld == null) continue; // Extraneous data is ignored TypeCode tc = fld.qColumn != null? fld.qColumn.colType: fld.Type; if (xNodeColumn.InnerText == null || xNodeColumn.InnerText.Length == 0) or.Data[fld.ColumnNumber] = null; else if (tc == TypeCode.String) or.Data[fld.ColumnNumber] = xNodeColumn.InnerText; else { try { or.Data[fld.ColumnNumber] = Convert.ChangeType(xNodeColumn.InnerText, tc, NumberFormatInfo.InvariantInfo); } catch // all conversion errors result in a null value { or.Data[fld.ColumnNumber] = null; } } } // Apply the filters if (f == null || f.Apply(rpt, or)) { or.RowNumber = rowCount; // rowCount++; ar.Add(or); } } ar.TrimExcess(); // free up any extraneous space; can be sizeable for large # rows if (f != null) f.ApplyFinalFilters(rpt, _Data, false); SetMyData(rpt, _Data); }
//-------------------------------------------------------------------------------- public void Remove_Row(DataRow_timeframe row) { Rows.Remove(row); }
internal void SetData(Report rpt, IDataReader dr, Fields flds, Filters f) { if (dr == null) // Does user want to remove user data? { SetMyUserData(rpt, null); return; } Rows rows = new Rows(rpt,null,null,null); // no sorting and grouping at base data List<Row> ar = new List<Row>(); rows.Data = ar; int rowCount=0; int maxRows = _RowLimit > 0? _RowLimit: int.MaxValue; while (dr.Read()) { Row or = new Row(rows, dr.FieldCount); dr.GetValues(or.Data); // Apply the filters if (f == null || f.Apply(rpt, or)) { or.RowNumber = rowCount; // rowCount++; ar.Add(or); } if (--maxRows <= 0) // don't retrieve more than max break; } ar.TrimExcess(); // free up any extraneous space; can be sizeable for large # rows if (f != null) f.ApplyFinalFilters(rpt, rows, false); SetMyUserData(rpt, rows); }
//-------------------------------------------------------------------------------- public DataRow FindByID(uint id) { return((DataRow_timeframe)Rows.Find(new object[] { id })); }
internal void SetData(Report rpt, XmlDocument xmlDoc, Fields flds, Filters f) { if (xmlDoc == null) // Does user want to remove user data? { SetMyUserData(rpt, null); return; } Rows rows = new Rows(rpt,null,null,null); // no sorting and grouping at base data XmlNode xNode; xNode = xmlDoc.LastChild; if (xNode == null || !(xNode.Name == "Rows" || xNode.Name == "fyi:Rows")) { throw new Exception("XML Data must contain top level element Rows."); } List<Row> ar = new List<Row>(); rows.Data = ar; int rowCount=0; int fieldCount = flds.Items.Count; foreach(XmlNode xNodeRow in xNode.ChildNodes) { if (xNodeRow.NodeType != XmlNodeType.Element) continue; if (xNodeRow.Name != "Row") continue; Row or = new Row(rows, fieldCount); foreach (XmlNode xNodeColumn in xNodeRow.ChildNodes) { Field fld = (Field) (flds.Items[xNodeColumn.Name]); // Find the column if (fld == null) continue; // Extraneous data is ignored if (xNodeColumn.InnerText == null || xNodeColumn.InnerText.Length == 0) or.Data[fld.ColumnNumber] = null; else if (fld.Type == TypeCode.String) or.Data[fld.ColumnNumber] = xNodeColumn.InnerText; else { try { or.Data[fld.ColumnNumber] = Convert.ChangeType(xNodeColumn.InnerText, fld.Type, NumberFormatInfo.InvariantInfo); } catch // all conversion errors result in a null value { or.Data[fld.ColumnNumber] = null; } } } // Apply the filters if (f == null || f.Apply(rpt, or)) { or.RowNumber = rowCount; // rowCount++; ar.Add(or); } } ar.TrimExcess(); // free up any extraneous space; can be sizeable for large # rows if (f != null) f.ApplyFinalFilters(rpt, rows, false); SetMyUserData(rpt, rows); }
private void SetMyData(Report rpt, Rows data) { if (data == null) rpt.Cache.Remove(this, "data"); else rpt.Cache.AddReplace(this, "data", data); }
internal Row(Rows r, int columnCount) { _R = r; _Data = new object[columnCount]; _Level=0; }
internal void SetRows(Report rpt, Rows rows) { WorkClass wc = GetValue(rpt); wc.rows = rows; return; }
internal void Run(IPresent ip, Rows rs, int start, int end) { // if no rows output or rows just leave if (rs == null || rs.Data == null) return; if (this.Visibility != null && Visibility.IsHidden(ip.Report(), rs.Data[start]) && Visibility.ToggleItem == null) return; // not visible for (int r=start; r <= end; r++) { _TableRows.Run(ip, rs.Data[r]); } return; }
internal bool AnyRowsPage(Pages pgs, Rows data) { if (data != null && data.Data != null && data.Data.Count > 0) return true; string msg; if (this.NoRows != null) msg = this.NoRows.EvaluateString(pgs.Report, null); else msg = null; if (msg == null) return false; // OK we have a message we need to put out RunPageRegionBegin(pgs); // still perform page break if needed PageText pt = new PageText(msg); SetPagePositionAndStyle(pgs.Report, pt, null); if (pt.SI.BackgroundImage != null) pt.SI.BackgroundImage.H = pt.H; // and in the background image pgs.CurrentPage.AddObject(pt); RunPageRegionEnd(pgs); // perform end page break if needed return false; }
//-------------------------------------------------------------------------------- public void Add_Row(DataRow_candle row) { Rows.Add(row); }
public void TestInit() { rowsXml = XElement.Parse(SampleData.TableXml); Settings.ssPrefix = rowsXml.GetNamespaceOfPrefix("ss"); rows = new Rows(rowsXml); }
internal List<GroupEntry> Groups; // Runtime groups; array of GroupEntry internal WorkClass(List l) { CalcHeight = l.Height == null? 0: l.Height.Points; Data=null; Groups=null; }
//-------------------------------------------------------------------------------- public void Remove_Row(DataRow_candle row) { Rows.Remove(row); }
internal bool AnyRows(IPresent ip, Rows data) { if (data == null || data.Data == null || data.Data.Count <= 0) { string msg; if (this.NoRows != null) msg = this.NoRows.EvaluateString(ip.Report(), null); else msg = null; ip.DataRegionNoRows(this, msg); return false; } return true; }
//-------------------------------------------------------------------------------- public DataRow FindByDT(DateTime dt) { return((DataRow_candle)Rows.Find(new object[] { dt })); }
internal Rows GetFilteredData(Report rpt, Row row) { try { Rows data; if (this._Filters == null) { if (this._ParentDataRegion == null) { data = DataSetDefn.Query.GetMyData(rpt); return data == null? null: new Rows(rpt, data); // We need to copy in case DataSet is shared by multiple DataRegions } else return GetNestedData(rpt, row); } if (this._ParentDataRegion == null) { data = DataSetDefn.Query.GetMyData(rpt); if (data != null) data = new Rows(rpt, data); } else data = GetNestedData(rpt, row); if (data == null) return null; List<Row> ar = new List<Row>(); foreach (Row r in data.Data) { if (_Filters.Apply(rpt, r)) ar.Add(r); } ar.TrimExcess(); data.Data = ar; _Filters.ApplyFinalFilters(rpt, data, true); // Adjust the rowcount int rCount = 0; foreach (Row r in ar) { r.RowNumber = rCount++; } return data; } catch (Exception e) { this.OwnerReport.rl.LogError(8, e.Message); return null; } }
//-------------------------------------------------------------------------------- public void Add_Row(DataRow_security row) { Rows.Add(row); }
private bool CouldPutValueInSquare(Columns column, Rows row, Values value) { int r = (int)row; int c = (int)column; return ( ((_RowValues[r] & value) == 0) && ((_ColumnValues[c] & value) > 0) && ((_RegionValues[c / 3, r / 3] & value) == 0) ); }
//-------------------------------------------------------------------------------- public void Remove_Row(DataRow_security row) { Rows.Remove(row); }
private int NumberOfSquaresInRowCouldUseValue(Rows row, Values value) { var result = 0; for (int i = 0; i < 9; i++) { Columns c = (Columns)i; if (CouldPutValueInSquare(c, row, value)) result ++; } return result; }
//-------------------------------------------------------------------------------- public void Add_Row(DataRow_stopOrder row) { Rows.Add(row); }
public Values GetDeniedValues(Columns column, Rows row) { return GetRowValues(row) | GetColumnValues(column) | GetRegionValues(column, row); }
//-------------------------------------------------------------------------------- public void Remove_Row(DataRow_stopOrder row) { Rows.Remove(row); }
public Values GetRowValues(Rows row) { return _RowValues[(int)row]; }
//-------------------------------------------------------------------------------- public DataRow FindByID(int id) { return((DataRow_stopOrder)Rows.Find(new object[] { id })); }