вторник, 31 марта 2009 г.

Качай и читай - доки от M$

По-английски, от первоисточника. Книжицы и статейки сгруппированы по темам:

пятница, 27 марта 2009 г.

λ operator

=> token is called the lambda operator. It is used in lambda expressions to separate the input variables on the left side from the lambda body on the right side. Lambda expressions are inline expressions similar to anonymous methods but more flexible; they are used extensively in LINQ queries that are expressed in method syntax. For more information, see Lambda Expressions (C# Programming Guide).
string[] words = { "cherry", "apple", "blueberry" };
int shortestWord = words.Min(w => w.Length);

Remarks

The => operator is read as "goes to." In the previous example, the expression is read as “Min w goes to w dot Length”.
The => operator has the same precedence as the assignment operator (=) and is right-associative.

You can specify the type of the input variable explicitly or let the compiler infer it; in either case the variable is strongly typed at compile time. When you specify a type, you must enclose the type name and the variable name in parentheses, as shown in the following example:
int shortestWord = words.Min((string w) => w.Length);
Multiple input variables are enclosed in parentheses, as shown in the example later in this topic.

Example
The following example shows how to write a lambda expression for the Standard Query Operator Enumerable..::.Where with two input variables. This expression returns all the strings whose lengths are less than their index positions in the array.

string[] digits = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
var shortDigits = digits.Where((digit, index) => digit.Length < index);

понедельник, 23 марта 2009 г.

Простой способ сделать дату приемлимой для CAML

Дата приводится для КАМЛа с помощью
SPUtility.CreateISO8601DateTimeFromSystemDateTime(ДейтТайм)

понедельник, 9 марта 2009 г.

asp:Repeater


<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
</HeaderTemplate>

<ItemTemplate>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</ItemTemplate>

<FooterTemplate>
</table>
</FooterTemplate>

</asp:Repeater>

пятница, 27 февраля 2009 г.

VS2008 bugs

Solution:
devenv.exe /resetSkipPkgs

понедельник, 23 февраля 2009 г.

Sharepoint Administering shortcuts



Параметры узла (Web Parameters)


http://‹path узла›/_layouts/settings.aspx



Типы содержимого узла


http://‹path узла›/_layouts/mngctype.aspx


Столбцы узла

http://‹path узла›/_layouts/mngfield.aspx


четверг, 19 февраля 2009 г.

SPException: The security validation for this page is invalid

=
Данные проверки безопасности этой страницы недопустимы.


происходит при:
listItem.BreakRoleInheritance(true);

пятница, 13 февраля 2009 г.

ASSnippet


SPRoleAssignment ass= new SPRoleAssignment(group);
ass.RoleDefinitionBindings.RemoveAll();

foreach (SPRoleType roleName in roles)
{
SPRoleDefinition role = web.Site.RootWeb.RoleDefinitions.
GetByType(roleName);
ass.RoleDefinitionBindings.Add(role);
}
item.RoleAssignments.Add(ass);

четверг, 12 февраля 2009 г.

хак: редактировать нередактируемое

Время от времени, при работе в Sharepoint, возникает необходимость изменить страницу. Обычно, в меню "Действия узла" выбрав "Изменить страницу", можно получить доступ к режиму редактирования этой страницы. Но иногда бывает, что этот пунктик нельзя нажать. Disabled он. А поредактировать страничку хочется. В таком случае можно попробовать выполнить вот такой трюк: добавляем
&PageView=Shared&ToolPaneView=2
в адресную строку браузера и жмем Enter.
Voila! Редактируем!

среда, 11 февраля 2009 г.

Wiki по .NET

Есть потребность персистентно хранить знания. До сих пор, помимо бумажек и собственной системы ведения записей в локальных файлах, я использовал блог для этой цели.
Иногда приходится расширять прежние записи, увы, это не удобно. Да и неудивительно. Задачей блога, на мой взгляд, является сохранение заметок на бегу... Блог - это по сути дневник и записная книжка. Итак, нужна систематизация и удобство редактирования записей, большая, нежели предоставляет блог-интерфейс.
Вот ведь как хорошо, добрые люди уже давно придумали систему, которая позволяет всех обозначенных зайцев разом убить: это та-дам! Wiki. Ура, товарищи!

Вот, собственно, материализация мыслей о систематизации и сохранениии знаний:
Wiki по .NETу

четверг, 5 февраля 2009 г.

M$ ляпы


Приобретение лицензий единым платежом.
Это программа называется Microsoft Open Value
и вы можете узнать о ней больше по следующему линку:

.. по дешевой цене

пятница, 30 января 2009 г.

MVC RC

Попытка установки
ASP.NET MVC Release Candidate 1
добавлено 3 февраля: и
Windows PowerShell V2 Community Technology Preview 3 (CTP3)
на Vista 64 не увенчалась успехом.

понедельник, 19 января 2009 г.

Date difference in C#

There is a very useful function for quantative comparing of dates in VisualBasic - DateDiff. This is a cause of a tiny envy of a numerous C#-coders, because there aren't an analog in C#. Well, in C# we could make a little workaround:
C#:
TimeSpan dateDiff(DateTime firstDate,DateTime secondDate)
{
 return secondDate - firstDate;
}
Then, just take a necessary time unit (from days to milliseconds) from the Timespan structure:
C#:
TimeSpan ts = dateDiff(today, DateTime.Parse('1999-01-01'));
int days=ts.Days;
int minutes=ts.Minutes;

пятница, 16 января 2009 г.

CheckList

<%@ Control Language="C#" AutoEventWireup="true" Inherits="the_name_of_attached_PARTIAL_CLASS" %>

четверг, 15 января 2009 г.

errors


"This solution is offline. [Team Foundation Server:"

HELPed: devenv.exe /ResetSkipPkgs

"The language-neutral solution package was not found."


was after: WSS Extensions util /uninstall

HELPed: setup.bat /install