本文主要是介绍知乎周源微信_每周源代码23-大解决方案版,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
知乎周源微信
My source code reading didn't have any rhyme or reason to it this week, but most of them were large, so this is the Big Solution Edition. In my new ongoing quest to read source code to be a better developer, Dear Reader, I present to you twenty-third in a infinite number of posts of "The Weekly Source Code."
我的源代码阅读本周没有任何押韵或理由,但其中大多数内容很大,因此是Big Solution Edition。 在我不断追求阅读源代码以成为更好的开发人员的过程中,亲爱的读者,我在无限数量的“每周源代码”中向您介绍了十二分。
大图片 (BigPicture)
Vertigo Software, the folks that did the Deep Zoom Hard Rock site at Mix have released to CodePlex their mouse-wheel support in a project called Big Picture. When I saw this initially, I said, "meh" but then realized upon reading it that there's some clever stuff here that goes beyond the mouse-wheel support that folks rushed to add (myself included) to their DeepZoom Helloworld Examples.
Vertigo Software是在Mix进行Deep Zoom Hard Rock网站开发的人们,已在一个名为Big Picture的项目中向CodePlex发布了其鼠标滚轮支持。 当我最初看到此内容时,我说“嗯”,但随后在阅读它时才意识到,这里有一些巧妙的东西,超出了人们匆忙添加到他们的DeepZoom Helloworld示例中的鼠标滚轮支持。
First, they've figured out (as of Silverlight 2.0 beta 1) how to disable the initial "zoom from nowhere" animation in DeepZoom. They turn UseSprings off initially, then turn it back on after the first motion has completed:
首先,他们弄清楚了(从Silverlight 2.0 beta 1起)如何在DeepZoom中禁用初始的“无处缩放”动画。 他们首先关闭UseSprings,然后在第一个动作完成后将其重新打开:
///
/// Handles the "MotionFinished" event fired by the MultiScaleImage, but only re-enables the "UseSprings"
/// property after the first motion completes (a little trick to properly bypass the initial "zoom in
/// from nowhere" animation when first loading)
///
/// The MultiScaleImage instance.
/// Unused RoutedEvent arguments.
void image_InitialMotionFinished(object sender, RoutedEventArgs e)
{
if (!isInitialMotionFinished)
{
isInitialMotionFinished = true;
image.UseSprings = true;
}
}
Simple, and obvious after the fact, but I hadn't figured it out. They also handle the issue of funky Uris in development vs. production by using App.Current.Host.Source:
事后简单,显而易见,但我还没有弄清楚。 他们还使用App.Current.Host.Source处理开发与生产中时髦的Uris问题。
Uri collectionUri;
if (Uri.TryCreate(App.Current.Host.Source, "/Collection/items.bin", out collectionUri))
image.Source = collectionUri;
They've also created a nice MultiScaleImageWrapper to encapsulate all the panning and zooming into one class.
他们还创建了一个不错的MultiScaleImageWrapper ,将所有平移和缩放封装为一个类。
开发服务器 (DevServer)
I wasn't sure what to make of this project when I started looking at it. The Project Description kind of made my eyes gloss over:
当我开始看这个项目时,我不确定该怎么做。 项目描述让我眼前一亮:
NetFXHarmonics DevServer is a web server hosting environment built on WPF and WCF technologies that allows multiple instances of Cassini-like web servers to run in parallel. DevServer also includes tracing capabilities for monitoring requests and responses, request filtering, automatic ViewState and ControlState parsing, visually enhanced HTTP status codes, IP binding modes for both local-only as well as remote access, and easy to use XML configuration.
NetFXHarmonics DevServer是基于WPF和WCF技术构建的Web服务器托管环境,它允许多个类似Cassini的Web服务器实例并行运行。 DevServer还包括用于监视请求和响应的跟踪功能,请求过滤,自动ViewState和ControlState解析,视觉增强的HTTP状态代码,仅本地访问和远程访问的IP绑定模式以及易于使用的XML配置。
Other than the WCF app we built at my last company, I haven't seen a lot of WCF stuff, and DevServer is an interesting and complete example of a Cassini-like Web Server. He wrote it because he wanted to more easily debug multiple WCF Services and ASP.NET Web Sites all working together. Rather than using client-side or sniffing tools, why not just take over the server?
除了我们在上一家公司创建的WCF应用程序外,我还没有看到很多WCF东西,DevServer是一个类似Cassini的Web服务器的有趣且完整的示例。 他之所以写它是因为他想更轻松地调试所有一起工作的WCF服务和ASP.NET网站。 与其使用客户端或嗅探工具,不如直接接管服务器?
The source is interesting to read holistically, but is also full of little useful utility methods. He parses out, decodes, and displays ViewState, shows headers, formatted and raw content, etc.
完整地阅读该源代码很有趣,但也充满了很少的有用实用程序方法。 他解析,解码并显示ViewState,显示标题,格式化的原始内容等。
David Betz is a very prolific writer of code and has a number of projects up on CodePlex he's given back to the community. One particularly interesting one is his Minima .NET 3.5 Blog Engine that he uses as a training tool. It also, of course, runs his blog. Spend some time over there, there's lots to learn.
大卫·贝茨 他是一个非常多产的代码编写者,并且在CodePlex上有许多项目,他已经回馈社区了。 一个特别有趣的是他用作培训工具的Minima .NET 3.5博客引擎。 当然,它也运行他的博客。 在那儿花一些时间,有很多东西要学习。
可视LINQ查询生成器 (Visual LINQ Query Builder)
LINQ is a little confusing and it can be difficult to visualize your queries and write them. Mitsu from MS France and his two French Students Simon Ferquel and Johanna Piou have written a Visual Query Builder for LINQ and enabled it in Visual Studio as an Add-In.
LINQ有点混乱,并且很难可视化查询并编写查询。 来自法国法国的Mitsu和他的两个法国学生Simon Ferquel和Johanna Piou已经为LINQ编写了一个可视化查询生成器,并在Visual Studio中将其作为插件启用。
The Add-In uses WPF and has a number of cool animations and a fresh UI design. You can drag your LINQ to SQL classes in from the Class View and visually build the LINQ query using dynamically generated Listboxes and an innovative Tree View I've not seen before.
加载项使用WPF并具有许多很酷的动画和新颖的UI设计。 您可以从类视图中将LINQ拖到SQL类中,并使用动态生成的列表框和以前从未见过的创新树形视图直观地构建LINQ查询。
The Results pane shows not only a preview of the data that will be returned, but also the generated SQL and the generated LINQ query and code. The results are put in a static method in a static utility class.
“结果”窗格不仅显示将要返回的数据的预览,还显示生成SQL以及生成的LINQ查询和代码。 将结果放在静态实用程序类的静态方法中。
All the better, the code is available and while it feels early and beta-esque, it's an interesting read. I really enjoy looking at how folks lay out their solution structures.
更好的是,该代码可用,虽然感觉很早并且具有beta风格,但这是一本有趣的文章。 我非常喜欢看人们如何布置他们的解决方案结构。
They've also made liberal use of Class Diagrams, presumably because they're students, but also because they are attentive to detail, so for the harder parts, like Query Formatting, there is an associated Class Diagram. Another feature of VS2008 I always forget.
他们还自由地使用了类图,大概是因为他们是学生,而且因为他们注重细节,所以对于较难的部分(如查询格式),有一个关联的类图。 VS2008的另一个功能我总是忘记了。
They've factored out an interesting VS Integration Project that could be of help to folks who are interested in making a Visual Designer and plugging it into Visual Studio. There's also a number of interesting WPF Controls like a "MultiStepControl" and "TreeListView."
他们提出了一个有趣的VS集成项目,该项目可能对有兴趣制作Visual Designer并将其插入Visual Studio的人们有所帮助。 还有许多有趣的WPF控件,例如“ MultiStepControl”和“ TreeListView”。
This is an exceedingly large amount of work, and it's going to take me a while to digest it. In some ways it feels brilliant and in others it seems incredibly complex, possibly overly so. Fortunately, you don't have to read the source, you can just use by installing their MSI if you like.
这是一项非常庞大的工作,需要我花一些时间来消化它。 从某些方面来说,它感觉很出色,而在另一些方面,它似乎是如此复杂,甚至可能过于复杂。 幸运的是,您不必阅读源代码,只要愿意就可以通过安装其MSI来使用。
翻译自: https://www.hanselman.com/blog/the-weekly-source-code-23-big-solution-edition
知乎周源微信
这篇关于知乎周源微信_每周源代码23-大解决方案版的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!