我怎样才能隐式地将一种类型转换为另一种类型 [英] How Can I Implicitly Convert One Type To Another
本文介绍了我怎样才能隐式地将一种类型转换为另一种类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
void client_GetProductDictionariesCompleted( object sender,GetProductDictionariesCompletedEventArgs e)
{
DictionaryCache.ProductDictionaries = e.Result;
acbProduct.Visibility = Visibility.Visible;
acbProduct.ItemsSource = DictionaryCache.ProductDictionaries.Products;
}
错误22无法隐式转换类型'Adcheck.ServiceReference1.ProductDictionaries' toSLAdcheckBusinnesObjects.Dictionaries.ProductDictionariesD:\ Factory\factory code\BMI\Adcheck\Adcheck\Controls\Contents\ProductLevelCaptureData.xaml.cs 105 51 Adcheck
解决方案
这不是我们可以回答的问题:您需要与创建包含两种类型的库或库的人交谈:我们甚至不知道它们是否相关!
请检查以下链接
http://msdn.microsoft.com/en-us/library/ms173105.aspx [ ^ ]
http://www.dotnetperls.com/cast [ ^ ]
使用隐式和显式运算符键入转换 [ ^ ]
void client_GetProductDictionariesCompleted(object sender, GetProductDictionariesCompletedEventArgs e)
{
DictionaryCache.ProductDictionaries = e.Result;
acbProduct.Visibility = Visibility.Visible;
acbProduct.ItemsSource = DictionaryCache.ProductDictionaries.Products;
}
Error 22 Cannot implicitly convert type 'Adcheck.ServiceReference1.ProductDictionaries' to 'SLAdcheckBusinnesObjects.Dictionaries.ProductDictionaries' D:\Factory\factory code\BMI\Adcheck\Adcheck\Controls\Contents\ProductLevelCaptureData.xaml.cs 105 51 Adcheck
解决方案
This isn't a question we can answer: you need to talk to whoever created the library or libraries that contain the two types: we don't even know if they are related!
Please check following links
http://msdn.microsoft.com/en-us/library/ms173105.aspx[^]
http://www.dotnetperls.com/cast[^]
Type conversions with implicit and explicit operators[^]
这篇关于我怎样才能隐式地将一种类型转换为另一种类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文