Exemplo n.º 1
0
 private void btnCast_Click(object sender, EventArgs e)
 {
     if (HTTPCast.IsCasting)
     {
         HTTPCast.StopCasting();
     }
     else if (WebCast.IsCasting)
     {
         WebCast.StopCasting();
     }
     else
     {
         CastDialog cd = new CastDialog(control);
         cd.ShowDialog();
     }
     CloseMenu?.Invoke();
 }
        public void DoCast()
        {
            // There will be no member info if this is an object
            // tree node (not an object type tree node)
            CastDialog cd = new CastDialog(_castInfo, ObjectInfo.ObjMemberInfo, _objInfo.Obj);

            // Returns true if it worked
            if (!cd.DoShowDialog())
            {
                return;
            }
            _castInfo = cd.CastInfo;
            // Reapply the cast if it exists, since the object is
            // refreshed whenever the tree
            if (_castInfo != null && _objInfo.Obj != null)
            {
                _castObject = _castInfo.DoCast(_objInfo.Obj);
            }
            ObjectValueChanged();
            // Reset the detail panel if the cast information changed
            DetailPanel.Clear();
            GetDetailText();
        }