コード例 #1
0
        /// <summary>
        /// Wrapper around the main EditLicense function which does the work.  Here we simply recover
        /// the licencse currently selected in the explorer view.  The tab view call the extended version
        /// of this function which takes the license itself as a parameter
        /// </summary>
        public void EditLicense()
        {
            // Recover the license that is to be edited from the LicenseTabView
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is LicensesTabView)
            {
                LicensesTabView    licensesTabView = (LicensesTabView)tabView;
                ApplicationLicense theLicense      = licensesTabView.GetSelectedLicense();
                if (theLicense == null)
                {
                    return;
                }
                EditLicense(theLicense);
            }
        }
コード例 #2
0
        /// <summary>
        /// Wrapper around the main EditLicense function which does the work.  Here we simply recover
        /// the licencse currently selected in the explorer view.  The tab view call the extended version
        /// of this function which takes the license itself as a parameter
        /// </summary>
        public void DeleteLicense()
        {
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is LicensesTabView)
            {
                // Recover the license that is to be edited from the LicenseTabView
                LicensesTabView    licensesTabView = (LicensesTabView)tabView;
                ApplicationLicense theLicense      = licensesTabView.GetSelectedLicense();
                if (theLicense == null)
                {
                    return;
                }
                DeleteLicense(theLicense);
            }

            // refresh the tab view
            workItem.ExplorerView.RefreshView();
            workItem.GetActiveTabView().RefreshView();
        }