Esempio n. 1
0
        private void ShowData(ExStoreCell xCell)
        {
            TaskDialog td = new TaskDialog("Ex Storage App Data");

            td.MainInstruction = "Cell Schema was read successfully\ncontents:";

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < xCell.Data.Count; i++)
            {
                sb.AppendLine($"date group| {i:D}");


                foreach (KeyValuePair <SchemaCellKey,
                                       SchemaFieldDef <SchemaCellKey> > kvp in xCell.Fields)
                {
                    string name  = xCell.Fields[kvp.Key].Name;
                    string value = xCell.Data[i][kvp.Key].Value.ToString();

                    sb.Append(name).Append("| ").AppendLine(value);
                }

                sb.Append("\n");
            }

            td.MainContent = sb.ToString();
            td.MainIcon    = TaskDialogIcon.TaskDialogIconNone;

            td.Show();
        }
Esempio n. 2
0
        private void SampleCellDataRevised(ExStoreCell xCell, int id)
        {
            // xCell.Data.Add(xCell.DefaultValues().Clone());

            xCell.Data[id][SchemaCellKey.CK_NAME].Value              = "Zeta";
            xCell.Data[id][SchemaCellKey.CK_VERSION].Value           = $"Delta {id:D3}";
            xCell.Data[id][SchemaCellKey.CK_SEQUENCE].Value          = (double)id;
            xCell.Data[id][SchemaCellKey.CK_UPDATE_RULE].Value       = (int)UpdateRules.UR_AS_NEEDED;
            xCell.Data[id][SchemaCellKey.CK_CELL_FAMILY_NAME].Value  = $"CoolCell{id:D3}";
            xCell.Data[id][SchemaCellKey.CK_SKIP].Value              = false;
            xCell.Data[id][SchemaCellKey.CK_XL_FILE_PATH].Value      = $"c:\\file path\\filename{id:D3}.xls";
            xCell.Data[id][SchemaCellKey.CK_XL_WORKSHEET_NAME].Value = $"worksheet {id:d3}";
        }
Esempio n. 3
0
        private void makeSampleDataAppAndCell()
        {
            XsMgr.XApp = ExStoreApp.Instance();

            XsMgr.XApp.Data[SchemaAppKey.AK_NAME].Value        = "Special_Name_01";
            XsMgr.XApp.Data[SchemaAppKey.AK_DESCRIPTION].Value = "Special Description 01";

            XsMgr.XCell = ExStoreCell.Instance();
            XsMgr.XCell.Add(3);

            for (int i = 0; i < 3; i++)
            {
                ExStorageTests.SampleCellData(XsMgr.XCell, i);
            }
        }
Esempio n. 4
0
        private ExStoreRtnCodes modifyData02(ExStoreCell xCell)
        {
            // ExStoreRtnCodes result;

            // result = modifyData01(ref xCell);

            int id = xCell.Data.Count;

            xCell.AddDefault();
            ExStorageTests.SampleCellDataRevised(xCell, "Whitney_01", id++);

            xCell.AddDefault();
            ExStorageTests.SampleCellDataRevised(xCell, "Everest_01", id++);

            return(ExStoreRtnCodes.XRC_GOOD);
        }
Esempio n. 5
0
        private Result updateCellData(ExStoreCell xCell, string title)
        {
            ExStoreRtnCodes result;

            // todo fix how to update cells

            XsMgr.XCell = xCell;

            result = XsMgr.UpdateCells(/*xCell*/);
            if (result != ExStoreRtnCodes.XRC_GOOD)
            {
                return(test01Fail(title, "update Cells", result));
            }

            ExStorageTests.ShowDataCell(XsMgr.XCell);

            return(Result.Succeeded);
        }
Esempio n. 6
0
        private void info()
        {
            ExStoreMgr x = XsMgr;

            ExStoreRoot xrc = XsMgr.XRoot;
            // SchemaDictionaryRoot xrf = xrc.Fields;
            SchemaDictionaryRoot xrl = xrc.Data;
            SchemaDictionaryRoot xrv = xrc.DefaultValues();

            ExStoreApp xac = XsMgr.XApp;
            // SchemaDictionaryApp xaf = xac.Fields;
            SchemaDictionaryApp xal = xac.Data;
            SchemaDictionaryApp xav = xac.DefaultValues();

            ExStoreCell                 xcc = XsMgr.XCell;
            SchemaDictionaryCell        xcf = xcc.Fields;
            List <SchemaDictionaryCell> xcl = xcc.Data;
            Dictionary <string, string> xcd = xcc.SubSchemaFields;
            SchemaDictionaryCell        xcv = xcc.DefaultValues();
        }
Esempio n. 7
0
        private ExStoreRtnCodes modifyData01(ExStoreCell xCell)
        {
            // ExStoreRtnCodes result = XsMgr.ReadCells();
            // if (result != ExStoreRtnCodes.GOOD) return result;
            //
            // xCell = XsMgr.XCell;

            xCell.Data[0][SchemaCellKey.CK_NAME].Value        = "Shasta_01";
            xCell.Data[0][SchemaCellKey.CK_DESCRIPTION].Value = "One tall mountain";
            xCell.Data[0][SchemaCellKey.CK_UPDATE_RULE].Value = (int)UpdateRules.UR_UPON_REQUEST;

            xCell.Data[1][SchemaCellKey.CK_NAME].Value        = "Palomar_01";
            xCell.Data[1][SchemaCellKey.CK_DESCRIPTION].Value = "Another tall mountain";
            xCell.Data[1][SchemaCellKey.CK_UPDATE_RULE].Value = (int)UpdateRules.UR_NEVER;

            xCell.Data[2][SchemaCellKey.CK_NAME].Value        = "K2_01";
            xCell.Data[2][SchemaCellKey.CK_DESCRIPTION].Value = "A very tall mountain";
            xCell.Data[2][SchemaCellKey.CK_UPDATE_RULE].Value = (int)UpdateRules.UR_AS_NEEDED;

            return(ExStoreRtnCodes.XRC_GOOD);
        }
Esempio n. 8
0
 private ExStoreRtnCodes modifyData03(ExStoreCell xCell)
 {
     xCell.Data.RemoveAt(0);
     xCell.Data.RemoveAt(0);
     return(ExStoreRtnCodes.XRC_GOOD);
 }