コード例 #1
0
        private void ExecuteDoubleClick(object obj)
        {
            if (obj.GetType().Equals(typeof(TVCustomerViewModel)))
            {
                IMessageBoxService msgbox = new MessageBoxService();
                CustomerViewModel  result = (CustomerViewModel)msgbox.OpenCustomerDlg((obj as TVCustomerViewModel).Customer.ID);
                if (result.Customer.Name != null && result.Customer.ID != -1)
                {
                    (obj as TVCustomerViewModel).Customer.Name = result.Customer.Name;
                }
            }
            else
            {
                if (obj.GetType().Equals(typeof(TVAssetViewModel)))
                {
                    if (!(obj as TVAssetViewModel).IsSelected)
                    {
                        return;
                    }

                    int ID = (obj as TVAssetViewModel).Asset.ID;
                    if (!OpenAssetWindow(ID))
                    {
                        IMessageBoxService msgbox = new MessageBoxService();
                        _ = (bool)msgbox.OpenAssetDlg(this, (TVAssetViewModel)obj);
                    }
                }
                else
                {
                    return;
                }
            }
        }