private void OnClosing(swPropertyManagerPageCloseReasons_e reason, ClosingArg arg)
 {
     if (reason == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay)
     {
         PageApplying?.Invoke(m_App, m_Model, m_Data, arg);
     }
 }
Beispiel #2
0
 private void OnCylPageCloseing(swPropertyManagerPageCloseReasons_e reason, ClosingArg arg)
 {
     if (reason == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay)
     {
         if (mCylinderData.Reference == null)
         {
             arg.ErrorMessage = "Select reference";
             arg.Cancel       = true;
         }
     }
 }
        public void OnClose(int Reason)
        {
            m_CloseReason = (swPropertyManagerPageCloseReasons_e)Reason;

            var arg = new ClosingArg();

            Closing?.Invoke(m_CloseReason, arg);

            if (arg.Cancel)
            {
                if (!string.IsNullOrEmpty(arg.ErrorTitle) || !string.IsNullOrEmpty(arg.ErrorMessage))
                {
                    var title = !string.IsNullOrEmpty(arg.ErrorTitle) ? arg.ErrorTitle : "Error";

                    m_App.ShowBubbleTooltipAt2(0, 0, (int)swArrowPosition.swArrowLeftTop,
                                               title, arg.ErrorMessage, (int)swBitMaps.swBitMapTreeError,
                                               "", "", 0, (int)swLinkString.swLinkStringNone, "", "");
                }

                const int S_FALSE = 1;
                throw new COMException(arg.ErrorMessage, S_FALSE);
            }
        }
Beispiel #4
0
 private void OnClosing(swPropertyManagerPageCloseReasons_e reason, ClosingArg arg)
 {
     if (reason == swPropertyManagerPageCloseReasons_e.swPropertyManagerPageClose_Okay)
     {
         try
         {
             m_OffsetBuilder.CreateOffset(m_Data.Segments, m_Data.Offset,
                                          m_Data.InnerTipsRadius, m_Data.OuterTipsRadius, m_Data.Reverse);
         }
         catch (UserException ex)
         {
             arg.Cancel       = true;
             arg.ErrorMessage = ex.Message;
             arg.ErrorTitle   = "Offset Failed";
         }
         catch (Exception ex)
         {
             arg.Cancel       = true;
             arg.ErrorMessage = "Failed to generate the offset";
             arg.ErrorTitle   = "Offset Failed";
         }
     }
 }
Beispiel #5
0
 private void SldPMPage_Closing(SolidWorks.Interop.swconst.swPropertyManagerPageCloseReasons_e reason, ClosingArg arg)
 {
     arg.Cancel       = true;
     arg.ErrorTitle   = "hi";
     arg.ErrorMessage = "msg";
 }