示例#1
0
        private void makeSampleData()
        {
            XsMgr.XRoot           = ExStoreRoot.Instance();
            XsMgr.XRoot.IsDefault = false;

            // make data and flag as not default
            xsTest.makeSampleDataAppAndCell();
        }
示例#2
0
        private Result Test01()
        {
            return(Result.Succeeded);

            Transaction t = null;

            try
            {
                using (t = new Transaction(AppRibbon.Doc, "Test01"))
                {
                    t.Start();
                    {
                        if (AppRibbon.Doc.IsDetached)
                        {
                            return(Result.Cancelled);
                        }

                        if (XsMgr.AppExStorExists)
                        {
                            return(Result.Failed);
                        }

                        ExStoreRtnCodes result;

                        xsTest.makeSampleDataAppAndCell();
                        result = XsMgr.MakeApp();
                        xsTest.showStat("Create app", result, 2);
                        if (result != ExStoreRtnCodes.XRC_GOOD)
                        {
                            return(Result.Failed);
                        }
                    }

                    t.Commit();
                }
            }
            catch (OperationCanceledException)
            {
                if (t != null && t.HasStarted())
                {
                    t.RollBack();
                }

                return(Result.Failed);
            }

            return(Result.Succeeded);
        }