コード例 #1
0
        private void test01a()
        {
            location = ExStorageTests.location;
            loc      = ExStorageTests.loc;

            // AppRibbon.idx = AppRibbon.idx++;

            string ms  = AppRibbon.getTestMsg1s();
            string m1  = AppRibbon.appR.getTestMsg1();
            string m1t = AppRibbon.appR.testMessage1;

            string mxs = ExStoreMgr.ms;
            string mx1 = XsMgr.m1;

            string msg2 = $"messages| idx| {AppRibbon.idx}\n"
                          + $"rib static| {ms}\n"
                          + $"rib static indirect meth| {m1}\n"
                          + $"rib static indirect prop| {m1t}\n"
                          + $" xs static| {mxs}\n"
                          + $" xs static indirect prop| {mx1}\n"
                          + $"\n"
                          + $"static tests\n"
                          + $"xtest guid| {xsTest.guid}\n"
                          + $"xtest sub-guid| {ExStorageTests.staticTest01.guid}";

            xsTest.taskDialogWarning_Ok("Static test",
                                        "Test static objects", msg2);
        }
コード例 #2
0
        private void test01b()
        {
            IList <Schema> schemaList = Schema.ListSchemas();

            string msg1 = "Read App-Ribbon Info";

            // AppRibbon.idx = AppRibbon.idx++;

            string ms  = AppRibbon.getTestMsg1s();
            string m1s = AppRibbon.testMessageS;
            string m1  = AppRibbon.appR.getTestMsg1();
            string m1t = AppRibbon.appR.testMessage1;

            string mxs = ExStoreMgr.ms;
            string mx1 = XsMgr.m1;

            string ixs = ExStoreMgr.idx.ToString();
            string ix1 = XsMgr.mi.ToString();

            string xm1 = xm.mx;

            string msg2 = $"info| {idx2}\n"
                          // + $"idx| {AppRibbon.idx}\n"
                          // + $"rib static| {ms}\n"
                          // + $"rib static| {m1s}\n"
                          // + $"rib static indirect meth| {m1}\n"
                          // + $"rib static indirect prop| {m1t}\n"
                          // + $" xs index static| {ixs}\n"
                          // + $" xs index indirect| {ix1}\n"
                          // + $" xs static| {mxs}\n"
                          // + $" xs static indirect prop| {mx1}\n\n"
                          + $" xm not static| {xm1} ({xm.idx2x})"
                          + "\n";

            string msg3;

            foreach (Schema s in schemaList)
            {
                msg3  = s.GUID.ToString();
                msg2 += $"{s.SchemaName} ::   {msg3.Substring(msg3.Length-8, 8)}\n";
            }

            xsTest.taskDialogWarning_Ok("schema lookup",
                                        $"{msg1}",
                                        $"\nSchema|\n{msg2}");
        }
コード例 #3
0
ファイル: AppRibbon.cs プロジェクト: morbius1st/AOToolsDelux
        public Result OnStartup(UIControlledApplication app)
        {
            appR = this;

            _uiCtrlApp = app;

            // clearConsole();

            try
            {
                // _uiCtrlApp.Idling += OnIdling;

                // create the ribbon tab first - this is the top level
                // UI item, below this will be the panel that is "on" the tab
                // and below this will be a button that is "on" the panel
                // give the tab a name
                string m_tabName = TAB_NAME;

                // first create the tab
                try
                {
                    // try to create the ribbon panel
                    app.CreateRibbonTab(m_tabName);
                }
                catch (Exception)
                {
                    // might already exist - do nothing
                }

                // got the tab now


/*
 *                              // create the ribbon panel if needed
 *                              // give the panel a name
 *                              string m_panelName = UNITS_PANEL_NAME;
 *
 *                              RibbonPanel ribbonPanel = null;
 *
 *                              // check to see if the panel alrady exists
 *                              // get the Panel within the tab by name
 *                              List<RibbonPanel> m_RP = new List<RibbonPanel>();
 *
 *                              m_RP = app.GetRibbonPanels(m_tabName);
 *
 *                              foreach (RibbonPanel xRP in m_RP)
 *                              {
 *                                      if (xRP.Name.ToUpper().Equals(m_panelName.ToUpper()))
 *                                      {
 *                                              ribbonPanel = xRP;
 *                                              break;
 *                                      }
 *                              }
 *
 *                              // add the panel if it does not exist
 *                              if (ribbonPanel == null)
 *                              {
 *                                      // create the ribbon panel on the tab given the tab's name
 *                                      // FYI - leave off the ribbon panel's name to put onto the "add-in" tab
 *                                      ribbonPanel = app.CreateRibbonPanel(m_tabName, m_panelName);
 *                              }
 *
 *
 *                              if (AddButtons(ribbonPanel) == Result.Failed)
 *                              {
 *                                      return Result.Failed;
 *                              }
 */

                RibbonPanel ribbonPanel =
                    AddRibbonPanel(UNITS_PANEL_NAME, m_tabName);

                if (AddButtons1(ribbonPanel) == Result.Failed)
                {
                    return(Result.Failed);
                }

                ribbonPanel =
                    AddRibbonPanel(EX_STORE_PANEL_NAME, m_tabName);

                if (AddButtons2(ribbonPanel) == Result.Failed)
                {
                    return(Result.Failed);
                }

                if (!AddSplitButtonRead(ribbonPanel))
                {
                    return(Result.Failed);
                }
                //
                //
                // if (!AddSplitButtonDelete(ribbonPanel))
                // {
                //  return Result.Failed;
                // }
                //
                // if (!AddSplitButtonModify(ribbonPanel))
                // {
                //  return Result.Failed;
                // }

                SmUsrInit();

                // ExStoreMgr.XsMgr.Initialize();

                return(Result.Succeeded);
            }
            catch
            {
                return(Result.Failed);
            }
        }         // end OnStartup