PABCSystem.pas - System.IComparable

This commit is contained in:
miks1965 2016-05-26 21:14:14 +03:00
parent bdcbf123c5
commit e8d7096ba8
2 changed files with 17 additions and 25 deletions

View file

@ -170,9 +170,7 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="DS\NavigationManager.cs" />
<Compile Include="DS\CodeCompletionVisual\CodeCompletionListView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="DS\CodeCompletionVisual\CodeCompletionListView.cs" />
<Compile Include="DS\CodeCompletionVisual\CodeCompletionWindow.cs">
<SubType>Form</SubType>
</Compile>
@ -311,17 +309,13 @@
<DependentUpon>BreakpointCondition.cs</DependentUpon>
</Compile>
<Compile Include="IB\Debugger\Debugger.cs" />
<Compile Include="IB\Debugger\DynamicTreeView.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="IB\Debugger\DynamicTreeView.cs" />
<Compile Include="IB\Debugger\ExpressionEvaluation.cs" />
<Compile Include="IB\Debugger\Immediate.cs" />
<Compile Include="IB\Debugger\LocalVars.cs">
</Compile>
<Compile Include="IB\Debugger\Utility.cs" />
<Compile Include="IB\FormExtensions.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="IB\FormExtensions.cs" />
<Compile Include="DockContent\OutputWindowForm.cs">
<SubType>Form</SubType>
</Compile>
@ -371,9 +365,7 @@
<Compile Include="OptionsContent\ViewOptionsContent.Designer.cs">
<DependentUpon>ViewOptionsContent.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Config\AssemblyInfo.cs" />
<Compile Include="Workbench\BuildService.cs" />
<Compile Include="Workbench\DesignerService.cs">

View file

@ -152,7 +152,7 @@ type
/// Представляет интерфейс для сравнения двух элементов
IComparer<T> = System.Collections.Generic.IComparer<T>;
/// Представляет интерфейс для набора пар Ключ-Значение
IDictionary<Key,Value> = System.Collections.Generic.IDictionary<Key,Value>;
@ -2145,61 +2145,61 @@ end;
///--
function TypedSet.IsInDiapason(elem: object): boolean;
begin
if (low_bound <> nil) and (upper_bound <> nil) and (elem is IComparable) then
if (low_bound <> nil) and (upper_bound <> nil) and (elem is System.IComparable) then
begin
case System.Type.GetTypeCode(elem.GetType) of
TypeCode.Char:
begin
if ((elem as IComparable).CompareTo(Convert.ToChar(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToChar(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToChar(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToChar(upper_bound)) <= 0) then
Result := true
else Result := false
end;
TypeCode.Int32:
begin
if not (elem is integer) then elem := Convert.ToInt32(elem);
if ((elem as IComparable).CompareTo(Convert.ToInt32(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToInt32(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToInt32(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToInt32(upper_bound)) <= 0) then
Result := true
else Result := false
end;
TypeCode.Byte:
begin
if ((elem as IComparable).CompareTo(Convert.ToByte(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToByte(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToByte(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToByte(upper_bound)) <= 0) then
Result := true
else Result := false
end;
TypeCode.SByte:
begin
if ((elem as IComparable).CompareTo(Convert.ToSByte(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToSByte(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToSByte(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToSByte(upper_bound)) <= 0) then
Result := true
else Result := false
end;
TypeCode.Int16:
begin
if ((elem as IComparable).CompareTo(Convert.ToInt16(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToInt16(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToInt16(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToInt16(upper_bound)) <= 0) then
Result := true
else Result := false
end;
TypeCode.UInt16:
begin
if ((elem as IComparable).CompareTo(Convert.ToUint16(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToUInt16(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToUint16(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToUInt16(upper_bound)) <= 0) then
Result := true
else Result := false
end;
TypeCode.UInt32:
begin
if ((elem as IComparable).CompareTo(Convert.ToUInt32(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToUInt32(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToUInt32(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToUInt32(upper_bound)) <= 0) then
Result := true
else Result := false
end;
TypeCode.Int64:
begin
if ((elem as IComparable).CompareTo(Convert.ToInt64(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToInt64(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToInt64(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToInt64(upper_bound)) <= 0) then
Result := true
else Result := false
end;
TypeCode.UInt64:
begin
if ((elem as IComparable).CompareTo(Convert.ToUInt64(low_bound)) >= 0) and ((elem as IComparable).CompareTo(Convert.ToUInt64(upper_bound)) <= 0) then
if ((elem as System.IComparable).CompareTo(Convert.ToUInt64(low_bound)) >= 0) and ((elem as System.IComparable).CompareTo(Convert.ToUInt64(upper_bound)) <= 0) then
Result := true
else Result := false
end;
@ -2460,7 +2460,7 @@ begin
var t: &Type;
var added := false;
if i.MoveNext then
if not (i.Current is IComparable) then
if not (i.Current is System.IComparable) then
begin
result := '' + FormatStr(i.Current) + '';
added := true;
@ -2471,7 +2471,7 @@ begin
t := i.Current.GetType;
end;
while i.MoveNext do
if not (i.Current is IComparable) then
if not (i.Current is System.IComparable) then
begin
result := (added ? result + ',' : '') + FormatStr(i.Current);
added := true;