text stringlengths 9 39.2M | dir stringlengths 26 295 | lang stringclasses 185
values | created_date timestamp[us] | updated_date timestamp[us] | repo_name stringlengths 1 97 | repo_full_name stringlengths 7 106 | star int64 1k 183k | len_tokens int64 1 13.8M |
|---|---|---|---|---|---|---|---|---|
```xml
import ControlLabel from "@erxes/ui/src/components/form/Label";
import FormControl from "@erxes/ui/src/components/form/Control";
import FormGroup from "@erxes/ui/src/components/form/Group";
import Icon from "@erxes/ui/src/components/Icon";
import React, { useRef } from "react";
import Tip from "@erxes/ui/src/components/Tip";
import { __, router } from "@erxes/ui/src/utils";
import { Link } from "react-router-dom";
import { SidebarFilters } from "../../../styles";
import { SidebarList as List } from "@erxes/ui/src/layout";
import { Wrapper } from "@erxes/ui/src/layout";
import Select from "react-select";
import { useLocation, useNavigate } from "react-router-dom";
interface Props {
queryParams: any;
}
const { Section } = Wrapper.Sidebar;
const Sidebar = (props: Props) => {
const location = useLocation();
const navigate = useNavigate();
const { queryParams } = props;
const timerRef = useRef<number | null>(null);
const clearCategoryFilter = () => {
router.removeParams(
navigate,
location,
"filterStatus",
"minMulitiplier",
"maxMulitiplier"
);
};
const setFilter = (name, value) => {
router.removeParams(navigate, location, "page");
router.setParams(navigate, location, { [name]: value });
};
const handleStatusSelect = (name, selectedOption) => {
setFilter(name, selectedOption.value);
};
const searchMultiplier = (e) => {
if (timerRef.current) {
clearTimeout(timerRef.current);
}
const name = e.target.name;
const value = e.target.value;
timerRef.current = window.setTimeout(() => {
setFilter(name, value);
}, 500);
};
const renderListItem = (url: string, text: string) => {
return (
<li>
<Link
to={url}
className={window.location.href.includes(url) ? "active" : ""}
>
{__(text)}
</Link>
</li>
);
};
const statusOptions = [
{
label: "All status",
value: "",
},
{
label: "Active",
value: "active",
},
{
label: "Archived",
value: "archived",
},
];
return (
<>
<Section.Title>
{__("Filters")}
<Section.QuickButtons>
{(router.getParam(location, "filterStatus") ||
router.getParam(location, "minMulitiplier") ||
router.getParam(location, "maxMulitiplier")) && (
<a href="#cancel" tabIndex={0} onClick={clearCategoryFilter}>
<Tip text={__("Clear filter")} placement="bottom">
<Icon icon="cancel-1" />
</Tip>
</a>
)}
</Section.QuickButtons>
</Section.Title>
<SidebarFilters>
<List id="SettingsSidebar">
<FormGroup>
<ControlLabel>{__(`Min variable`)}</ControlLabel>
<FormControl
name="minMulitiplier"
type="number"
min={0}
required={false}
defaultValue={queryParams.minMulitiplier || ""}
onChange={searchMultiplier}
/>
</FormGroup>
<FormGroup>
<ControlLabel>{__(`Max variable`)}</ControlLabel>
<FormControl
name="maxMulitiplier"
type="number"
min={0}
required={false}
defaultValue={queryParams.maxMulitiplier || ""}
onChange={searchMultiplier}
/>
</FormGroup>
<FormGroup>
<ControlLabel>Status</ControlLabel>
<Select
name="filterStatus"
value={statusOptions.find(
(o) => o.value === (queryParams.filterStatus || "")
)}
onChange={(option) => handleStatusSelect("filterStatus", option)}
options={statusOptions}
isClearable={false}
/>
</FormGroup>
</List>
</SidebarFilters>
</>
);
};
export default Sidebar;
``` | /content/code_sandbox/packages/plugin-salesplans-ui/src/settings/components/label/Sidebar.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 881 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="debug|Win32">
<Configuration>debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="checked|Win32">
<Configuration>checked</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="profile|Win32">
<Configuration>profile</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="release|Win32">
<Configuration>release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{41C4E1A2-3F28-762A-9C7B-56ACE68B960A}</ProjectGuid>
<RootNamespace>SnippetSerialization</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetSerialization/debug\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)DEBUG</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;_DEBUG;PX_DEBUG=1;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/LIBPATH:../../../Lib/vc14win32 PhysX3CommonDEBUG_x86.lib PhysX3DEBUG_x86.lib PhysX3CookingDEBUG_x86.lib PhysX3CharacterKinematicDEBUG_x86.lib PhysX3ExtensionsDEBUG.lib PhysX3VehicleDEBUG.lib PxPvdSDKDEBUG_x86.lib PxTaskDEBUG_x86.lib PxFoundationDEBUG_x86.lib PsFastXmlDEBUG_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsDEBUG.lib /DEBUG</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)DEBUG.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationDEBUG_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKDEBUG_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetSerialization/checked\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)CHECKED</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/LIBPATH:../../../Lib/vc14win32 PhysX3CommonCHECKED_x86.lib PhysX3CHECKED_x86.lib PhysX3CookingCHECKED_x86.lib PhysX3CharacterKinematicCHECKED_x86.lib PhysX3ExtensionsCHECKED.lib PhysX3VehicleCHECKED.lib PxPvdSDKCHECKED_x86.lib PxTaskCHECKED_x86.lib PxFoundationCHECKED_x86.lib PsFastXmlCHECKED_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsCHECKED.lib</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)CHECKED.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationCHECKED_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKCHECKED_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetSerialization/profile\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)PROFILE</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_PROFILE=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc14win32 PhysX3CommonPROFILE_x86.lib PhysX3PROFILE_x86.lib PhysX3CookingPROFILE_x86.lib PhysX3CharacterKinematicPROFILE_x86.lib PhysX3ExtensionsPROFILE.lib PhysX3VehiclePROFILE.lib PxPvdSDKPROFILE_x86.lib PxTaskPROFILE_x86.lib PxFoundationPROFILE_x86.lib PsFastXmlPROFILE_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsPROFILE.lib /DEBUG</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)PROFILE.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationPROFILE_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKPROFILE_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetSerialization/release\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_SUPPORT_PVD=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc14win32 PhysX3Common_x86.lib PhysX3_x86.lib PhysX3Cooking_x86.lib PhysX3CharacterKinematic_x86.lib PhysX3Extensions.lib PhysX3Vehicle.lib PxPvdSDK_x86.lib PxTask_x86.lib PxFoundation_x86.lib PsFastXml_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtils.lib</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundation_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDK_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\SnippetCommon\ClassicMain.cpp">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\SnippetSerialization\SnippetSerialization.cpp">
</ClCompile>
<ClCompile Include="..\..\SnippetSerialization\SnippetSerializationRender.cpp">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="./SnippetUtils.vcxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="./SnippetRender.vcxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"></ImportGroup>
</Project>
``` | /content/code_sandbox/PhysX_3.4/Snippets/compiler/vc14win32/SnippetSerialization.vcxproj | xml | 2016-10-12T16:34:31 | 2024-08-16T09:40:38 | PhysX-3.4 | NVIDIAGameWorks/PhysX-3.4 | 2,343 | 4,841 |
```xml
export default {
badge: 'badge',
open: 'Open',
close: 'Close',
dismiss: 'Dismiss',
confirmEdit: {
ok: 'OK',
cancel: 'Cancel',
},
dataIterator: {
noResultsText: 'Geen ooreenstemmende resultate is gevind nie',
loadingText: 'Loading item...',
},
dataTable: {
itemsPerPageText: 'Rye per bladsy:',
ariaLabel: {
sortDescending: 'Sorted descending.',
sortAscending: 'Sorted ascending..',
sortNone: 'Not sorted.',
activateNone: 'Activate to remove sorting.',
activateDescending: 'Activate to sort descending.',
activateAscending: 'Activate to sort ascending.',
},
sortBy: 'Sort by',
},
dataFooter: {
itemsPerPageText: 'Aantal per bladsy:',
itemsPerPageAll: 'Alles',
nextPage: 'Volgende bladsy',
prevPage: 'Vorige bladsy',
firstPage: 'Eerste bladsy',
lastPage: 'Laaste bladsy',
pageText: '{0}-{1} van {2}',
},
dateRangeInput: {
divider: 'to',
},
datePicker: {
itemsSelected: '{0} selected',
range: {
title: 'Select dates',
header: 'Enter dates',
},
title: 'Select date',
header: 'Enter date',
input: {
placeholder: 'Enter date',
},
},
noDataText: 'Geen data is beskikbaar nie',
carousel: {
prev: 'Vorige visuele',
next: 'Volgende visuele',
ariaLabel: {
delimiter: 'Carousel slide {0} of {1}',
},
},
calendar: {
moreEvents: '{0} meer',
today: 'Today',
},
input: {
clear: 'Clear {0}',
prependAction: '{0} prepended action',
appendAction: '{0} appended action',
otp: 'Please enter OTP character {0}',
},
fileInput: {
counter: '{0} files',
counterSize: '{0} files ({1} in total)',
},
timePicker: {
am: 'AM',
pm: 'PM',
title: 'Select Time',
},
pagination: {
ariaLabel: {
root: 'Paginasie-navigasie',
next: 'Volgende bladsy',
previous: 'Vorige bladsy',
page: 'Gaan na bladsy {0}',
currentPage: 'Huidige bladsy, Bladsy {0}',
first: 'First page',
last: 'Last page',
},
},
stepper: {
next: 'Next',
prev: 'Previous',
},
rating: {
ariaLabel: {
item: 'Rating {0} of {1}',
},
},
loading: 'Loading...',
infiniteScroll: {
loadMore: 'Load more',
empty: 'No more',
},
}
``` | /content/code_sandbox/packages/vuetify/src/locale/af.ts | xml | 2016-09-12T00:39:35 | 2024-08-16T20:06:39 | vuetify | vuetifyjs/vuetify | 39,539 | 679 |
```xml
/*
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
import Complex128 = require( '@stdlib/complex/float64/ctor' );
import isEqual = require( './index' );
// TESTS //
// The function returns a boolean...
{
const z1 = new Complex128( 5.0, 3.0 );
const z2 = new Complex128( 5.0, 3.0 );
isEqual( z1, z2 ); // $ExpectType boolean
}
// The compiler throws an error if the function is provided a first argument that is not a complex number...
{
const z2 = new Complex128( 5.0, 3.0 );
isEqual( 'abc', z2 ); // $ExpectError
isEqual( 123, z2 ); // $ExpectError
isEqual( true, z2 ); // $ExpectError
isEqual( false, z2 ); // $ExpectError
isEqual( [], z2 ); // $ExpectError
isEqual( {}, z2 ); // $ExpectError
isEqual( ( x: number ): number => x, z2 ); // $ExpectError
}
// The compiler throws an error if the function is provided a second argument that is not a complex number...
{
const z1 = new Complex128( 5.0, 3.0 );
isEqual( z1, 'abc' ); // $ExpectError
isEqual( z1, 123 ); // $ExpectError
isEqual( z1, true ); // $ExpectError
isEqual( z1, false ); // $ExpectError
isEqual( z1, [] ); // $ExpectError
isEqual( z1, {} ); // $ExpectError
isEqual( z1, ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the function is provided an unsupported number of arguments...
{
const z1 = new Complex128( 5.0, 3.0 );
const z2 = new Complex128( 5.0, 3.0 );
isEqual(); // $ExpectError
isEqual( z1 ); // $ExpectError
isEqual( z1, z2, {} ); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/complex/float64/base/assert/is-equal/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 511 |
```xml
/**
* @license
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at path_to_url
*/
import {Observable, Subscriber} from 'rxjs';
import {Constructor} from './constructor';
/**
* Mixin that adds an initialized property to a directive which, when subscribed to, will emit a
* value once markInitialized has been called, which should be done during the ngOnInit function.
* If the subscription is made after it has already been marked as initialized, then it will trigger
* an emit immediately.
* @docs-private
* @deprecated Will be removed together with `mixinInitializer`.
* @breaking-change 19.0.0
*/
export interface HasInitialized {
/** Stream that emits once during the directive/component's ngOnInit. */
initialized: Observable<void>;
/**
* Sets the state as initialized and must be called during ngOnInit to notify subscribers that
* the directive has been initialized.
* @docs-private
*/
_markInitialized: () => void;
}
type HasInitializedCtor = Constructor<HasInitialized>;
/**
* Mixin to augment a directive with an initialized property that will emits when ngOnInit ends.
* @deprecated Track the initialized state manually.
* @breaking-change 19.0.0
*/
export function mixinInitialized<T extends Constructor<{}>>(base: T): HasInitializedCtor & T {
return class extends base {
/** Whether this directive has been marked as initialized. */
_isInitialized = false;
/**
* List of subscribers that subscribed before the directive was initialized. Should be notified
* during _markInitialized. Set to null after pending subscribers are notified, and should
* not expect to be populated after.
*/
_pendingSubscribers: Subscriber<void>[] | null = [];
/**
* Observable stream that emits when the directive initializes. If already initialized, the
* subscriber is stored to be notified once _markInitialized is called.
*/
initialized = new Observable<void>(subscriber => {
// If initialized, immediately notify the subscriber. Otherwise store the subscriber to notify
// when _markInitialized is called.
if (this._isInitialized) {
this._notifySubscriber(subscriber);
} else {
this._pendingSubscribers!.push(subscriber);
}
});
constructor(...args: any[]) {
super(...args);
}
/**
* Marks the state as initialized and notifies pending subscribers. Should be called at the end
* of ngOnInit.
* @docs-private
*/
_markInitialized(): void {
if (this._isInitialized && (typeof ngDevMode === 'undefined' || ngDevMode)) {
throw Error(
'This directive has already been marked as initialized and ' +
'should not be called twice.',
);
}
this._isInitialized = true;
this._pendingSubscribers!.forEach(this._notifySubscriber);
this._pendingSubscribers = null;
}
/** Emits and completes the subscriber stream (should only emit once). */
_notifySubscriber(subscriber: Subscriber<void>): void {
subscriber.next();
subscriber.complete();
}
};
}
``` | /content/code_sandbox/src/material/core/common-behaviors/initialized.ts | xml | 2016-01-04T18:50:02 | 2024-08-16T11:21:13 | components | angular/components | 24,263 | 668 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns="path_to_url"
xmlns:flowable="path_to_url"
targetNamespace="Examples">
<process id="process">
<startEvent id="theStart" />
<sequenceFlow sourceRef="theStart" targetRef="usertask1" />
<userTask id="usertask1" name="Task A"/>
<sequenceFlow sourceRef="usertask1" targetRef="service1" />
<serviceTask id="service1" flowable:expression="${execution.processDefinitionVersion.toString()}" flowable:resultVariableName="resultVersion" />
<sequenceFlow sourceRef="service1" targetRef="usertask2" />
<userTask id="usertask2" name="Task B"/>
<sequenceFlow sourceRef="usertask2" targetRef="theEnd" />
<endEvent id="theEnd" />
</process>
</definitions>
``` | /content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/servicetask/ServiceTaskExpressionTest.testDefinitionExpression.bpmn20.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 219 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="file_icon_width">40dp</dimen>
<dimen name="file_icon_height">40dp</dimen>
<dimen name="file_name_textSize">17sp</dimen>
<dimen name="file_item_checkbox_size">22dp</dimen>
</resources>
``` | /content/code_sandbox/filepicker/src/main/res/values/dimens.xml | xml | 2016-07-31T20:07:34 | 2024-08-14T09:28:50 | Android-FilePicker | DroidNinja/Android-FilePicker | 2,691 | 87 |
```xml
// @needsAudit
/**
* Access token type.
*
* @see [Section 7.1](path_to_url#section-7.1)
*/
export type TokenType = 'bearer' | 'mac';
// @needsAudit
/**
* A hint about the type of the token submitted for revocation. If not included then the server should attempt to deduce the token type.
*
* @see [Section 2.1](path_to_url#section-2.1)
*/
export enum TokenTypeHint {
/**
* Access token.
*
* [Section 1.4](path_to_url#section-1.4)
*/
AccessToken = 'access_token',
/**
* Refresh token.
*
* [Section 1.5](path_to_url#section-1.5)
*/
RefreshToken = 'refresh_token',
}
// @needsAudit
/**
* Config used to request a token refresh, revocation, or code exchange.
*/
export type TokenRequestConfig = {
/**
* A unique string representing the registration information provided by the client.
* The client identifier is not a secret; it is exposed to the resource owner and shouldn't be used
* alone for client authentication.
*
* The client identifier is unique to the authorization server.
*
* [Section 2.2](path_to_url#section-2.2)
*/
clientId: string;
/**
* Client secret supplied by an auth provider.
* There is no secure way to store this on the client.
*
* [Section 2.3.1](path_to_url#section-2.3.1)
*/
clientSecret?: string;
/**
* Extra query params that'll be added to the query string.
*/
extraParams?: Record<string, string>;
/**
* List of strings to request access to.
*
* [Section 3.3](path_to_url#section-3.3)
*/
scopes?: string[];
};
// @needsAudit
/**
* Config used to exchange an authorization code for an access token.
*
* @see [Section 4.1.3](path_to_url#section-4.1.3)
*/
export type AccessTokenRequestConfig = TokenRequestConfig & {
/**
* The authorization code received from the authorization server.
*/
code: string;
/**
* If the `redirectUri` parameter was included in the `AuthRequest`, then it must be supplied here as well.
*
* [Section 3.1.2](path_to_url#section-3.1.2)
*/
redirectUri: string;
};
// @needsAudit
/**
* Config used to request a token refresh, or code exchange.
*
* @see [Section 6](path_to_url#section-6)
*/
export type RefreshTokenRequestConfig = TokenRequestConfig & {
/**
* The refresh token issued to the client.
*/
refreshToken?: string;
};
// @needsAudit
/**
* Config used to revoke a token.
*
* @see [Section 2.1](path_to_url#section-2.1)
*/
export type RevokeTokenRequestConfig = Partial<TokenRequestConfig> & {
/**
* The token that the client wants to get revoked.
*
* [Section 3.1](path_to_url#section-3.1)
*/
token: string;
/**
* A hint about the type of the token submitted for revocation.
*
* [Section 3.2](path_to_url#section-3.2)
*/
tokenTypeHint?: TokenTypeHint;
};
// @needsAudit
/**
* Grant type values used in dynamic client registration and auth requests.
*
* @see [Appendix A.10](path_to_url#appendix-A.10)
*/
export enum GrantType {
/**
* Used for exchanging an authorization code for one or more tokens.
*
* [Section 4.1.3](path_to_url#section-4.1.3)
*/
AuthorizationCode = 'authorization_code',
/**
* Used when obtaining an access token.
*
* [Section 4.2](path_to_url#section-4.2)
*/
Implicit = 'implicit',
/**
* Used when exchanging a refresh token for a new token.
*
* [Section 6](path_to_url#section-6)
*/
RefreshToken = 'refresh_token',
/**
* Used for client credentials flow.
*
* [Section 4.4.2](path_to_url#section-4.4.2)
*/
ClientCredentials = 'client_credentials',
}
// @needsAudit @docsMissing
/**
* Object returned from the server after a token response.
*/
export type ServerTokenResponseConfig = {
access_token: string;
token_type?: TokenType;
expires_in?: number;
refresh_token?: string;
scope?: string;
id_token?: string;
issued_at?: number;
};
// @needsAudit
export type TokenResponseConfig = {
/**
* The access token issued by the authorization server.
*
* [Section 4.2.2](path_to_url#section-4.2.2)
*/
accessToken: string;
/**
* The type of the token issued. Value is case insensitive.
*
* [Section 7.1](path_to_url#section-7.1)
*/
tokenType?: TokenType;
/**
* The lifetime in seconds of the access token.
*
* For example, the value `3600` denotes that the access token will
* expire in one hour from the time the response was generated.
*
* If omitted, the authorization server should provide the
* expiration time via other means or document the default value.
*
* [Section 4.2.2](path_to_url#section-4.2.2)
*/
expiresIn?: number;
/**
* The refresh token, which can be used to obtain new access tokens using the same authorization grant.
*
* [Section 5.1](path_to_url#section-5.1)
*/
refreshToken?: string;
/**
* The scope of the access token. Only required if it's different to the scope that was requested by the client.
*
* [Section 3.3](path_to_url#section-3.3)
*/
scope?: string;
/**
* Required if the "state" parameter was present in the client
* authorization request. The exact value received from the client.
*
* [Section 4.2.2](path_to_url#section-4.2.2)
*/
state?: string;
/**
* ID Token value associated with the authenticated session.
*
* [TokenResponse](path_to_url#TokenResponse)
*/
idToken?: string;
/**
* Time in seconds when the token was received by the client.
*/
issuedAt?: number;
};
``` | /content/code_sandbox/packages/expo-auth-session/src/TokenRequest.types.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 1,511 |
```xml
import { Measure } from "../entities/measure/Measure"
import { noteOffMidiEvent, noteOnMidiEvent } from "../midi/MidiEvent"
import RootStore from "../stores/RootStore"
export const playOrPause =
({ player }: RootStore) =>
() => {
if (player.isPlaying) {
player.stop()
} else {
player.play()
}
}
export const stop =
({ player, pianoRollStore }: RootStore) =>
() => {
player.stop()
player.position = 0
pianoRollStore.setScrollLeftInTicks(0)
}
export const rewindOneBar =
({ song, player, pianoRollStore }: RootStore) =>
() => {
const tick = Measure.getPreviousMeasureTick(
song.measures,
player.position,
song.timebase,
)
player.position = tick
// make sure player doesn't move out of sight to the left
if (player.position < pianoRollStore.scrollLeftTicks) {
pianoRollStore.setScrollLeftInTicks(player.position)
}
}
export const fastForwardOneBar =
({ song, player, pianoRollStore }: RootStore) =>
() => {
const tick = Measure.getNextMeasureTick(
song.measures,
player.position,
song.timebase,
)
player.position = tick
// make sure player doesn't move out of sight to the right
const { transform, scrollLeft } = pianoRollStore
const x = transform.getX(player.position)
const screenX = x - scrollLeft
if (screenX > pianoRollStore.canvasWidth * 0.7) {
pianoRollStore.setScrollLeftInPixels(x - pianoRollStore.canvasWidth * 0.7)
}
}
export const nextTrack =
({ pianoRollStore, song }: RootStore) =>
() => {
pianoRollStore.selectedTrackIndex = Math.min(
pianoRollStore.selectedTrackIndex + 1,
song.tracks.length - 1,
)
}
export const previousTrack =
({ pianoRollStore }: RootStore) =>
() => {
pianoRollStore.selectedTrackIndex = Math.max(
pianoRollStore.selectedTrackIndex - 1,
1,
)
}
export const toggleSolo =
({ pianoRollStore: { selectedTrackId }, trackMute }: RootStore) =>
() => {
if (trackMute.isSolo(selectedTrackId)) {
trackMute.unsolo(selectedTrackId)
} else {
trackMute.solo(selectedTrackId)
}
}
export const toggleMute =
({ pianoRollStore: { selectedTrackId }, trackMute }: RootStore) =>
() => {
if (trackMute.isMuted(selectedTrackId)) {
trackMute.unmute(selectedTrackId)
} else {
trackMute.mute(selectedTrackId)
}
}
export const toggleGhost =
({ pianoRollStore: { selectedTrackId }, pianoRollStore }: RootStore) =>
() => {
if (pianoRollStore.notGhostTrackIds.has(selectedTrackId)) {
pianoRollStore.notGhostTrackIds.delete(selectedTrackId)
} else {
pianoRollStore.notGhostTrackIds.add(selectedTrackId)
}
}
export const setLoopBegin =
({ player }: RootStore) =>
(tick: number) => {
player.loop = {
end: Math.max(tick, player.loop?.end ?? tick),
enabled: player.loop?.enabled ?? false,
begin: tick,
}
}
export const setLoopEnd =
({ player }: RootStore) =>
(tick: number) => {
player.loop = {
begin: Math.min(tick, player.loop?.begin ?? tick),
enabled: player.loop?.enabled ?? false,
end: tick,
}
}
export const toggleEnableLoop =
({ player }: RootStore) =>
() => {
if (player.loop === null) {
return
}
player.loop = { ...player.loop, enabled: !player.loop.enabled }
}
export const startNote =
({ player, synthGroup }: Pick<RootStore, "player" | "synthGroup">) =>
(
{
channel,
noteNumber,
velocity,
}: {
noteNumber: number
velocity: number
channel: number
},
delayTime = 0,
) => {
synthGroup.activate()
player.sendEvent(
noteOnMidiEvent(0, channel, noteNumber, velocity),
delayTime,
)
}
export const stopNote =
({ player }: Pick<RootStore, "player">) =>
(
{
channel,
noteNumber,
}: {
noteNumber: number
channel: number
},
delayTime = 0,
) => {
player.sendEvent(noteOffMidiEvent(0, channel, noteNumber, 0), delayTime)
}
``` | /content/code_sandbox/app/src/actions/player.ts | xml | 2016-03-06T15:19:53 | 2024-08-15T14:27:10 | signal | ryohey/signal | 1,238 | 1,064 |
```xml
import _ from "lodash";
import { ObservableMap, values as mobxValues, keys as mobxKeys } from "mobx";
import { FieldInterface } from "./models/FieldInterface";
import { AllowedFieldPropsTypes, FieldPropsEnum, FieldPropsOccurrence } from "./models/FieldProps";
import { props } from "./props";
const getObservableMapValues = (observableMap: ObservableMap):
ReadonlyArray<FieldInterface> => mobxValues(observableMap);
const getObservableMapKeys = (observableMap: ObservableMap):
ReadonlyArray<FieldInterface> => mobxKeys(observableMap);
const checkObserveItem =
(change: any) =>
({ key, to, type, exec }: any) =>
change.type === type &&
change.name === key &&
change.newValue === to &&
exec.apply(change, [change]);
const checkObserve = (collection: object[]) => (change: any) =>
collection.map(checkObserveItem(change));
const checkPropOccurrence = ({ type, data }: any): boolean => {
let $check: any;
switch (type) {
case FieldPropsOccurrence.some: $check = ($data: object) => _.some($data, Boolean); break;
case FieldPropsOccurrence.every: $check = ($data: object) => _.every($data, Boolean); break;
default: throw new Error('Occurrence not found for specified prop');
}
return $check(data);
};
const hasProps = ($type: string, $data: any): boolean => {
let $props;
switch ($type) {
case AllowedFieldPropsTypes.computed:
$props = props.computed;
break;
case AllowedFieldPropsTypes.observable:
$props = [
FieldPropsEnum.fields,
...props.computed,
...props.editable,
];
break;
case AllowedFieldPropsTypes.editable:
$props = [
...props.editable,
...props.validation,
...props.functions,
...props.handlers,
];
break;
case AllowedFieldPropsTypes.all:
$props = [
FieldPropsEnum.id,
FieldPropsEnum.key,
FieldPropsEnum.name,
FieldPropsEnum.path,
...props.computed,
...props.editable,
...props.validation,
...props.functions,
...props.handlers,
];
break;
default:
$props = null;
}
return _.intersection($data, $props).length > 0;
};
/**
Check Allowed Properties
*/
const allowedProps = (type: string, data: string[]): void => {
if (hasProps(type, data)) return;
const $msg = "The selected property is not allowed";
throw new Error(`${$msg} (${JSON.stringify(data)})`);
};
/**
Throw Error if undefined Fields
*/
const throwError = (path: string, fields: any, msg: null | string = null): void => {
if (!_.isNil(fields)) return;
const $msg = _.isNil(msg) ? "The selected field is not defined" : msg;
throw new Error(`${$msg} (${path})`);
};
const pathToStruct = (path: string): string => {
let struct;
struct = _.replace(path, new RegExp("[.]\\d+($|.)", "g"), "[].");
struct = _.replace(struct, "..", ".");
struct = _.trim(struct, ".");
return struct;
};
const isArrayFromStruct = (struct: string[], structPath: string): boolean => {
if (isArrayOfStrings(struct)) return !!struct
.filter((s) => s.startsWith(structPath))
.find((s) => s.substring(structPath.length) === "[]")
|| _.endsWith(struct?.find((e) => e === structPath), '[]');
else return false;
};
const hasSome = (obj: any, keys: any): boolean =>
_.some(keys, _.partial(_.has, obj));
const isEmptyArray = (field: any): boolean =>
_.isEmpty(field) && Array.isArray(field);
const isArrayOfStrings = (struct: any): boolean =>
Array.isArray(struct) && _.every(struct, _.isString);
const isArrayOfObjects = (fields: any): boolean =>
Array.isArray(fields) && _.every(fields, _.isPlainObject);
const getKeys = (fields: any) =>
_.union(..._.map(_.values(fields), (values) => _.keys(values)));
const hasUnifiedProps = ({ fields }: any) =>
!isArrayOfStrings({ fields }) && hasProps(AllowedFieldPropsTypes.editable, getKeys(fields));
const hasSeparatedProps = (initial: any): boolean =>
hasSome(initial, props.separated) || hasSome(initial, props.validation);
const allowNested = (field: any, strictProps: boolean): boolean =>
_.isObject(field) &&
!_.isDate(field) &&
!_.has(field, FieldPropsEnum.fields) &&
!_.has(field, FieldPropsEnum.class) &&
(!hasSome(field, [
...props.editable,
...props.handlers,
...props.validation,
...props.functions,
]) || strictProps);
const parseIntKeys = (fields: any) =>
_.map(getObservableMapKeys(fields), _.ary(_.toNumber, 1));
const hasIntKeys = (fields: any): boolean =>
_.every(parseIntKeys(fields), _.isInteger);
const maxKey = (fields: any): number => {
const max = _.max(parseIntKeys(fields));
return _.isUndefined(max) ? 0 : max + 1;
};
const uniqueId = (field: any): string =>
_.uniqueId([_.replace(field.path, new RegExp("\\.", "g"), "-"), "--"].join(""));
const isEvent = (obj: any): boolean => {
if (_.isNil(obj) || typeof Event === "undefined") return false;
return obj instanceof Event || !_.isNil(obj.target);
};
const hasFiles = ($: any): boolean =>
$.target.files && $.target.files.length !== 0;
const isBool = ($: any, val: any): boolean =>
_.isBoolean(val) && _.isBoolean($.target.checked);
const $try = (...args: any) => {
let found: any | null = null;
args.map(( val: any ) =>
found === null && !_.isUndefined(val) && (found = val));
return found;
};
export {
props,
checkObserve,
checkPropOccurrence,
hasProps,
allowedProps,
throwError,
isArrayOfStrings,
isEmptyArray,
isArrayOfObjects,
pathToStruct,
isArrayFromStruct,
hasUnifiedProps,
hasSeparatedProps,
allowNested,
parseIntKeys,
hasIntKeys,
maxKey,
uniqueId,
isEvent,
hasFiles,
isBool,
$try,
getObservableMapKeys,
getObservableMapValues,
};
``` | /content/code_sandbox/src/utils.ts | xml | 2016-06-20T22:10:41 | 2024-08-10T13:14:33 | mobx-react-form | foxhound87/mobx-react-form | 1,093 | 1,478 |
```xml
/** @jsx jsx */
import { Editor } from 'slate'
import { jsx } from '../../..'
export const input = (
<editor>
<block>one</block>
<block>two</block>
</editor>
)
export const test = editor => {
return Editor.previous(editor, { at: [1] })
}
export const output = [<block>one</block>, [0]]
``` | /content/code_sandbox/packages/slate/test/interfaces/Editor/previous/default.tsx | xml | 2016-06-18T01:52:42 | 2024-08-16T18:43:42 | slate | ianstormtaylor/slate | 29,492 | 88 |
```xml
import type { Disposable } from '../../api/gitlens';
import type { Container } from '../../container';
import type { Repository } from '../../git/models/repository';
export type WorkspaceType = 'cloud' | 'local';
export type WorkspaceAutoAddSetting = 'disabled' | 'enabled' | 'prompt';
export enum WorkspaceRepositoryRelation {
Direct = 'DIRECT',
ProviderProject = 'PROVIDER_PROJECT',
}
export type CodeWorkspaceFileContents = {
folders: { path: string }[];
settings: Record<string, any>;
};
export type WorkspaceRepositoriesByName = Map<string, RepositoryMatch>;
export interface RepositoryMatch {
repository: Repository;
descriptor: CloudWorkspaceRepositoryDescriptor | LocalWorkspaceRepositoryDescriptor;
}
export interface RemoteDescriptor {
provider: string;
owner: string;
repoName: string;
url?: string;
}
export interface GetWorkspacesResponse {
cloudWorkspaces: CloudWorkspace[];
localWorkspaces: LocalWorkspace[];
cloudWorkspaceInfo: string | undefined;
localWorkspaceInfo: string | undefined;
}
export interface LoadCloudWorkspacesResponse {
cloudWorkspaces: CloudWorkspace[] | undefined;
cloudWorkspaceInfo: string | undefined;
}
export interface LoadLocalWorkspacesResponse {
localWorkspaces: LocalWorkspace[] | undefined;
localWorkspaceInfo: string | undefined;
}
export interface GetCloudWorkspaceRepositoriesResponse {
repositories: CloudWorkspaceRepositoryDescriptor[] | undefined;
repositoriesInfo: string | undefined;
}
// Cloud Workspace types
export class CloudWorkspace {
readonly type = 'cloud' satisfies WorkspaceType;
private _repositoryDescriptors: CloudWorkspaceRepositoryDescriptor[] | undefined;
private _repositoriesByName: WorkspaceRepositoriesByName | undefined;
private _localPath: string | undefined;
private _disposable: Disposable;
constructor(
private readonly container: Container,
public readonly id: string,
public readonly name: string,
public readonly organizationId: string | undefined,
public readonly provider: CloudWorkspaceProviderType,
public readonly repoRelation: WorkspaceRepositoryRelation,
public readonly current: boolean,
public readonly azureInfo?: {
organizationId?: string;
project?: string;
},
repositories?: CloudWorkspaceRepositoryDescriptor[],
localPath?: string,
) {
this._repositoryDescriptors = repositories;
this._localPath = localPath;
this._disposable = this.container.git.onDidChangeRepositories(this.resetRepositoriesByName, this);
}
dispose() {
this._disposable.dispose();
}
get shared(): boolean {
return this.organizationId != null;
}
get localPath(): string | undefined {
return this._localPath;
}
resetRepositoriesByName() {
this._repositoriesByName = undefined;
}
async getRepositoriesByName(options?: { force?: boolean }): Promise<WorkspaceRepositoriesByName> {
if (this._repositoriesByName == null || options?.force) {
this._repositoriesByName = await this.container.workspaces.resolveWorkspaceRepositoriesByName(this.id, {
resolveFromPath: true,
usePathMapping: true,
});
}
return this._repositoriesByName;
}
async getRepositoryDescriptors(options?: { force?: boolean }): Promise<CloudWorkspaceRepositoryDescriptor[]> {
if (this._repositoryDescriptors == null || options?.force) {
this._repositoryDescriptors = await this.container.workspaces.getCloudWorkspaceRepositories(this.id);
this.resetRepositoriesByName();
}
return this._repositoryDescriptors;
}
async getRepositoryDescriptor(name: string): Promise<CloudWorkspaceRepositoryDescriptor | undefined> {
return (await this.getRepositoryDescriptors()).find(r => r.name === name);
}
// TODO@axosoft-ramint this should be the entry point, not a backdoor to update the cache
addRepositories(repositories: CloudWorkspaceRepositoryDescriptor[]): void {
if (this._repositoryDescriptors == null) {
this._repositoryDescriptors = repositories;
} else {
this._repositoryDescriptors = this._repositoryDescriptors.concat(repositories);
}
this.resetRepositoriesByName();
}
// TODO@axosoft-ramint this should be the entry point, not a backdoor to update the cache
removeRepositories(repoNames: string[]): void {
if (this._repositoryDescriptors == null) return;
this._repositoryDescriptors = this._repositoryDescriptors.filter(r => !repoNames.includes(r.name));
this.resetRepositoriesByName();
}
setLocalPath(localPath: string | undefined): void {
this._localPath = localPath;
}
}
export interface CloudWorkspaceRepositoryDescriptor {
id: string;
name: string;
description: string;
repository_id: string;
provider: CloudWorkspaceProviderType | null;
provider_project_name: string | null;
provider_organization_id: string;
provider_organization_name: string | null;
url: string | null;
workspaceId: string;
}
export enum CloudWorkspaceProviderInputType {
GitHub = 'GITHUB',
GitHubEnterprise = 'GITHUB_ENTERPRISE',
GitLab = 'GITLAB',
GitLabSelfHosted = 'GITLAB_SELF_HOSTED',
Bitbucket = 'BITBUCKET',
Azure = 'AZURE',
}
export enum CloudWorkspaceProviderType {
GitHub = 'github',
GitHubEnterprise = 'github_enterprise',
GitLab = 'gitlab',
GitLabSelfHosted = 'gitlab_self_hosted',
Bitbucket = 'bitbucket',
Azure = 'azure',
}
export const cloudWorkspaceProviderTypeToRemoteProviderId = {
[CloudWorkspaceProviderType.Azure]: 'azure-devops',
[CloudWorkspaceProviderType.Bitbucket]: 'bitbucket',
[CloudWorkspaceProviderType.GitHub]: 'github',
[CloudWorkspaceProviderType.GitHubEnterprise]: 'github',
[CloudWorkspaceProviderType.GitLab]: 'gitlab',
[CloudWorkspaceProviderType.GitLabSelfHosted]: 'gitlab',
};
export const cloudWorkspaceProviderInputTypeToRemoteProviderId = {
[CloudWorkspaceProviderInputType.Azure]: 'azure-devops',
[CloudWorkspaceProviderInputType.Bitbucket]: 'bitbucket',
[CloudWorkspaceProviderInputType.GitHub]: 'github',
[CloudWorkspaceProviderInputType.GitHubEnterprise]: 'github',
[CloudWorkspaceProviderInputType.GitLab]: 'gitlab',
[CloudWorkspaceProviderInputType.GitLabSelfHosted]: 'gitlab',
};
export enum WorkspaceAddRepositoriesChoice {
CurrentWindow = 'Current Window',
ParentFolder = 'Parent Folder',
}
export const defaultWorkspaceCount = 100;
export const defaultWorkspaceRepoCount = 100;
export interface CloudWorkspaceData {
id: string;
name: string;
description: string;
type: CloudWorkspaceType;
icon_url: string | null;
host_url: string;
status: string;
provider: string;
repo_relation: string;
azure_organization_id: string | null;
azure_project: string | null;
created_date: Date;
updated_date: Date;
created_by: string;
updated_by: string;
members: CloudWorkspaceMember[];
organization: CloudWorkspaceOrganization;
issue_tracker: CloudWorkspaceIssueTracker;
settings: CloudWorkspaceSettings;
current_user: UserCloudWorkspaceSettings;
errors: string[];
provider_data: ProviderCloudWorkspaceData;
}
export type CloudWorkspaceType = 'GK_PROJECT' | 'GK_ORG_VELOCITY' | 'GK_CLI';
export interface CloudWorkspaceMember {
id: string;
role: string;
name: string;
username: string;
avatar_url: string;
}
interface CloudWorkspaceOrganization {
id: string;
team_ids: string[];
}
interface CloudWorkspaceIssueTracker {
provider: string;
settings: CloudWorkspaceIssueTrackerSettings;
}
interface CloudWorkspaceIssueTrackerSettings {
resource_id: string;
}
interface CloudWorkspaceSettings {
gkOrgVelocity: GKOrgVelocitySettings;
goals: ProjectGoalsSettings;
}
type GKOrgVelocitySettings = Record<string, unknown>;
type ProjectGoalsSettings = Record<string, unknown>;
interface UserCloudWorkspaceSettings {
project_id: string;
user_id: string;
tab_settings: UserCloudWorkspaceTabSettings;
}
interface UserCloudWorkspaceTabSettings {
issue_tracker: CloudWorkspaceIssueTracker;
}
export interface ProviderCloudWorkspaceData {
id: string;
provider_organization_id: string;
repository: CloudWorkspaceRepositoryData;
repositories: CloudWorkspaceConnection<CloudWorkspaceRepositoryData>;
pull_requests: CloudWorkspacePullRequestData[];
issues: CloudWorkspaceIssue[];
repository_members: CloudWorkspaceRepositoryMemberData[];
milestones: CloudWorkspaceMilestone[];
labels: CloudWorkspaceLabel[];
issue_types: CloudWorkspaceIssueType[];
provider_identity: ProviderCloudWorkspaceIdentity;
metrics: ProviderCloudWorkspaceMetrics;
}
type ProviderCloudWorkspaceMetrics = Record<string, unknown>;
interface ProviderCloudWorkspaceIdentity {
avatar_url: string;
id: string;
name: string;
username: string;
pat_organization: string;
is_using_pat: boolean;
scopes: string;
}
export interface Branch {
id: string;
node_id: string;
name: string;
commit: BranchCommit;
}
interface BranchCommit {
id: string;
url: string;
build_status: {
context: string;
state: string;
description: string;
};
}
export interface CloudWorkspaceRepositoryData {
id: string;
name: string;
description: string;
repository_id: string;
provider: CloudWorkspaceProviderType | null;
provider_project_name: string | null;
provider_organization_id: string;
provider_organization_name: string | null;
url: string | null;
default_branch: string;
branches: Branch[];
pull_requests: CloudWorkspacePullRequestData[];
issues: CloudWorkspaceIssue[];
members: CloudWorkspaceRepositoryMemberData[];
milestones: CloudWorkspaceMilestone[];
labels: CloudWorkspaceLabel[];
issue_types: CloudWorkspaceIssueType[];
possibly_deleted: boolean;
has_webhook: boolean;
}
interface CloudWorkspaceRepositoryMemberData {
avatar_url: string;
name: string;
node_id: string;
username: string;
}
type CloudWorkspaceMilestone = Record<string, unknown>;
type CloudWorkspaceLabel = Record<string, unknown>;
type CloudWorkspaceIssueType = Record<string, unknown>;
export interface CloudWorkspacePullRequestData {
id: string;
node_id: string;
number: string;
title: string;
description: string;
url: string;
milestone_id: string;
labels: CloudWorkspaceLabel[];
author_id: string;
author_username: string;
created_date: Date;
updated_date: Date;
closed_date: Date;
merged_date: Date;
first_commit_date: Date;
first_response_date: Date;
comment_count: number;
repository: CloudWorkspaceRepositoryData;
head_commit: {
id: string;
url: string;
build_status: {
context: string;
state: string;
description: string;
};
};
lifecycle_stages: {
stage: string;
start_date: Date;
end_date: Date;
}[];
reviews: CloudWorkspacePullRequestReviews[];
head: {
name: string;
};
}
interface CloudWorkspacePullRequestReviews {
user_id: string;
avatar_url: string;
state: string;
}
export interface CloudWorkspaceIssue {
id: string;
node_id: string;
title: string;
author_id: string;
assignee_ids: string[];
milestone_id: string;
label_ids: string[];
issue_type: string;
url: string;
created_date: Date;
updated_date: Date;
comment_count: number;
repository: CloudWorkspaceRepositoryData;
}
export interface CloudWorkspaceConnection<i> {
total_count: number;
page_info: {
start_cursor: string;
end_cursor: string;
has_next_page: boolean;
};
nodes: i[];
}
interface CloudWorkspaceFetchedConnection<i> extends CloudWorkspaceConnection<i> {
is_fetching: boolean;
}
export interface WorkspaceResponse {
data: {
project: CloudWorkspaceData;
};
}
export interface WorkspacesResponse {
data: {
projects: CloudWorkspaceConnection<CloudWorkspaceData>;
};
}
export interface WorkspaceRepositoriesResponse {
data: {
project: {
provider_data: {
repositories: CloudWorkspaceConnection<CloudWorkspaceRepositoryData>;
};
};
};
}
export interface WorkspacePullRequestsResponse {
data: {
project: {
provider_data: {
pull_requests: CloudWorkspaceFetchedConnection<CloudWorkspacePullRequestData>;
};
};
};
}
export interface WorkspacesWithPullRequestsResponse {
data: {
projects: {
nodes: {
provider_data: {
pull_requests: CloudWorkspaceFetchedConnection<CloudWorkspacePullRequestData>;
};
}[];
};
};
errors?: {
message: string;
path: unknown[];
statusCode: number;
}[];
}
export interface WorkspaceIssuesResponse {
data: {
project: {
provider_data: {
issues: CloudWorkspaceFetchedConnection<CloudWorkspaceIssue>;
};
};
};
}
export interface CreateWorkspaceResponse {
data: {
create_project: CloudWorkspaceData | null;
};
}
export interface DeleteWorkspaceResponse {
data: {
delete_project: CloudWorkspaceData | null;
};
errors?: { code: number; message: string }[];
}
export type AddRepositoriesToWorkspaceResponse = {
data: {
add_repositories_to_project: {
id: string;
provider_data: Record<string, CloudWorkspaceRepositoryData>;
} | null;
};
errors?: { code: number; message: string }[];
};
export interface RemoveRepositoriesFromWorkspaceResponse {
data: {
remove_repositories_from_project: {
id: string;
} | null;
};
errors?: { code: number; message: string }[];
}
export interface AddWorkspaceRepoDescriptor {
owner: string;
repoName: string;
}
// TODO@ramint Switch to using repo id once that is no longer bugged
export interface RemoveWorkspaceRepoDescriptor {
owner: string;
repoName: string;
}
// Local Workspace Types
export class LocalWorkspace {
readonly type = 'local' satisfies WorkspaceType;
private _localPath: string | undefined;
private _repositoriesByName: WorkspaceRepositoriesByName | undefined;
private _disposable: Disposable;
constructor(
public readonly container: Container,
public readonly id: string,
public readonly name: string,
private readonly repositoryDescriptors: LocalWorkspaceRepositoryDescriptor[],
public readonly current: boolean,
localPath?: string,
) {
this._localPath = localPath;
this._disposable = this.container.git.onDidChangeRepositories(this.resetRepositoriesByName, this);
}
dispose() {
this._disposable.dispose();
}
get shared(): boolean {
return false;
}
get localPath(): string | undefined {
return this._localPath;
}
resetRepositoriesByName() {
this._repositoriesByName = undefined;
}
async getRepositoriesByName(options?: { force?: boolean }): Promise<WorkspaceRepositoriesByName> {
if (this._repositoriesByName == null || options?.force) {
this._repositoriesByName = await this.container.workspaces.resolveWorkspaceRepositoriesByName(this.id, {
resolveFromPath: true,
usePathMapping: true,
});
}
return this._repositoriesByName;
}
getRepositoryDescriptors(): Promise<LocalWorkspaceRepositoryDescriptor[]> {
return Promise.resolve(this.repositoryDescriptors);
}
getRepositoryDescriptor(name: string): Promise<LocalWorkspaceRepositoryDescriptor | undefined> {
return Promise.resolve(this.repositoryDescriptors.find(r => r.name === name));
}
setLocalPath(localPath: string | undefined): void {
this._localPath = localPath;
}
}
export interface LocalWorkspaceFileData {
workspaces: LocalWorkspaceData;
}
export type LocalWorkspaceData = Record<string, LocalWorkspaceDescriptor>;
export interface LocalWorkspaceDescriptor {
localId: string;
profileId: string;
name: string;
description: string;
repositories: LocalWorkspaceRepositoryPath[];
version: number;
}
export interface LocalWorkspaceRepositoryPath {
localPath: string;
}
export interface LocalWorkspaceRepositoryDescriptor extends LocalWorkspaceRepositoryPath {
id?: undefined;
name: string;
workspaceId: string;
}
export interface CloudWorkspaceFileData {
workspaces: CloudWorkspacesPathMap;
}
export type CloudWorkspacesPathMap = Record<string, CloudWorkspacePaths>;
export interface CloudWorkspacePaths {
repoPaths: CloudWorkspaceRepoPathMap;
externalLinks: CloudWorkspaceExternalLinkMap;
}
export type CloudWorkspaceRepoPathMap = Record<string, string>;
export type CloudWorkspaceExternalLinkMap = Record<string, string>;
``` | /content/code_sandbox/src/plus/workspaces/models.ts | xml | 2016-08-08T14:50:30 | 2024-08-15T21:25:09 | vscode-gitlens | gitkraken/vscode-gitlens | 8,889 | 3,486 |
```xml
import React from 'react';
import { Avatar, VStack, Center } from 'native-base';
export const Example = () => {
return (
<Center>
<VStack space={2} alignItems={{ base: 'center', md: 'flex-start' }}>
<Avatar
bg="green.500"
alignSelf="center"
size="xs"
source={{
uri:
'path_to_url
}}
>
AJ
</Avatar>
<Avatar
bg="cyan.500"
alignSelf="center"
size="sm"
source={{
uri:
'path_to_url
}}
>
HS
</Avatar>
<Avatar
bg="indigo.500"
alignSelf="center"
size="md"
source={{
uri:
'path_to_url
}}
>
RS
</Avatar>
<Avatar
alignSelf="center"
bg="amber.500"
size="lg"
source={{
uri:
'path_to_url
}}
>
AK
</Avatar>
<Avatar
bg="pink.600"
alignSelf="center"
size="xl"
source={{
uri:
'path_to_url
}}
>
GG
</Avatar>
<Avatar
bg="purple.600"
alignSelf="center"
size="2xl"
source={{
uri:
'path_to_url
}}
>
RB
</Avatar>
</VStack>
</Center>
);
};
``` | /content/code_sandbox/example/storybook/stories/components/composites/Avatar/size.tsx | xml | 2016-04-15T11:37:23 | 2024-08-14T16:16:44 | NativeBase | GeekyAnts/NativeBase | 20,132 | 334 |
```xml
a = (b?) => c;
``` | /content/code_sandbox/tests/format/typescript/arrows/arrow_function_expression.ts | xml | 2016-11-29T17:13:37 | 2024-08-16T17:29:57 | prettier | prettier/prettier | 48,913 | 9 |
```xml
import { name } from './name-column';
import { teamRole } from './team-role-column';
export const columns = [name, teamRole];
``` | /content/code_sandbox/app/react/portainer/users/teams/ItemView/TeamAssociationSelector/TeamMembersList/columns/index.ts | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 31 |
```xml
import { PushTokenManagerModule } from './PushTokenManager.types';
declare const _default: PushTokenManagerModule;
export default _default;
//# sourceMappingURL=PushTokenManager.native.d.ts.map
``` | /content/code_sandbox/packages/expo-notifications/build/PushTokenManager.native.d.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 40 |
```xml
import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
width: 244,
height: 244,
});
chart
.data([
{
name: 'activity1',
percent: 0.6,
color: '#1ad5de',
icon: 'path_to_url
},
{
name: 'activity2',
percent: 0.2,
color: '#a0ff03',
icon: 'path_to_url
},
{
name: 'activity3',
percent: 0.3,
color: '#e90b3a',
icon: 'path_to_url
},
])
.coordinate({ type: 'radial', innerRadius: 0.2 });
chart
.interval()
.encode('x', 'name')
.encode('y', 1)
.encode('size', 52)
.encode('color', 'color')
.scale('color', { type: 'identity' })
.style('fillOpacity', 0.25)
.animate(false);
chart
.interval()
.encode('x', 'name')
.encode('y', 'percent')
.encode('color', 'color')
.encode('size', 52)
.style('radius', 26)
.style('shadowColor', 'rgba(0,0,0,0.45)')
.style('shadowBlur', 20)
.style('shadowOffsetX', -2)
.style('shadowOffsetY', -5)
.axis(false)
.animate('enter', {
type: 'waveIn',
easing: 'easing-out-bounce',
duration: 1000,
});
chart
.image()
.encode('x', 'name')
.encode('y', 0)
.encode('src', (d) => d.icon)
.encode('size', 12)
.style('transform', 'translateX(10)');
chart.render();
``` | /content/code_sandbox/site/examples/general/radial/demo/apple-activity.ts | xml | 2016-05-26T09:21:04 | 2024-08-15T16:11:17 | G2 | antvis/G2 | 12,060 | 447 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--
~
~
~ path_to_url
~
~ Unless required by applicable law or agreed to in writing, software
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-->
<resources>
<style name="Base.V21.ThemeOverlay.Material3.SideSheetDialog"
parent="Base.V14.ThemeOverlay.Material3.SideSheetDialog">
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="Base.ThemeOverlay.Material3.SideSheetDialog" parent="Base.V21.ThemeOverlay.Material3.SideSheetDialog"/>
</resources>
``` | /content/code_sandbox/lib/java/com/google/android/material/sidesheet/res/values-v21/themes_base.xml | xml | 2016-12-05T16:11:29 | 2024-08-16T17:51:42 | material-components-android | material-components/material-components-android | 16,176 | 149 |
```xml
/**
* @jest-environment node
*/
import { NextRequest } from "next/server"
import axios from "axios"
import { GET } from "./route"
jest.mock("axios")
const mockedAxios = axios as jest.Mocked<typeof axios>
describe("Metadata Fetcher", () => {
beforeEach(() => {
jest.clearAllMocks()
})
it("should return metadata when URL is valid", async () => {
const mockHtml = `
<html>
<head>
<title>Test Title</title>
<meta name="description" content="Test Description">
<link rel="icon" href="/favicon.ico">
</head>
</html>
`
mockedAxios.get.mockResolvedValue({ data: mockHtml })
const req = {
url: process.env.NEXT_PUBLIC_APP_URL + "/api/metadata?url=path_to_url"
} as unknown as NextRequest
const response = await GET(req)
const data = await response.json()
expect(response.status).toBe(200)
expect(data).toEqual({
title: "Test Title",
description: "Test Description",
favicon: "path_to_url",
url: "path_to_url"
})
})
it("should return an error when URL is missing", async () => {
const req = {
url: process.env.NEXT_PUBLIC_APP_URL + "/api/metadata"
} as unknown as NextRequest
const response = await GET(req)
const data = await response.json()
expect(response.status).toBe(400)
expect(data).toEqual({ error: "URL is required" })
})
it("should return default values when fetching fails", async () => {
mockedAxios.get.mockRejectedValue(new Error("Network error"))
const req = {
url: process.env.NEXT_PUBLIC_APP_URL + "/api/metadata?url=path_to_url"
} as unknown as NextRequest
const response = await GET(req)
const data = await response.json()
expect(response.status).toBe(200)
expect(data).toEqual({
title: "No title available",
description: "No description available",
favicon: null,
url: "path_to_url"
})
})
it("should handle missing metadata gracefully", async () => {
const mockHtml = `
<html>
<head>
</head>
</html>
`
mockedAxios.get.mockResolvedValue({ data: mockHtml })
const req = {
url: process.env.NEXT_PUBLIC_APP_URL + "/api/metadata?url=path_to_url"
} as unknown as NextRequest
const response = await GET(req)
const data = await response.json()
expect(response.status).toBe(200)
expect(data).toEqual({
title: "No title available",
description: "No description available",
favicon: null,
url: "path_to_url"
})
})
})
``` | /content/code_sandbox/web/app/api/metadata/route.test.ts | xml | 2016-08-08T16:09:17 | 2024-08-16T16:23:04 | learn-anything.xyz | learn-anything/learn-anything.xyz | 15,943 | 631 |
```xml
import { Listbox as L, Transition } from '@headlessui/react';
import { CheckIcon, ChevronUpDownIcon } from '@heroicons/react/20/solid';
import { Fragment } from 'react';
import { ISelectable } from '~/types/Selectable';
import { cls } from '~/utils/helpers';
type ListBoxProps<T extends ISelectable> = {
id: string;
name: string;
values?: T[];
selected: T;
setSelected?: (v: T) => void;
disabled?: boolean;
className?: string;
};
export default function Listbox<T extends ISelectable>(props: ListBoxProps<T>) {
const { id, name, values, selected, setSelected, disabled, className } =
props;
return (
<L
as="div"
name={name}
className={className}
value={selected}
by="key"
onChange={(v: T) => {
setSelected && setSelected(v);
}}
disabled={disabled}
>
{({ open }) => (
<>
<div className="relative mt-2">
<L.Button
className={cls(
'text-gray-900 relative w-full cursor-default rounded-md px-2 py-2 pl-3 pr-10 text-left focus:outline-none sm:text-sm sm:leading-6',
{
'bg-gray-100': disabled,
'bg-gray-50 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-1 focus:ring-violet-600':
!disabled
}
)}
id={`${id}-select-button`}
>
<div className="flex items-center">
<span className="text-gray-600 block truncate font-medium">
{selected?.displayValue}
</span>
{!disabled && (
<span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronUpDownIcon
className="text-gray-400 h-5 w-5"
aria-hidden="true"
/>
</span>
)}
</div>
</L.Button>
<Transition
show={open}
as={Fragment}
leave="transition ease-in duration-100"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<L.Options
className="bg-gray-50 absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm"
id={`${id}-select-options`}
>
{values?.map((v) => (
<L.Option
key={v.key}
className={({ active }) =>
cls(
'text-gray-900 relative cursor-default select-none py-2 pl-3 pr-9',
{
'text-white bg-violet-300': active
}
)
}
value={v}
>
{({ selected, active }) => (
<>
<span
className={cls('block truncate font-normal', {
'font-semibold': selected
})}
>
{v.displayValue}
</span>
{selected ? (
<span
className={cls(
'text-violet-600 absolute inset-y-0 right-0 flex items-center pr-4',
{
'text-white': active
}
)}
>
<CheckIcon className="h-5 w-5" aria-hidden="true" />
</span>
) : null}
</>
)}
</L.Option>
))}
</L.Options>
</Transition>
</div>
</>
)}
</L>
);
}
``` | /content/code_sandbox/ui/src/components/forms/Listbox.tsx | xml | 2016-11-05T00:09:07 | 2024-08-16T13:44:10 | flipt | flipt-io/flipt | 3,489 | 789 |
```xml
import * as React from 'react';
import createSvgIcon from '../utils/createSvgIcon';
const Uneditable2MirroredIcon = createSvgIcon({
svg: ({ classes }) => (
<svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false">
<path d="M2048 2048l-633-158-583-583-723 722-90-90L1939 19l90 90-722 723 583 583 158 633zm-505-258l329 82-82-329q-47 10-87 32t-73 55-55 73-32 87zm-327-867l-293 293 505 506q16-52 44-98t67-85 84-66 99-45l-506-505zM0 336q0-70 26-131T98 99t107-72T335 0q67 0 128 25t110 73l530 531-90 90-373-372-293 293 372 373-90 90L98 573q-48-48-73-109T0 336zm128 0q0 38 10 66t29 53 41 47 48 47l293-293q-25-25-47-48t-46-41-54-28-67-11q-43 0-80 16t-66 45-44 66-17 81z" />
</svg>
),
displayName: 'Uneditable2MirroredIcon',
});
export default Uneditable2MirroredIcon;
``` | /content/code_sandbox/packages/react-icons-mdl2/src/components/Uneditable2MirroredIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 373 |
```xml
#include "QMacSpinningProgressIndicator.h"
#import "Foundation/NSAutoreleasePool.h"
#import "AppKit/NSProgressIndicator.h"
#include <QDateTime>
#include <QHBoxLayout>
#include <QMacCocoaViewContainer>
class QMacSpinningProgressIndicatorPrivate : public QObject
{
public:
QMacSpinningProgressIndicatorPrivate(QMacSpinningProgressIndicator *qProgressIndicatorSpinning,
NSProgressIndicator *nsProgressIndicator)
: QObject(qProgressIndicatorSpinning), nsProgressIndicator(nsProgressIndicator) {}
~QMacSpinningProgressIndicatorPrivate()
{
[nsProgressIndicator release];
}
NSProgressIndicator *nsProgressIndicator;
};
QMacSpinningProgressIndicator::QMacSpinningProgressIndicator(QWidget *parent)
: QWidget(parent), startTime(0)
{
@autoreleasepool {
NSProgressIndicator *progress = [[NSProgressIndicator alloc] init];
[progress setStyle:NSProgressIndicatorSpinningStyle];
pImpl.reset(new QMacSpinningProgressIndicatorPrivate(this, progress));
parent->setAttribute(Qt::WA_NativeWindow);
QHBoxLayout* layout = new QHBoxLayout(parent);
layout->setMargin(0);
layout->addWidget(new QMacCocoaViewContainer(progress, parent));
}
}
QMacSpinningProgressIndicator::~QMacSpinningProgressIndicator()
{
}
void QMacSpinningProgressIndicator::animate(bool animate)
{
assert(pImpl);
if (!pImpl)
{
return;
}
if (animate)
{
[pImpl->nsProgressIndicator startAnimation:nil];
startTime = QDateTime::currentMSecsSinceEpoch();
}
else
{
[pImpl->nsProgressIndicator stopAnimation:nil];
startTime = 0;
}
}
void QMacSpinningProgressIndicator::start()
{
animate(true);
}
void QMacSpinningProgressIndicator::stop()
{
animate(false);
}
qint64 QMacSpinningProgressIndicator::getStartTime() const
{
return startTime;
}
``` | /content/code_sandbox/src/MEGASync/gui/QMacSpinningProgressIndicator.mm | xml | 2016-02-10T18:28:05 | 2024-08-16T19:36:44 | MEGAsync | meganz/MEGAsync | 1,593 | 420 |
```xml
///
///
///
/// path_to_url
///
/// Unless required by applicable law or agreed to in writing, software
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
///
import { Component, forwardRef, Input, OnInit } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import {
BooleanOperation,
EntityKeyValueType,
KeyFilterPredicateUserInfo, NumericOperation,
StringOperation
} from '@shared/models/query/query.models';
import { MatDialog } from '@angular/material/dialog';
import {
FilterUserInfoDialogComponent,
FilterUserInfoDialogData
} from '@home/components/filter/filter-user-info-dialog.component';
import { deepClone } from '@core/utils';
@Component({
selector: 'tb-filter-user-info',
templateUrl: './filter-user-info.component.html',
styleUrls: [],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => FilterUserInfoComponent),
multi: true
}
]
})
export class FilterUserInfoComponent implements ControlValueAccessor, OnInit {
@Input() disabled: boolean;
@Input() key: string;
@Input() operation: StringOperation | BooleanOperation | NumericOperation;
@Input() valueType: EntityKeyValueType;
private propagateChange = null;
private keyFilterPredicateUserInfo: KeyFilterPredicateUserInfo;
constructor(private dialog: MatDialog) {
}
ngOnInit(): void {
}
registerOnChange(fn: any): void {
this.propagateChange = fn;
}
registerOnTouched(fn: any): void {
}
setDisabledState?(isDisabled: boolean): void {
this.disabled = isDisabled;
}
writeValue(keyFilterPredicateUserInfo: KeyFilterPredicateUserInfo): void {
this.keyFilterPredicateUserInfo = keyFilterPredicateUserInfo;
}
public openFilterUserInfoDialog() {
this.dialog.open<FilterUserInfoDialogComponent, FilterUserInfoDialogData,
KeyFilterPredicateUserInfo>(FilterUserInfoDialogComponent, {
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
keyFilterPredicateUserInfo: deepClone(this.keyFilterPredicateUserInfo),
valueType: this.valueType,
key: this.key,
operation: this.operation,
readonly: this.disabled
}
}).afterClosed().subscribe(
(result) => {
if (result) {
this.keyFilterPredicateUserInfo = result;
this.updateModel();
}
}
);
}
private updateModel() {
this.propagateChange(this.keyFilterPredicateUserInfo);
}
}
``` | /content/code_sandbox/ui-ngx/src/app/modules/home/components/filter/filter-user-info.component.ts | xml | 2016-12-01T09:33:30 | 2024-08-16T19:58:25 | thingsboard | thingsboard/thingsboard | 16,820 | 544 |
```xml
import { validation } from './validation';
import { toRequest } from './toRequest';
import { toViewModel, getDefaultViewModel } from './toViewModel';
export { NetworkTab } from './NetworkTab';
export { type Values as NetworkTabValues } from './types';
export const networkTabUtils = {
toRequest,
toViewModel,
validation,
getDefaultViewModel,
};
``` | /content/code_sandbox/app/react/docker/containers/CreateView/NetworkTab/index.ts | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 78 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Diagnostics.Debug</name>
</assembly>
<members>
<member name="T:System.Diagnostics.Debug">
<summary>Stellt eine Reihe von Methoden und Eigenschaften zum Debuggen von Code bereit.Diese Klasse kann nicht vererbt werden.</summary>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.Debug.Assert(System.Boolean)">
<summary>berprft eine Bedingung. Wenn die Bedingung false ist, wird ein Meldungsfeld mit der Aufrufliste angezeigt.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, wird keine Fehlermeldung gesendet und kein Meldungsfeld angezeigt.</param>
<filterpriority>1</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.Assert(System.Boolean,System.String)">
<summary>berprft eine Bedingung. Wenn die Bedingung false ist, wird eine bestimmte Meldung ausgegeben, und ein Meldungsfeld mit der Aufrufliste wird angezeigt.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, wird keine Meldung gesendet und kein Meldungsfeld angezeigt.</param>
<param name="message">Die Nachricht, die an die <see cref="P:System.Diagnostics.Trace.Listeners" />-Auflistung gesendet werden soll. </param>
<filterpriority>1</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.Assert(System.Boolean,System.String,System.String)">
<summary>berprft eine Bedingung. Wenn die Bedingung false ist, werden zwei angegebene Meldungen ausgegeben, und ein Meldungsfeld mit der Aufrufliste wird angezeigt.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, werden die angegebenen Meldungen nicht gesendet, und das Meldungsfeld wird nicht angezeigt.</param>
<param name="message">Die Nachricht, die an die <see cref="P:System.Diagnostics.Trace.Listeners" />-Auflistung gesendet werden soll. </param>
<param name="detailMessage">Die detaillierte Nachricht, die an die <see cref="P:System.Diagnostics.Trace.Listeners" />-Auflistung gesendet werden soll. </param>
<filterpriority>1</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.Assert(System.Boolean,System.String,System.String,System.Object[])">
<summary>berprft eine Bedingung. Wenn die Bedingung false ist, werden zwei angegebene Meldungen (einfach und formatiert) ausgegeben, und ein Meldungsfeld mit der Aufrufliste wird angezeigt.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, werden die angegebenen Meldungen nicht gesendet, und das Meldungsfeld wird nicht angezeigt.</param>
<param name="message">Die Nachricht, die an die <see cref="P:System.Diagnostics.Trace.Listeners" />-Auflistung gesendet werden soll. </param>
<param name="detailMessageFormat">Die zusammengesetzte Formatzeichenfolge (siehe "Hinweise"), die an die <see cref="P:System.Diagnostics.Trace.Listeners" />-Auflistung gesendet werden soll.Diese Meldung enthlt Text und optional ein oder mehrere Formatelemente, die Objekten im <paramref name="args" />-Array entsprechen.</param>
<param name="args">Ein Objektarray mit 0 (null) oder mehr zu formatierenden Objekten.</param>
</member>
<member name="M:System.Diagnostics.Debug.Fail(System.String)">
<summary>Gibt die angegebene Fehlermeldung aus.</summary>
<param name="message">Eine auszugebende Meldung. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.Fail(System.String,System.String)">
<summary>Gibt eine Fehlermeldung und eine detaillierte Fehlermeldung aus.</summary>
<param name="message">Eine auszugebende Meldung. </param>
<param name="detailMessage">Eine detaillierte Meldung, die ausgegeben werden soll. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.Write(System.Object)">
<summary>Schreibt den Wert der <see cref="M:System.Object.ToString" />-Methode des Objekts in die Ablaufverfolgungswachungen in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="value">Ein Objekt, dessen Name an die <see cref="P:System.Diagnostics.Debug.Listeners" /> gesendet wird. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.Write(System.Object,System.String)">
<summary>Schreibt einen Kategorienamen und den Wert der <see cref="M:System.Object.ToString" />-Methode des Objekts in die Ablaufverfolgungsberwachungen in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="value">Ein Objekt, dessen Name an die <see cref="P:System.Diagnostics.Debug.Listeners" /> gesendet wird. </param>
<param name="category">Ein Kategoriename fr die Anordnung der Ausgabe. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.Write(System.String)">
<summary>Schreibt eine Meldung in die Ablaufverfolgungsberwachungen in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="message">Eine zu schreibende Meldung. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.Write(System.String,System.String)">
<summary>Schreibt einen Kategorienamen und eine Meldung in die Ablaufverfolgungsberwachungen in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="message">Eine zu schreibende Meldung. </param>
<param name="category">Ein Kategoriename fr die Anordnung der Ausgabe. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteIf(System.Boolean,System.Object)">
<summary>Schreibt den Wert der <see cref="M:System.Object.ToString" />-Methode des Objekts in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung, wenn eine Bedingung true ist.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, wird der Wert in die Ablaufverfolgungslistener in der Auflistung geschrieben.</param>
<param name="value">Ein Objekt, dessen Name an die <see cref="P:System.Diagnostics.Debug.Listeners" /> gesendet wird. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteIf(System.Boolean,System.Object,System.String)">
<summary>Schreibt einen Kategorienamen und den Wert der <see cref="M:System.Object.ToString" />-Methode des Objekts in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung, wenn eine Bedingung true ist.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, werden der Kategoriename und der Wert in die Ablaufverfolgungslistener in der Auflistung geschrieben.</param>
<param name="value">Ein Objekt, dessen Name an die <see cref="P:System.Diagnostics.Debug.Listeners" /> gesendet wird. </param>
<param name="category">Ein Kategoriename fr die Anordnung der Ausgabe. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteIf(System.Boolean,System.String)">
<summary>Schreibt eine Meldung in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung, wenn eine Bedingung true ist.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, wird die Meldung in die Ablaufverfolgungslistener in der Auflistung geschrieben.</param>
<param name="message">Eine zu schreibende Meldung. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteIf(System.Boolean,System.String,System.String)">
<summary>Schreibt einen Kategorienamen und eine Meldung in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung, wenn eine Bedingung true ist.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, werden der Kategoriename und die Meldung in die Ablaufverfolgungslistener in der Auflistung geschrieben.</param>
<param name="message">Eine zu schreibende Meldung. </param>
<param name="category">Ein Kategoriename fr die Anordnung der Ausgabe. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteLine(System.Object)">
<summary>Schreibt den Wert der <see cref="M:System.Object.ToString" />-Methode des Objekts in die Ablaufverfolgungswachungen in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="value">Ein Objekt, dessen Name an die <see cref="P:System.Diagnostics.Debug.Listeners" /> gesendet wird. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteLine(System.Object,System.String)">
<summary>Schreibt einen Kategorienamen und den Wert der <see cref="M:System.Object.ToString" />-Methode des Objekts in die Ablaufverfolgungsberwachungen in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="value">Ein Objekt, dessen Name an die <see cref="P:System.Diagnostics.Debug.Listeners" /> gesendet wird. </param>
<param name="category">Ein Kategoriename fr die Anordnung der Ausgabe. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteLine(System.String)">
<summary>Schreibt eine Meldung, gefolgt von einem Zeilenabschluss, in die Ablaufverfolgungsberwachungen in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="message">Eine zu schreibende Meldung. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteLine(System.String,System.Object[])">
<summary>Schreibt eine formatierte Meldung, gefolgt von einem Zeilenabschluss, in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="format">Eine zusammengesetzte Formatzeichenfolge (siehe Hinweise) mit Text, der 0 oder mehr Formatelemente enthlt, die Objekten im <paramref name="args" />-Array entsprechen.</param>
<param name="args">Ein Objektarray mit 0 (null) oder mehr zu formatierenden Objekten. </param>
</member>
<member name="M:System.Diagnostics.Debug.WriteLine(System.String,System.String)">
<summary>Schreibt einen Kategorienamen und eine Meldung in die Ablaufverfolgungsberwachungen in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung.</summary>
<param name="message">Eine zu schreibende Meldung. </param>
<param name="category">Ein Kategoriename fr die Anordnung der Ausgabe. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteLineIf(System.Boolean,System.Object)">
<summary>Schreibt den Wert der <see cref="M:System.Object.ToString" />-Methode des Objekts in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung, wenn eine Bedingung true ist.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, wird der Wert in die Ablaufverfolgungslistener in der Auflistung geschrieben.</param>
<param name="value">Ein Objekt, dessen Name an die <see cref="P:System.Diagnostics.Debug.Listeners" /> gesendet wird. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteLineIf(System.Boolean,System.Object,System.String)">
<summary>Schreibt einen Kategorienamen und den Wert der <see cref="M:System.Object.ToString" />-Methode des Objekts in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung, wenn eine Bedingung true ist.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, werden der Kategoriename und der Wert in die Ablaufverfolgungslistener in der Auflistung geschrieben.</param>
<param name="value">Ein Objekt, dessen Name an die <see cref="P:System.Diagnostics.Debug.Listeners" /> gesendet wird. </param>
<param name="category">Ein Kategoriename fr die Anordnung der Ausgabe. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteLineIf(System.Boolean,System.String)">
<summary>Schreibt eine Meldung in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung, wenn eine Bedingung true ist.</summary>
<param name="condition">Der bedingte Ausdruck, der ausgewertet werden soll.Wenn die Bedingung true ist, wird die Meldung in die Ablaufverfolgungslistener in der Auflistung geschrieben.</param>
<param name="message">Eine zu schreibende Meldung. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="M:System.Diagnostics.Debug.WriteLineIf(System.Boolean,System.String,System.String)">
<summary>Schreibt einen Kategorienamen und eine Meldung in die Ablaufverfolgungslistener in der <see cref="P:System.Diagnostics.Debug.Listeners" />-Auflistung, wenn eine Bedingung true ist.</summary>
<param name="condition">true, damit eine Meldung geschrieben wird, andernfalls false. </param>
<param name="message">Eine zu schreibende Meldung. </param>
<param name="category">Ein Kategoriename fr die Anordnung der Ausgabe. </param>
<filterpriority>2</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlEvidence" />
</PermissionSet>
</member>
<member name="T:System.Diagnostics.Debugger">
<summary>Ermglicht die Kommunikation mit einem Debugger.Diese Klasse kann nicht vererbt werden.</summary>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.Debugger.Break">
<summary>Signalisiert einem angefgten Debugger einen Haltepunkt.</summary>
<exception cref="T:System.Security.SecurityException">
<see cref="T:System.Security.Permissions.UIPermission" /> ist fr das Anhalten des Debuggers nicht festgelegt. </exception>
<filterpriority>1</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
</PermissionSet>
</member>
<member name="P:System.Diagnostics.Debugger.IsAttached">
<summary>Ruft einen Wert ab, der angibt, ob ein Debugger an den Prozess angefgt ist.</summary>
<returns>true, wenn ein Debugger angefgt ist, andernfalls false.</returns>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.Debugger.Launch">
<summary>Startet einen Debugger und fgt diesen an den Prozess an.</summary>
<returns>true, wenn der Debugger erfolgreich gestartet wurde oder der Debugger bereits angefgt ist, andernfalls false.</returns>
<exception cref="T:System.Security.SecurityException">
<see cref="T:System.Security.Permissions.UIPermission" /> ist fr das Starten des Debuggers nicht festgelegt. </exception>
<filterpriority>1</filterpriority>
<PermissionSet>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true" />
</PermissionSet>
</member>
<member name="T:System.Diagnostics.DebuggerBrowsableAttribute">
<summary>Bestimmt, ob und wie ein Member in den variablen Debugfenstern angezeigt wird.Diese Klasse kann nicht vererbt werden.</summary>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.DebuggerBrowsableAttribute.#ctor(System.Diagnostics.DebuggerBrowsableState)">
<summary>Initialisiert eine neue Instanz der <see cref="T:System.Diagnostics.DebuggerBrowsableAttribute" />-Klasse. </summary>
<param name="state">Einer der <see cref="T:System.Diagnostics.DebuggerBrowsableState" />-Werte, der angibt, wie der Member angezeigt werden soll.</param>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="state" /> ist keiner der <see cref="T:System.Diagnostics.DebuggerBrowsableState" />-Werte.</exception>
</member>
<member name="P:System.Diagnostics.DebuggerBrowsableAttribute.State">
<summary>Ruft den Anzeigezustand fr das Attribut ab.</summary>
<returns>Einer der <see cref="T:System.Diagnostics.DebuggerBrowsableState" />-Werte.</returns>
<filterpriority>2</filterpriority>
</member>
<member name="T:System.Diagnostics.DebuggerBrowsableState">
<summary>Stellt Anzeigeanweisungen fr den Debugger bereit.</summary>
<filterpriority>2</filterpriority>
</member>
<member name="F:System.Diagnostics.DebuggerBrowsableState.Collapsed">
<summary>Zeigen Sie das Element reduziert an.</summary>
</member>
<member name="F:System.Diagnostics.DebuggerBrowsableState.Never">
<summary>Zeigen Sie das Element nie an.</summary>
</member>
<member name="F:System.Diagnostics.DebuggerBrowsableState.RootHidden">
<summary>Zeigen Sie das Stammelement nicht an, sondern zeigen Sie die untergeordneten Elemente an, wenn es sich bei dem Element um eine Auflistung oder ein Array von Elementen handelt.</summary>
</member>
<member name="T:System.Diagnostics.DebuggerDisplayAttribute">
<summary>Bestimmt, wie eine Klasse oder ein Feld in den variablen Fenstern des Debuggers angezeigt wird.</summary>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.DebuggerDisplayAttribute.#ctor(System.String)">
<summary>Initialisiert eine neue Instanz der <see cref="T:System.Diagnostics.DebuggerDisplayAttribute" />-Klasse. </summary>
<param name="value">Die in der Wertespalte fr Instanzen des Typs anzuzeigende Zeichenfolge. Bei einer leeren Zeichenfolge ("") wird die Wertespalte ausgeblendet.</param>
</member>
<member name="P:System.Diagnostics.DebuggerDisplayAttribute.Name">
<summary>Ruft den Namen ab, der in den variablen Debugfensters angezeigt werden soll, oder legt diesen fest.</summary>
<returns>Der Name, der in den variablen Debugfenstern angezeigt werden soll.</returns>
<filterpriority>2</filterpriority>
</member>
<member name="P:System.Diagnostics.DebuggerDisplayAttribute.Target">
<summary>Ruft den Typ des Attributziels ab oder legt diesen fest.</summary>
<returns>Der Zieltyp des Attributs.</returns>
<exception cref="T:System.ArgumentNullException">
<see cref="P:System.Diagnostics.DebuggerDisplayAttribute.Target" /> ist auf null festgelegt.</exception>
<filterpriority>2</filterpriority>
</member>
<member name="P:System.Diagnostics.DebuggerDisplayAttribute.TargetTypeName">
<summary>Ruft den Typnamen des Attributziels ab oder legt diesen fest.</summary>
<returns>Der Name des Attributzieltyps.</returns>
<filterpriority>2</filterpriority>
</member>
<member name="P:System.Diagnostics.DebuggerDisplayAttribute.Type">
<summary>Ruft die Zeichenfolge ab, die in den variablen Debugfenstern in der Typspalte angezeigt werden soll, oder legt diese fest.</summary>
<returns>Die Zeichenfolge, die in den variablen Debugfenster in der Typspalte angezeigt werden soll.</returns>
<filterpriority>2</filterpriority>
</member>
<member name="P:System.Diagnostics.DebuggerDisplayAttribute.Value">
<summary>Ruft die Zeichenfolge ab, die in den variablen Debugfenstern in der Wertspalte angezeigt werden soll.</summary>
<returns>Die Zeichenfolge, die in der Wertspalte der Debuggervariable angezeigt werden soll.</returns>
<filterpriority>2</filterpriority>
</member>
<member name="T:System.Diagnostics.DebuggerHiddenAttribute">
<summary>Gibt das <see cref="T:System.Diagnostics.DebuggerHiddenAttribute" /> an.Diese Klasse kann nicht vererbt werden.</summary>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.DebuggerHiddenAttribute.#ctor">
<summary>Initialisiert eine neue Instanz der <see cref="T:System.Diagnostics.DebuggerHiddenAttribute" />-Klasse. </summary>
</member>
<member name="T:System.Diagnostics.DebuggerNonUserCodeAttribute">
<summary>Bezeichnet einen Typ oder einen Member, der nicht Teil des Benutzercodes einer Anwendung ist.</summary>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.DebuggerNonUserCodeAttribute.#ctor">
<summary>Initialisiert eine neue Instanz der <see cref="T:System.Diagnostics.DebuggerNonUserCodeAttribute" />-Klasse. </summary>
</member>
<member name="T:System.Diagnostics.DebuggerStepThroughAttribute">
<summary>Weist den Debugger an, den Code automatisch im Prozedurschritt und nicht im Einzelschritt zu durchlaufen.Diese Klasse kann nicht vererbt werden.</summary>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.DebuggerStepThroughAttribute.#ctor">
<summary>Initialisiert eine neue Instanz der<see cref="T:System.Diagnostics.DebuggerStepThroughAttribute" />-Klasse. </summary>
</member>
<member name="T:System.Diagnostics.DebuggerTypeProxyAttribute">
<summary>Gibt den Anzeigeproxy fr einen Typ an.</summary>
<filterpriority>1</filterpriority>
</member>
<member name="M:System.Diagnostics.DebuggerTypeProxyAttribute.#ctor(System.String)">
<summary>Initialisiert eine neue Instanz der <see cref="T:System.Diagnostics.DebuggerTypeProxyAttribute" />-Klasse unter Verwendung des Typnamens des Proxys. </summary>
<param name="typeName">Der Typname des Proxytyps.</param>
</member>
<member name="M:System.Diagnostics.DebuggerTypeProxyAttribute.#ctor(System.Type)">
<summary>Initialisiert eine neue Instanz der <see cref="T:System.Diagnostics.DebuggerTypeProxyAttribute" />-Klasse unter Verwendung des Proxytyps. </summary>
<param name="type">Der Proxytyp.</param>
<exception cref="T:System.ArgumentNullException">
<paramref name="type" /> ist null.</exception>
</member>
<member name="P:System.Diagnostics.DebuggerTypeProxyAttribute.ProxyTypeName">
<summary>Ruft den Typnamen des Proxytyps ab. </summary>
<returns>Der Typname des Proxytyps.</returns>
<filterpriority>2</filterpriority>
</member>
<member name="P:System.Diagnostics.DebuggerTypeProxyAttribute.Target">
<summary>Ruft den Zieltyp fr das Attribut ab oder legt dieses fest.</summary>
<returns>Der Zieltyp fr das Attribut.</returns>
<exception cref="T:System.ArgumentNullException">
<see cref="P:System.Diagnostics.DebuggerTypeProxyAttribute.Target" /> ist auf null festgelegt.</exception>
<filterpriority>2</filterpriority>
</member>
<member name="P:System.Diagnostics.DebuggerTypeProxyAttribute.TargetTypeName">
<summary>Ruft den Namen des Zieltyps ab oder legt diesen fest.</summary>
<returns>Der Name des Zieltyps.</returns>
<filterpriority>2</filterpriority>
</member>
</members>
</doc>
``` | /content/code_sandbox/packages/System.Diagnostics.Debug.4.0.0/ref/netcore50/de/System.Diagnostics.Debug.xml | xml | 2016-04-24T09:50:47 | 2024-08-16T11:45:14 | ILRuntime | Ourpalm/ILRuntime | 2,976 | 8,588 |
```xml
/**
* @packageDocumentation
* @module translation
*/
// Note: keep in alphabetical order...
export * from './base';
export * from './gettext';
export * from './manager';
export * from './server';
export * from './tokens';
``` | /content/code_sandbox/packages/translation/src/index.ts | xml | 2016-06-03T20:09:17 | 2024-08-16T19:12:44 | jupyterlab | jupyterlab/jupyterlab | 14,019 | 51 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="path_to_url"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
android:id="@+id/container"
tools:context="com.sackcentury.shinebutton.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.sackcentury.shinebuttonlib.ShineButton
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:id="@+id/po_image0"
app:btn_color="@android:color/darker_gray"
app:btn_fill_color="#f26d7d"
app:siShape="@raw/heart"
android:elevation="10dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.sackcentury.shinebuttonlib.ShineButton
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:src="@android:color/darker_gray"
android:id="@+id/po_image1"
app:btn_color="@android:color/darker_gray"
app:btn_fill_color="#FF6666"
app:allow_random_color="false"
app:enable_flashing="false"
app:big_shine_color="#FF6666"
app:click_animation_duration="200"
app:shine_animation_duration="1500"
app:shine_turn_angle="10"
app:small_shine_offset_angle="20"
app:shine_distance_multiple="1.5"
app:small_shine_color="#CC9999"
app:shine_count="15"
app:siShape="@raw/like"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.sackcentury.shinebuttonlib.ShineButton
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:src="@android:color/darker_gray"
android:id="@+id/po_image2"
app:btn_color="@android:color/darker_gray"
app:btn_fill_color="#F44336"
app:allow_random_color="true"
app:siShape="@raw/smile"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.sackcentury.shinebuttonlib.ShineButton
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:id="@+id/po_image3"
app:btn_color="@android:color/darker_gray"
app:btn_fill_color="#996699"
app:enable_flashing="true"
app:shine_size="40dp"
app:siShape="@raw/star"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/wrapper">
</LinearLayout>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/btn_list_demo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="List Demo Activity" />
<Button
android:id="@+id/btn_fragment_demo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="Fragment Demo" />
<Button
android:id="@+id/btn_dialog_demo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="Dialog Demo"
android:visibility="visible" />
<androidx.cardview.widget.CardView xmlns:card_view="path_to_url"
android:id="@+id/card_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
card_view:cardBackgroundColor="@android:color/white"
android:layout_marginTop="200dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="5dp"
card_view:cardCornerRadius="10dp"
android:visibility="gone"
card_view:cardElevation="24dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/image_view"
android:layout_width="375dp"
android:layout_height="160dp"
android:layout_gravity="center_horizontal"
android:scaleType="centerCrop" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="51dp"
android:orientation="vertical">
<TextView
android:id="@+id/title_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="pavel"
android:layout_margin="8dp"
android:maxLines="3" />
<com.sackcentury.shinebuttonlib.ShineButton
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:id="@+id/po_image8"
app:btn_color="#FF6666"
app:btn_fill_color="#999933"
app:siShape="@raw/heart"
android:layout_gravity="right"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<TextView
android:id="@+id/movie_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="robin"
android:layout_margin="8dp"
android:layout_alignParentBottom="true" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
``` | /content/code_sandbox/app/src/main/res/layout/activity_main.xml | xml | 2016-07-05T06:32:26 | 2024-08-15T07:21:08 | ShineButton | ChadCSong/ShineButton | 4,219 | 1,598 |
```xml
<TestClass5 Bar="{}{ Some Value That Should Be Escaped" xmlns="clr-namespace:MonoTests.System.Xaml;assembly=System.Xaml.TestCases" />
``` | /content/code_sandbox/src/Test/System.Xaml.TestCases/XmlFiles/EscapedPropertyValue.xml | xml | 2016-08-25T20:07:20 | 2024-08-13T22:23:35 | CoreWF | UiPath/CoreWF | 1,126 | 35 |
```xml
// See LICENSE.txt for license information.
import keyMirror from '@utils/key_mirror';
export const REDIRECT_URL_SCHEME = 'mmauth://';
export const REDIRECT_URL_SCHEME_DEV = 'mmauthbeta://';
const constants = keyMirror({
SAML: null,
GITLAB: null,
GOOGLE: null,
OFFICE365: null,
OPENID: null,
});
export default {
...constants,
REDIRECT_URL_SCHEME,
REDIRECT_URL_SCHEME_DEV,
};
``` | /content/code_sandbox/app/constants/sso.ts | xml | 2016-10-07T16:52:32 | 2024-08-16T12:08:38 | mattermost-mobile | mattermost/mattermost-mobile | 2,155 | 106 |
```xml
// See LICENSE.txt for license information.
import {Q, Relation} from '@nozbe/watermelondb';
import {field, immutableRelation, lazy} from '@nozbe/watermelondb/decorators';
import Model, {type Associations} from '@nozbe/watermelondb/Model';
import {MM_TABLES} from '@constants/database';
import type TeamModel from '@typings/database/models/servers/team';
import type TeamMembershipModelInterface from '@typings/database/models/servers/team_membership';
import type UserModel from '@typings/database/models/servers/user';
const {TEAM, TEAM_MEMBERSHIP, USER} = MM_TABLES.SERVER;
/**
* The TeamMembership model represents the 'association table' where many teams have users and many users are in
* teams (relationship type N:N)
*/
export default class TeamMembershipModel extends Model implements TeamMembershipModelInterface {
/** table (name) : TeamMembership */
static table = TEAM_MEMBERSHIP;
/** associations : Describes every relationship to this table. */
static associations: Associations = {
/** TEAM and TEAM_MEMBERSHIP share a 1:N relationship; USER can be part of multiple teams */
[TEAM]: {type: 'belongs_to', key: 'team_id'},
/** USER and TEAM_MEMBERSHIP share a 1:N relationship; A TEAM can regroup multiple users */
[USER]: {type: 'belongs_to', key: 'user_id'},
};
/** team_id : The foreign key to the related Team record */
@field('team_id') teamId!: string;
/* user_id: The foreign key to the related User record*/
@field('user_id') userId!: string;
/* scheme_admin: Determines if the user is an admin of the team*/
@field('scheme_admin') schemeAdmin!: boolean;
/** memberUser: The related user in the team */
@immutableRelation(USER, 'user_id') memberUser!: Relation<UserModel>;
/** memberTeam : The related team of users */
@immutableRelation(TEAM, 'team_id') memberTeam!: Relation<TeamModel>;
/**
* getAllTeamsForUser - Retrieves all the teams that the user is part of
*/
@lazy getAllTeamsForUser = this.collections.get<TeamModel>(TEAM).query(Q.on(USER, 'id', this.userId));
/**
* getAllUsersInTeam - Retrieves all the users who are part of this team
*/
@lazy getAllUsersInTeam = this.collections.get<UserModel>(USER).query(Q.on(TEAM, 'id', this.teamId));
}
``` | /content/code_sandbox/app/database/models/server/team_membership.ts | xml | 2016-10-07T16:52:32 | 2024-08-16T12:08:38 | mattermost-mobile | mattermost/mattermost-mobile | 2,155 | 541 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {InlineNotification} from '@carbon/react';
import {useTranslation} from 'react-i18next';
const FailedVariableFetchError: React.FC = () => {
const {t} = useTranslation();
return (
<InlineNotification
kind="error"
role="alert"
hideCloseButton
lowContrast
title={t('taskDetailsFailedToFetchVariablesErrorTitle')}
subtitle={t('taskDetailsFailedToFetchVariablesErrorSubtitle')}
/>
);
};
export {FailedVariableFetchError};
``` | /content/code_sandbox/tasklist/client/src/modules/components/FailedVariableFetchError.tsx | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 139 |
```xml
import * as React from 'react';
import createSvgIcon from '../utils/createSvgIcon';
const InsertColumnsRightIcon = createSvgIcon({
svg: ({ classes }) => (
<svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false">
<path d="M2048 your_sha256_hashV128h2048v512zM640 your_sha256_hash256zm883 1043l275-275h-774V896h774l-275-275 90-90 429 429-429 429-90-90z" />
</svg>
),
displayName: 'InsertColumnsRightIcon',
});
export default InsertColumnsRightIcon;
``` | /content/code_sandbox/packages/react-icons-mdl2/src/components/InsertColumnsRightIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 158 |
```xml
import { EventSubscriber } from "../../../../../../src/decorator/listeners/EventSubscriber"
import { EntitySubscriberInterface } from "../../../../../../src/subscriber/EntitySubscriberInterface"
import { InsertEvent } from "../../../../../../src/subscriber/event/InsertEvent"
@EventSubscriber()
export class TestVideoSubscriber implements EntitySubscriberInterface {
/**
* Called after entity insertion.
*/
beforeInsert(event: InsertEvent<any>) {
// Do nothing
}
}
``` | /content/code_sandbox/test/functional/connection/modules/video/subscriber/TestVideoSubscriber.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 95 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Batch" Version="13.0.0" />
<PackageReference Include="Microsoft.Azure.Batch.Conventions.Files" Version="3.5.1" />
<PackageReference Include="Microsoft.Azure.Management.Batch" Version="11.0.0" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/SQL-Hybrid-Cloud-Toolkit/Components/ADP/SqlPackageWrapper/SqlPackageWrapper.csproj | xml | 2016-10-08T00:32:58 | 2024-08-16T09:27:34 | tigertoolbox | microsoft/tigertoolbox | 1,468 | 122 |
```xml
import '../../methods/after.js';
import '../../methods/children.js';
import {
jQuery,
jq,
assert,
JQStatic,
toTagNameArray,
toTextContentArray,
} from '../utils.js';
const test = ($: JQStatic, type: string): void => {
describe(`${type} - .after`, () => {
// before()
beforeEach(() => {
document.querySelector('#frame')!.innerHTML = `
<div class="container">
<h2>Greetings</h2>
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
</div>
<div class="other">other</div>
`;
});
it('.after(html1, html2)', () => {
const $result = $('.inner').after('<p>test1</p>', '<p>test2</p>');
assert.sameOrderedMembers(toTagNameArray($result), ['div', 'div']);
assert.sameOrderedMembers(toTextContentArray($result), [
'Hello',
'Goodbye',
]);
const $children = $('.container').children();
assert.sameOrderedMembers(toTagNameArray($children), [
'h2',
'div',
'p',
'p',
'div',
'p',
'p',
]);
assert.sameOrderedMembers(toTextContentArray($children), [
'Greetings',
'Hello',
'test1',
'test2',
'Goodbye',
'test1',
'test2',
]);
});
});
};
test(jq, 'jq');
test(jQuery as unknown as JQStatic, 'jQuery');
``` | /content/code_sandbox/packages/jq/__test__/methods/after.test.ts | xml | 2016-07-11T17:39:02 | 2024-08-16T07:12:34 | mdui | zdhxiong/mdui | 4,077 | 353 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="fi" datatype="plaintext" original="plugins.en.xlf">
<body>
<trans-unit id="vFSLi54" resname="plugin.none_installed">
<source>plugin.none_installed</source>
<target state="translated">Sinulla ei ole asennettuja liitnnisi.</target>
</trans-unit>
<trans-unit id="jZAB0yx" resname="shop" xml:space="preserve">
<source>Plugin Shop</source>
<target state="translated">Lis laajennuksia</target>
</trans-unit>
<trans-unit id="6Bl7IPj" resname="buy" xml:space="preserve">
<source>Buy now</source>
<target state="translated">Osta nyt</target>
</trans-unit>
<trans-unit id="zVtBsSo" resname="plugin.marketplace" xml:space="preserve">
<source>Available plugins</source>
<target state="translated">Saatavilla olevat lisosat</target>
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/translations/plugins.fi.xlf | xml | 2016-10-20T17:06:34 | 2024-08-16T18:27:30 | kimai | kimai/kimai | 3,084 | 304 |
```xml
/*************************************************************
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
/**
* @fileoverview The version of MathJax (used to tell what version a component
* was compiled against).
*
* @author dpvc@mathjax.org (Davide Cervone)
*/
export const VERSION = '3.2.2';
``` | /content/code_sandbox/ts/components/version.ts | xml | 2016-02-23T09:52:03 | 2024-08-16T04:46:50 | MathJax-src | mathjax/MathJax-src | 2,017 | 102 |
```xml
import * as React from 'react';
import { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';
import type { OptionGroupProps, OptionGroupState } from './OptionGroup.types';
/**
* Create the state required to render OptionGroup.
*
* The returned state can be modified with hooks such as useOptionGroupStyles_unstable,
* before being passed to renderOptionGroup_unstable.
*
* @param props - props from this instance of OptionGroup
* @param ref - reference to root HTMLElement of OptionGroup
*/
export const useOptionGroup_unstable = (props: OptionGroupProps, ref: React.Ref<HTMLElement>): OptionGroupState => {
const labelId = useId('group-label');
const { label } = props;
return {
components: {
root: 'div',
label: 'span',
},
root: slot.always(
getIntrinsicElementProps('div', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref as React.Ref<HTMLDivElement>,
role: 'group',
'aria-labelledby': label ? labelId : undefined,
...props,
}),
{ elementType: 'div' },
),
label: slot.optional(label, {
defaultProps: {
id: labelId,
role: 'presentation',
},
elementType: 'span',
}),
};
};
``` | /content/code_sandbox/packages/react-components/react-combobox/library/src/components/OptionGroup/useOptionGroup.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 329 |
```xml
/*
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*
*/
export class Node<V = object, K = number | bigint> {
public key: K;
public value: V;
public constructor(key: K, value: V) {
this.key = key;
this.value = value;
}
public clone(): Node<V, K> {
return new Node(this.key, this.value);
}
}
``` | /content/code_sandbox/elements/lisk-utils/src/data_structures/node.ts | xml | 2016-02-01T21:45:35 | 2024-08-15T19:16:48 | lisk-sdk | LiskArchive/lisk-sdk | 2,721 | 158 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Interact with servers started from a build.</source>
<target state="translated">Interagissez avec les serveurs dmarrs partir d'une build.</target>
<note />
</trans-unit>
<trans-unit id="BuildServerCommandName">
<source>.NET Build Server Command</source>
<target state="translated">Commande du serveur de builds .NET</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Cli/dotnet/commands/dotnet-buildserver/xlf/LocalizableStrings.fr.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 233 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
``` | /content/code_sandbox/Generator/Generator.csproj | xml | 2016-01-12T22:31:19 | 2024-08-15T23:49:59 | OneOf | mcintyre321/OneOf | 3,372 | 54 |
```xml
import { useState } from 'react';
import { c } from 'ttag';
import { useLoading } from '@proton/hooks';
import { updateSpamAction, updateStickyLabels, updateViewMode } from '@proton/shared/lib/api/mailSettings';
import { getKnowledgeBaseUrl } from '@proton/shared/lib/helpers/url';
import type { SPAM_ACTION } from '@proton/shared/lib/mail/mailSettings';
import { DEFAULT_MAILSETTINGS, STICKY_LABELS, VIEW_MODE } from '@proton/shared/lib/mail/mailSettings';
import { useFlag } from '@proton/unleash';
import { Info } from '../../components';
import { useApi, useEventManager, useFeature, useMailSettings, useNotifications } from '../../hooks';
import SettingsLayout from '../account/SettingsLayout';
import SettingsLayoutLeft from '../account/SettingsLayoutLeft';
import SettingsLayoutRight from '../account/SettingsLayoutRight';
import { FeatureCode } from '../features';
import StickyLabelsToggle from '../layouts/StickyLabelsToggle';
import ViewModeToggle from '../layouts/ViewModeToggle';
import AlmostAllMailToggle from './AlmostAllMailToggle';
import AutoDeleteSetting from './AutoDeleteSetting';
import EmbeddedToggle from './EmbeddedToggle';
import { PageSizeSelector } from './PageSizeSelector';
import RequestLinkConfirmationToggle from './RequestLinkConfirmationToggle';
import ShowMovedToggle from './ShowMovedToggle';
import SpamActionSelect from './SpamActionSelect';
const MessagesSection = () => {
const [
{
ViewMode,
StickyLabels,
HideEmbeddedImages,
ConfirmLink,
SpamAction,
AutoDeleteSpamAndTrashDays,
AlmostAllMail,
} = DEFAULT_MAILSETTINGS,
] = useMailSettings();
const [hideEmbeddedImages, setHideEmbeddedImages] = useState(HideEmbeddedImages);
const { createNotification } = useNotifications();
const isAlmostAllMailEnabled = !!useFeature(FeatureCode.AlmostAllMail).feature?.Value;
const isPageSizeSettingEnabled = useFlag('WebMailPageSizeSetting');
const { call } = useEventManager();
const api = useApi();
const [loadingViewMode, withLoadingViewMode] = useLoading();
const [loadingStickyLabels, withLoadingStickyLabels] = useLoading();
const [loadingSpamAction, withLoadingSpamAction] = useLoading();
const handleChangeHideEmbedded = (newValue: number) => setHideEmbeddedImages(newValue);
const notifyPreferenceSaved = () => createNotification({ text: c('Success').t`Preference saved` });
const handleToggleStickyLabels = async (value: number) => {
await api(updateStickyLabels(value));
await call();
notifyPreferenceSaved();
};
const handleChangeViewMode = async (mode: VIEW_MODE) => {
if (mode === VIEW_MODE.SINGLE) {
await api(updateStickyLabels(STICKY_LABELS.DISABLED));
}
await api(updateViewMode(mode));
await call();
notifyPreferenceSaved();
};
const handleChangeSpamAction = async (spamAction: SPAM_ACTION | null) => {
await api(updateSpamAction(spamAction));
await call();
notifyPreferenceSaved();
};
return (
<>
<SettingsLayout>
<SettingsLayoutLeft>
<label htmlFor="embeddedToggle" className="text-semibold">
<span className="mr-2">{c('Label').t`Auto show embedded images`}</span>
<Info
url={getKnowledgeBaseUrl('/images-by-default')}
title={c('Info')
.t`When disabled, this prevents image files from loading on your device without your knowledge.`}
/>
</label>
</SettingsLayoutLeft>
<SettingsLayoutRight isToggleContainer>
<EmbeddedToggle
id="embeddedToggle"
hideEmbeddedImages={hideEmbeddedImages}
onChange={handleChangeHideEmbedded}
/>
</SettingsLayoutRight>
</SettingsLayout>
<SettingsLayout>
<SettingsLayoutLeft>
<label htmlFor="showMovedToggle" className="text-semibold">
<span className="mr-2">{c('Label').t`Keep messages in Sent/Drafts`}</span>
<Info
title={c('Tooltip')
.t`Messages in the Sent or Drafts folder will continue to appear in that folder, even if you move them to another folder.`}
/>
</label>
</SettingsLayoutLeft>
<SettingsLayoutRight isToggleContainer>
<ShowMovedToggle id="showMovedToggle" />
</SettingsLayoutRight>
</SettingsLayout>
<SettingsLayout>
{isAlmostAllMailEnabled && (
<>
<SettingsLayoutLeft>
<label htmlFor="almostAllMail" className="text-semibold">
<span className="mr-2">{c('Label').t`Exclude Spam/Trash from All mail`}</span>
<Info title={c('Info').t`Not yet available in our Android mobile app.`} />
</label>
</SettingsLayoutLeft>
<SettingsLayoutRight isToggleContainer>
<AlmostAllMailToggle id="almostAllMail" showAlmostAllMail={AlmostAllMail} />
</SettingsLayoutRight>
</>
)}
</SettingsLayout>
<SettingsLayout>
<SettingsLayoutLeft>
<label htmlFor="requestLinkConfirmationToggle" className="text-semibold">
<span className="mr-2">{c('Label').t`Confirm link URLs`}</span>
<Info
title={c('Tooltip')
.t`When you click on a link, this anti-phishing feature will ask you to confirm the URL of the web page.`}
/>
</label>
</SettingsLayoutLeft>
<SettingsLayoutRight isToggleContainer>
<RequestLinkConfirmationToggle confirmLink={ConfirmLink} id="requestLinkConfirmationToggle" />
</SettingsLayoutRight>
</SettingsLayout>
<SettingsLayout>
<SettingsLayoutLeft>
<label htmlFor="viewMode" className="text-semibold">
<span className="mr-2">{c('Label').t`Conversation grouping`}</span>
<Info
title={c('Tooltip')
.t`Group emails in the same conversation together in your Inbox or display them separately.`}
/>
</label>
</SettingsLayoutLeft>
<SettingsLayoutRight isToggleContainer>
<ViewModeToggle
id="viewMode"
viewMode={ViewMode}
loading={loadingViewMode}
onToggle={(value) => withLoadingViewMode(handleChangeViewMode(value))}
data-testid="appearance:conversation-group-toggle"
/>
</SettingsLayoutRight>
</SettingsLayout>
<AutoDeleteSetting settingValue={AutoDeleteSpamAndTrashDays} onSaved={notifyPreferenceSaved} />
<SettingsLayout>
<SettingsLayoutLeft>
<label htmlFor="stickyLabelsToggle" className="text-semibold">
<span className="mr-2">{c('Label').t`Sticky labels`}</span>
<Info
title={c('Tooltip')
.t`When you add a label to a message in a conversation, it will automatically be applied to all future messages you send or receive in that conversation.`}
/>
</label>
</SettingsLayoutLeft>
<SettingsLayoutRight isToggleContainer>
<StickyLabelsToggle
id="stickyLabelsToggle"
stickyLabels={StickyLabels}
loading={loadingStickyLabels}
onToggle={(value) => withLoadingStickyLabels(handleToggleStickyLabels(value))}
data-testid="appearance:sticky-labels-toggle"
disabled={ViewMode !== VIEW_MODE.GROUP}
/>
</SettingsLayoutRight>
</SettingsLayout>
<SettingsLayout>
<SettingsLayoutLeft>
<label htmlFor="spamActionLabelSelect" className="text-semibold">
<span className="mr-2">{c('Label').t`Auto-unsubscribe`}</span>
<Info
title={c('Tooltip')
.t`When you move an email to spam, youll automatically be unsubscribed from the senders mailing lists.`}
/>
</label>
</SettingsLayoutLeft>
<SettingsLayoutRight>
<SpamActionSelect
id="spamActionLabelSelect"
value={SpamAction}
onChange={(value) => withLoadingSpamAction(handleChangeSpamAction(value))}
loading={loadingSpamAction}
/>
</SettingsLayoutRight>
</SettingsLayout>
{isPageSizeSettingEnabled && (
<SettingsLayout>
<SettingsLayoutLeft>
<label htmlFor="pageSizeSelector" className="text-semibold" id="label-pageSizeSelector">
<span className="mr-2">
{ViewMode === VIEW_MODE.GROUP
? c('Label').t`Conversations per page`
: c('Label').t`Messages per page`}
</span>
</label>
</SettingsLayoutLeft>
<SettingsLayoutRight>
<PageSizeSelector id="pageSizeSelector" />
</SettingsLayoutRight>
</SettingsLayout>
)}
</>
);
};
export default MessagesSection;
``` | /content/code_sandbox/packages/components/containers/messages/MessagesSection.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 1,929 |
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"path_to_url" >
<!--
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
path_to_url
Unless required by applicable law or agreed to in writing,
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
specific language governing permissions and limitations
-->
<mapper namespace="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper" >
<!-- Result mapper for connection objects -->
<resultMap id="ConnectionResultMap" type="org.apache.guacamole.auth.jdbc.connection.ConnectionModel" >
<!-- Connection properties -->
<id column="connection_id" property="objectID" jdbcType="INTEGER"/>
<result column="connection_name" property="name" jdbcType="VARCHAR"/>
<result column="parent_id" property="parentIdentifier" jdbcType="INTEGER"/>
<result column="protocol" property="protocol" jdbcType="VARCHAR"/>
<result column="max_connections" property="maxConnections" jdbcType="INTEGER"/>
<result column="max_connections_per_user" property="maxConnectionsPerUser" jdbcType="INTEGER"/>
<result column="proxy_hostname" property="proxyHostname" jdbcType="VARCHAR"/>
<result column="proxy_port" property="proxyPort" jdbcType="INTEGER"/>
<result column="proxy_encryption_method" property="proxyEncryptionMethod" jdbcType="VARCHAR"
javaType="org.apache.guacamole.net.auth.GuacamoleProxyConfiguration$EncryptionMethod"/>
<result column="connection_weight" property="connectionWeight" jdbcType="INTEGER"/>
<result column="failover_only" property="failoverOnly" jdbcType="BOOLEAN"/>
<result column="last_active" property="lastActive" jdbcType="TIMESTAMP"/>
<!-- Associated sharing profiles -->
<collection property="sharingProfileIdentifiers" resultSet="sharingProfiles" ofType="java.lang.String"
column="connection_id" foreignColumn="primary_connection_id">
<result column="sharing_profile_id"/>
</collection>
<!-- Arbitrary attributes -->
<collection property="arbitraryAttributes" resultSet="arbitraryAttributes"
ofType="org.apache.guacamole.auth.jdbc.base.ArbitraryAttributeModel"
column="connection_id" foreignColumn="connection_id">
<result property="name" column="attribute_name" jdbcType="VARCHAR"/>
<result property="value" column="attribute_value" jdbcType="VARCHAR"/>
</collection>
</resultMap>
<!-- Select all connection identifiers -->
<select id="selectIdentifiers" resultType="string">
SELECT connection_id
FROM guacamole_connection
</select>
<!--
* SQL fragment which lists the IDs of all connections readable by the
* entity having the given entity ID. If group identifiers are provided,
* the IDs of the entities for all groups having those identifiers are
* tested, as well. Disabled groups are ignored.
*
* @param entityID
* The ID of the specific entity to test against.
*
* @param groups
* A collection of group identifiers to additionally test against.
* Though this functionality is optional, a collection must always be
* given, even if that collection is empty.
-->
<sql id="getReadableIDs">
SELECT DISTINCT connection_id
FROM guacamole_connection_permission
WHERE
<include refid="org.apache.guacamole.auth.jdbc.base.EntityMapper.isRelatedEntity">
<property name="column" value="entity_id"/>
<property name="entityID" value="${entityID}"/>
<property name="groups" value="${groups}"/>
</include>
AND permission = 'READ'
</sql>
<!-- Select identifiers of all readable connections -->
<select id="selectReadableIdentifiers" resultType="string">
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
<property name="groups" value="effectiveGroups"/>
</include>
</select>
<!-- Select all connection identifiers within a particular connection group -->
<select id="selectIdentifiersWithin" resultType="string">
SELECT connection_id
FROM guacamole_connection
WHERE
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=VARCHAR}</if>
<if test="parentIdentifier == null">parent_id IS NULL</if>
</select>
<!-- Select identifiers of all readable connections within a particular connection group -->
<select id="selectReadableIdentifiersWithin" resultType="string">
SELECT guacamole_connection.connection_id
FROM guacamole_connection
WHERE
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=VARCHAR}</if>
<if test="parentIdentifier == null">parent_id IS NULL</if>
AND connection_id IN (
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
<property name="groups" value="effectiveGroups"/>
</include>
)
</select>
<!-- Select multiple connections by identifier -->
<select id="select" resultMap="ConnectionResultMap"
resultSets="connections,sharingProfiles,arbitraryAttributes">
SELECT
guacamole_connection.connection_id,
guacamole_connection.connection_name,
parent_id,
protocol,
max_connections,
max_connections_per_user,
proxy_hostname,
proxy_port,
proxy_encryption_method,
connection_weight,
failover_only,
MAX(start_date) AS last_active
FROM guacamole_connection
LEFT JOIN guacamole_connection_history ON guacamole_connection_history.connection_id = guacamole_connection.connection_id
WHERE guacamole_connection.connection_id IN
<foreach collection="identifiers" item="identifier"
open="(" separator="," close=")">
#{identifier,jdbcType=VARCHAR}
</foreach>
GROUP BY guacamole_connection.connection_id;
SELECT primary_connection_id, sharing_profile_id
FROM guacamole_sharing_profile
WHERE primary_connection_id IN
<foreach collection="identifiers" item="identifier"
open="(" separator="," close=")">
#{identifier,jdbcType=VARCHAR}
</foreach>;
SELECT
connection_id,
attribute_name,
attribute_value
FROM guacamole_connection_attribute
WHERE connection_id IN
<foreach collection="identifiers" item="identifier"
open="(" separator="," close=")">
#{identifier,jdbcType=VARCHAR}
</foreach>;
</select>
<!-- Select multiple connections by identifier only if readable -->
<select id="selectReadable" resultMap="ConnectionResultMap"
resultSets="connections,sharingProfiles,arbitraryAttributes">
SELECT
guacamole_connection.connection_id,
guacamole_connection.connection_name,
parent_id,
protocol,
max_connections,
max_connections_per_user,
proxy_hostname,
proxy_port,
proxy_encryption_method,
connection_weight,
failover_only,
MAX(start_date) AS last_active
FROM guacamole_connection
LEFT JOIN guacamole_connection_history ON guacamole_connection_history.connection_id = guacamole_connection.connection_id
WHERE guacamole_connection.connection_id IN
<foreach collection="identifiers" item="identifier"
open="(" separator="," close=")">
#{identifier,jdbcType=VARCHAR}
</foreach>
AND guacamole_connection.connection_id IN (
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
<property name="groups" value="effectiveGroups"/>
</include>
)
GROUP BY guacamole_connection.connection_id;
SELECT primary_connection_id, guacamole_sharing_profile.sharing_profile_id
FROM guacamole_sharing_profile
WHERE primary_connection_id IN
<foreach collection="identifiers" item="identifier"
open="(" separator="," close=")">
#{identifier,jdbcType=VARCHAR}
</foreach>
AND guacamole_sharing_profile.sharing_profile_id IN (
<include refid="org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileMapper.getReadableIDs">
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
<property name="groups" value="effectiveGroups"/>
</include>
);
SELECT
guacamole_connection_attribute.connection_id,
attribute_name,
attribute_value
FROM guacamole_connection_attribute
WHERE guacamole_connection_attribute.connection_id IN
<foreach collection="identifiers" item="identifier"
open="(" separator="," close=")">
#{identifier,jdbcType=VARCHAR}
</foreach>
AND guacamole_connection_attribute.connection_id IN (
<include refid="org.apache.guacamole.auth.jdbc.connection.ConnectionMapper.getReadableIDs">
<property name="entityID" value="#{user.entityID,jdbcType=INTEGER}"/>
<property name="groups" value="effectiveGroups"/>
</include>
);
</select>
<!-- Select single connection by name -->
<select id="selectOneByName" resultMap="ConnectionResultMap">
SELECT
guacamole_connection.connection_id,
guacamole_connection.connection_name,
parent_id,
protocol,
max_connections,
max_connections_per_user,
proxy_hostname,
proxy_port,
proxy_encryption_method,
connection_weight,
failover_only,
MAX(start_date) AS last_active
FROM guacamole_connection
LEFT JOIN guacamole_connection_history ON guacamole_connection_history.connection_id = guacamole_connection.connection_id
WHERE
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=VARCHAR}</if>
<if test="parentIdentifier == null">parent_id IS NULL</if>
AND guacamole_connection.connection_name = #{name,jdbcType=VARCHAR}
GROUP BY guacamole_connection.connection_id
</select>
<!-- Delete single connection by identifier -->
<delete id="delete">
DELETE FROM guacamole_connection
WHERE connection_id = #{identifier,jdbcType=VARCHAR}
</delete>
<!-- Insert single connection -->
<insert id="insert" useGeneratedKeys="true" keyProperty="object.objectID"
parameterType="org.apache.guacamole.auth.jdbc.connection.ConnectionModel">
INSERT INTO guacamole_connection (
connection_name,
parent_id,
protocol,
max_connections,
max_connections_per_user,
proxy_hostname,
proxy_port,
proxy_encryption_method,
connection_weight,
failover_only
)
VALUES (
#{object.name,jdbcType=VARCHAR},
#{object.parentIdentifier,jdbcType=VARCHAR},
#{object.protocol,jdbcType=VARCHAR},
#{object.maxConnections,jdbcType=INTEGER},
#{object.maxConnectionsPerUser,jdbcType=INTEGER},
#{object.proxyHostname,jdbcType=VARCHAR},
#{object.proxyPort,jdbcType=INTEGER},
#{object.proxyEncryptionMethod,jdbcType=VARCHAR},
#{object.connectionWeight,jdbcType=INTEGER},
#{object.failoverOnly,jdbcType=BOOLEAN}
)
</insert>
<!-- Update single connection -->
<update id="update" parameterType="org.apache.guacamole.auth.jdbc.connection.ConnectionModel">
UPDATE guacamole_connection
SET connection_name = #{object.name,jdbcType=VARCHAR},
parent_id = #{object.parentIdentifier,jdbcType=VARCHAR},
protocol = #{object.protocol,jdbcType=VARCHAR},
max_connections = #{object.maxConnections,jdbcType=INTEGER},
max_connections_per_user = #{object.maxConnectionsPerUser,jdbcType=INTEGER},
proxy_hostname = #{object.proxyHostname,jdbcType=VARCHAR},
proxy_port = #{object.proxyPort,jdbcType=INTEGER},
proxy_encryption_method = #{object.proxyEncryptionMethod,jdbcType=VARCHAR},
connection_weight = #{object.connectionWeight,jdbcType=INTEGER},
failover_only = #{object.failoverOnly,jdbcType=BOOLEAN}
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}
</update>
<!-- Delete attributes associated with connection -->
<delete id="deleteAttributes">
DELETE FROM guacamole_connection_attribute
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}
</delete>
<!-- Insert attributes for connection -->
<insert id="insertAttributes" parameterType="org.apache.guacamole.auth.jdbc.base.ArbitraryAttributeModel">
INSERT INTO guacamole_connection_attribute (
connection_id,
attribute_name,
attribute_value
)
VALUES
<foreach collection="object.arbitraryAttributes" item="attribute" separator=",">
(#{object.objectID,jdbcType=INTEGER},
#{attribute.name,jdbcType=VARCHAR},
#{attribute.value,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
``` | /content/code_sandbox/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/resources/org/apache/guacamole/auth/jdbc/connection/ConnectionMapper.xml | xml | 2016-03-22T07:00:06 | 2024-08-16T13:03:48 | guacamole-client | apache/guacamole-client | 1,369 | 2,895 |
```xml
<!--
This file contains XAML styles that simplify application development.
These are not merely convenient, but are required by most Visual Studio project and item templates.
Removing, renaming, or otherwise modifying the content of these files may result in a project that
does not build, or that will not build once additional pages are added. If variations on these
styles are desired it is recommended that you copy the content under a new name and modify your
private copy.
-->
<ResourceDictionary
xmlns="path_to_url"
xmlns:x="path_to_url">
<!-- Non-brush values that vary across themes -->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonSnappedGlyph"></x:String>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonSnappedGlyph"></x:String>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<x:String x:Key="ChevronGlyph"></x:String>
<!-- RichTextBlock styles -->
<Style x:Key="BasicRichTextStyle" TargetType="RichTextBlock">
<Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}"/>
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
<Setter Property="TextTrimming" Value="WordEllipsis"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Typography.StylisticSet20" Value="True"/>
<Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
<Setter Property="Typography.CaseSensitiveForms" Value="True"/>
</Style>
<Style x:Key="BaselineRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BasicRichTextStyle}">
<Setter Property="LineHeight" Value="20"/>
<Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
<!-- Properly align text along its baseline -->
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="4"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ItemRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BaselineRichTextStyle}"/>
<Style x:Key="BodyRichTextStyle" TargetType="RichTextBlock" BasedOn="{StaticResource BaselineRichTextStyle}">
<Setter Property="FontWeight" Value="SemiLight"/>
</Style>
<!-- TextBlock styles -->
<Style x:Key="BasicTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}"/>
<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
<Setter Property="TextTrimming" Value="WordEllipsis"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Typography.StylisticSet20" Value="True"/>
<Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
<Setter Property="Typography.CaseSensitiveForms" Value="True"/>
</Style>
<Style x:Key="BaselineTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BasicTextStyle}">
<Setter Property="LineHeight" Value="20"/>
<Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
<!-- Properly align text along its baseline -->
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="4"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="HeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontSize" Value="56"/>
<Setter Property="FontWeight" Value="Light"/>
<Setter Property="LineHeight" Value="40"/>
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-2" Y="8"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SubheaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontSize" Value="26.667"/>
<Setter Property="FontWeight" Value="Light"/>
<Setter Property="LineHeight" Value="30"/>
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="6"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontWeight" Value="SemiBold"/>
</Style>
<Style x:Key="SubtitleTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontWeight" Value="Normal"/>
</Style>
<Style x:Key="ItemTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}"/>
<Style x:Key="BodyTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontWeight" Value="SemiLight"/>
</Style>
<Style x:Key="CaptionTextStyle" TargetType="TextBlock" BasedOn="{StaticResource BaselineTextStyle}">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
</Style>
<Style x:Key="GroupHeaderTextStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
<Setter Property="TextTrimming" Value="WordEllipsis"/>
<Setter Property="TextWrapping" Value="NoWrap"/>
<Setter Property="Typography.StylisticSet20" Value="True"/>
<Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
<Setter Property="Typography.CaseSensitiveForms" Value="True"/>
<Setter Property="FontSize" Value="26.667"/>
<Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
<Setter Property="FontWeight" Value="Light"/>
<Setter Property="LineHeight" Value="30"/>
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform X="-1" Y="6"/>
</Setter.Value>
</Setter>
</Style>
<!-- Button styles -->
<!--
TextButtonStyle is used to style a Button using subheader-styled text with no other adornment. There
are two styles that are based on TextButtonStyle (TextPrimaryButtonStyle and TextSecondaryButtonStyle)
which are used in the GroupedItemsPage as a group header and in the FileOpenPickerPage for triggering
commands.
-->
<Style x:Key="TextButtonStyle" TargetType="ButtonBase">
<Setter Property="MinWidth" Value="0"/>
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Grid Background="Transparent">
<ContentPresenter x:Name="Text" Content="{TemplateBinding Content}" />
<Rectangle
x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="1.5"/>
<Rectangle
x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="0.5"/>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity"/>
<DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused"/>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked"/>
<VisualState x:Name="Unchecked">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TextPrimaryButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource TextButtonStyle}">
<Setter Property="Foreground" Value="{StaticResource ApplicationHeaderForegroundThemeBrush}"/>
</Style>
<Style x:Key="TextSecondaryButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource TextButtonStyle}">
<Setter Property="Foreground" Value="{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
</Style>
<!--
TextRadioButtonStyle is used to style a RadioButton using subheader-styled text with no other adornment.
This style is used in the SearchResultsPage to allow selection among filters.
-->
<Style x:Key="TextRadioButtonStyle" TargetType="RadioButton" BasedOn="{StaticResource TextButtonStyle}">
<Setter Property="Margin" Value="0,0,30,0"/>
</Style>
<!--
AppBarButtonStyle is used to style a Button (or ToggleButton) for use in an App Bar. Content will be centered
and should fit within the 40 pixel radius glyph provided. 16-point Segoe UI Symbol is used for content text
to simplify the use of glyphs from that font. AutomationProperties.Name is used for the text below the glyph.
-->
<Style x:Key="AppBarButtonStyle" TargetType="ButtonBase">
<Setter Property="Foreground" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="FontFamily" Value="Segoe UI Symbol"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="AutomationProperties.ItemType" Value="App Bar Button"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ButtonBase">
<Grid x:Name="RootGrid" Width="100" Background="Transparent">
<StackPanel VerticalAlignment="Top" Margin="0,12,0,11">
<Grid Width="40" Height="40" Margin="0,0,0,5" HorizontalAlignment="Center">
<TextBlock x:Name="BackgroundGlyph" Text="" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0" Foreground="{StaticResource AppBarItemBackgroundThemeBrush}"/>
<TextBlock x:Name="OutlineGlyph" Text="" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0"/>
<ContentPresenter x:Name="Content" HorizontalAlignment="Center" Margin="-1,-1,0,0" VerticalAlignment="Center"/>
</Grid>
<TextBlock
x:Name="TextLabel"
Text="{TemplateBinding AutomationProperties.Name}"
Foreground="{StaticResource AppBarItemForegroundThemeBrush}"
Margin="0,0,2,0"
FontSize="12"
TextAlignment="Center"
Width="88"
MaxHeight="32"
TextTrimming="WordEllipsis"
Style="{StaticResource BasicTextStyle}"/>
</StackPanel>
<Rectangle
x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="1.5"/>
<Rectangle
x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="0.5"/>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ApplicationViewStates">
<VisualState x:Name="FullScreenLandscape"/>
<VisualState x:Name="Filled"/>
<VisualState x:Name="FullScreenPortrait">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
<DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Snapped">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Width">
<DiscreteObjectKeyFrame KeyTime="0" Value="60"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPointerOverBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
<DoubleAnimation
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation Duration="0" To="0" Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Opacity"/>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundCheckedGlyph" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked"/>
<VisualState x:Name="Indeterminate"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--
Standard AppBarButton Styles for use with Button and ToggleButton
An AppBarButton Style is provided for each of the glyphs in the Segoe UI Symbol font.
Uncomment any style you reference (as not all may be required).
-->
<!--
<Style x:Key="SkipBackAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SkipBackAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Skip Back"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SkipAheadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SkipAheadAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Skip Ahead"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PlayAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PlayAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Play"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PauseAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PauseAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Pause"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="EditAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="EditAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Edit"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SaveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SaveAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Save"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DeleteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DeleteAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Delete"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DiscardAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DiscardAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Discard"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RemoveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RemoveAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Remove"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AddAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AddAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Add"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="NoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="NoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="No"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="YesAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="YesAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Yes"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MoreAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MoreAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="More"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RedoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RedoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Redo"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="UndoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="UndoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Undo"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="HomeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="HomeAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Home"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OutAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OutAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Out"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="NextAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="NextAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Next"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PreviousAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PreviousAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Previous"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FavoriteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FavoriteAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Favorite"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PhotoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PhotoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Photo"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SettingsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SettingsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Settings"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="VideoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="VideoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Video"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RefreshAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RefreshAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Refresh"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DownloadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DownloadAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Download"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MailAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MailAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Mail"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SearchAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SearchAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Search"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="HelpAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="HelpAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Help"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="UploadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="UploadAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Upload"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="EmojiAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="EmojiAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Emoji"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="TwoPageAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="TwoPageAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Two Page"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="LeaveChatAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="LeaveChatAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Upload"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MailForwardAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MailForwardAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Forward Mail"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ClockAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ClockAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Clock"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SendAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SendAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Send"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CropAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CropAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Crop"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RotateCameraAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RotateCameraAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Rotate Camera"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PeopleAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PeopleAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="People"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ClosePaneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ClosePaneAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Close Pane"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OpenPaneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OpenPaneAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Open Pane"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="WorldAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="WorldAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="World"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FlagAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FlagAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Flag"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PreviewLinkAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PreviewLinkAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Preview Link"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="GlobeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="GlobeAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Globe"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="TrimAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="TrimAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Trim"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AttachCameraAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AttachCameraAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Attach Camera"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ZoomInAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ZoomInAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Zoom In"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="BookmarksAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="BookmarksAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Bookmarks"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DocumentAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DocumentAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Document"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ProtectedDocumentAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ProtectedDocumentAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Protected Document"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PageAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PageAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Page"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="BulletsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="BulletsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Bullets"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CommentAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CommentAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Comment"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="Mail2AppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="Mail2AppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Mail2"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ContactInfoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ContactInfoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Contact Info"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="HangUpAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="HangUpAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Hang Up"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ViewAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ViewAllAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="View All"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MapPinAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MapPinAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Map Pin"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PhoneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PhoneAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Phone"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="VideoChatAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="VideoChatAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Video Chat"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SwitchAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SwitchAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Switch"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ContactAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ContactAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Contact"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="RenameAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RenameAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Rename"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PinAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PinAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Pin"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MusicInfoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MusicInfoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Music Info"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="GoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="GoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Go"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="KeyboardAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="KeyboardAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Keyboard"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DockLeftAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DockLeftAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Dock Left"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DockRightAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DockRightAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Dock Right"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DockBottomAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DockBottomAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Dock Bottom"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RemoteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RemoteAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Remote"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SyncAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SyncAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Sync"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RotateAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RotateAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Rotate"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ShuffleAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ShuffleAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Shuffle"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ListAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ListAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="List"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ShopAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ShopAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Shop"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SelectAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SelectAllAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Select All"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OrientationAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OrientationAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Orientation"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ImportAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ImportAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Import"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ImportAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ImportAllAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Import All"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="BrowsePhotosAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="BrowsePhotosAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Browse Photos"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="WebcamAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="WebcamAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Webcam"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="PicturesAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PicturesAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Pictures"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SaveLocalAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SaveLocalAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Save Local"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CaptionAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CaptionAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Caption"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="StopAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="StopAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Stop"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ShowResultsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ShowResultsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Show Results"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="VolumeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="VolumeAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Volume"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RepairAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RepairAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Repair"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MessageAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MessageAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Message"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="Page2AppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="Page2AppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Page2"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CalendarDayAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CalendarDayAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Day"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CalendarWeekAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CalendarWeekAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Week"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CalendarAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CalendarAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Calendar"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CharactersAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CharactersAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Characters"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MailReplyAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MailReplyAllAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Reply All"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ReadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ReadAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Read"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="LinkAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="LinkAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Link"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AccountsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AccountsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Accounts"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ShowBccAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ShowBccAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Show Bcc"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="HideBccAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="HideBccAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Hide Bcc"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="CutAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CutAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Cut"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AttachAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AttachAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Attach"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PasteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PasteAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Paste"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FilterAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FilterAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Filter"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CopyAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CopyAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Copy"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="Emoji2AppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="Emoji2AppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Emoji2"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ImportantAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ImportantAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Important"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MailReplyAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MailReplyAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Reply"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SlideShowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SlideShowAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Slideshow"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SortAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SortAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Sort"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ManageAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ManageAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Manage"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AllAppsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AllAppsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="All Apps"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DisconnectDriveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DisconnectDriveAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Disconnect Drive"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MapDriveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MapDriveAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Map Drive"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="NewWindowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="NewWindowAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="New Window"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OpenWithAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OpenWithAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Open With"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ContactPresenceAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ContactPresenceAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Presence"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PriorityAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PriorityAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Priority"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="UploadSkyDriveAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="UploadSkyDriveAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Skydrive"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="GoToTodayAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="GoToTodayAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Today"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FontAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FontAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Font"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="FontColorAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FontColorAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Font Color"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="Contact2AppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="Contact2AppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Contact"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FolderppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FolderAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Folder"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AudioAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AudioAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Audio"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PlaceholderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PlaceholderAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Placeholder"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ViewAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ViewAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="View"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SetLockScreenAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SetLockscreenAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Set Lockscreen"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SetTitleAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SetTitleAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Set Title"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CcAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CcAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Cc"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="StopSlideShowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="StopSlideshowAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Stop Slideshow"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PermissionsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PermissionsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Permisions"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="HighlightAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="HighlightAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Highlight"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DisableUpdatesAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DisableUpdatesAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Disable Updates"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="UnfavoriteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="UnfavoriteAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Unfavorite"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="UnPinAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="UnPinAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Unpin"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OpenLocalAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OpenLocalAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Open Loal"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MuteAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MuteAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Mute"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ItalicAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ItalicAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Italic"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="UnderlineAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="UnderlineAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Underline"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="BoldAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="BoldAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Bold"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MoveToFolderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MoveToFolderAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Move to Folder"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="LikeDislikeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="LikeDislikeAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Like/Dislike"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DislikeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DislikeAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Dislike"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="LikeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="LikeAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Like"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AlignRightAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AlignRightAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Align Right"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AlignCenterAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AlignCenterAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Align Center"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AlignLeftAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AlignLeftAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Align Left"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ZoomAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ZoomAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Zoom"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ZoomOutAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ZoomOutAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Zoom Out"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OpenFileAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OpenFileAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Open File"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OtherUserAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OtherUserAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Other User"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AdminAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AdminAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Admin"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="StreetAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="StreetAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Street"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MapAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MapAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Map"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ClearSelectionAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ClearSelectionAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Clear Selection"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FontDecreaseAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FontDecreaseAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Decrease Font"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FontIncreaseAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FontIncreaseAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Increase Font"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FontSizeAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FontSizeAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Font Size"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="CellphoneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CellphoneAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Cellphone"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ReshareAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ReshareAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Reshare"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="TagAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="TagAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Tag"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RepeatOneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RepeatOneAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Repeat Once"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="RepeatAllAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="RepeatAllAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Repeat All"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OutlineStarAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OutlineStarAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Outline Star"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SolidStarAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SolidStarAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Solid Star"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CalculatorAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CalculatorAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Calculator"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="DirectionsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="DirectionsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Directions"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="TargetAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="TargetAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Target"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="LibraryAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="LibraryAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Library"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PhonebookAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PhonebookAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Phonebook"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MemoAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MemoAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Memo"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="MicrophoneAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="MicrophoneAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Microphone"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="PostUpdateAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="PostUpdateAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Post Update"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="BackToWindowAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="BackToWindowAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Back to Window"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!--
<Style x:Key="FullScreenAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FullScreenAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Full Screen"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="NewFolderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="NewFolderAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="New Folder"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="CalendarReplyAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="CalendarReplyAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Calendar Reply"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="UnsyncFolderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="UnsyncFolderAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Unsync Folder"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ReportHackedAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ReportHackedAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Report Hacked"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SyncFolderAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SyncFolderAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Sync Folder"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="BlockContactAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="Block ContactAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="BlockContact"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="SwitchAppsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SwitchAppsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Switch Apps"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="AddFriendAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="AddFriendAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Add Friend"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="TouchPointerAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="TouchPointerAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Touch Pointer"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="GoToStartAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="GoToStartAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Go to Start"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ZeroBarsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ZeroBarsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Zero Bars"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="OneBarAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="OneBarAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="One Bar"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="TwoBarsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="TwoBarsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Two Bars"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="ThreeBarsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="ThreeBarsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Three Bars"/>
<Setter Property="Content" Value=""/>
</Style>
<Style x:Key="FourBarsAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="FourBarsAppBarButton"/>
<Setter Property="AutomationProperties.Name" Value="Four Bars"/>
<Setter Property="Content" Value=""/>
</Style>
-->
<!-- Title area styles -->
<Style x:Key="PageHeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource HeaderTextStyle}">
<Setter Property="TextWrapping" Value="NoWrap"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Margin" Value="0,0,30,40"/>
</Style>
<Style x:Key="PageSubheaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource SubheaderTextStyle}">
<Setter Property="TextWrapping" Value="NoWrap"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Margin" Value="0,0,0,40"/>
</Style>
<Style x:Key="SnappedPageHeaderTextStyle" TargetType="TextBlock" BasedOn="{StaticResource PageSubheaderTextStyle}">
<Setter Property="Margin" Value="0,0,18,40"/>
</Style>
<!--
BackButtonStyle is used to style a Button for use in the title area of a page. Margins appropriate for
the conventional page layout are included as part of the style.
-->
<Style x:Key="BackButtonStyle" TargetType="Button">
<Setter Property="MinWidth" Value="0"/>
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="48"/>
<Setter Property="Margin" Value="36,0,36,36"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="FontFamily" Value="Segoe UI Symbol"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="FontSize" Value="56"/>
<Setter Property="AutomationProperties.AutomationId" Value="BackButton"/>
<Setter Property="AutomationProperties.Name" Value="Back"/>
<Setter Property="AutomationProperties.ItemType" Value="Navigation Button"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid">
<Grid Margin="-1,-16,0,0">
<TextBlock x:Name="BackgroundGlyph" Text="" Foreground="{StaticResource BackButtonBackgroundThemeBrush}"/>
<TextBlock x:Name="NormalGlyph" Text="{StaticResource BackButtonGlyph}" Foreground="{StaticResource BackButtonForegroundThemeBrush}"/>
<TextBlock x:Name="ArrowGlyph" Text="" Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}" Opacity="0"/>
</Grid>
<Rectangle
x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="1.5"/>
<Rectangle
x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="0.5"/>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation
Storyboard.TargetName="ArrowGlyph"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
<DoubleAnimation
Storyboard.TargetName="NormalGlyph"
Storyboard.TargetProperty="Opacity"
To="0"
Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
<DoubleAnimation
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--
PortraitBackButtonStyle is used to style a Button for use in the title area of a portrait page. Margins appropriate
for the conventional page layout are included as part of the style.
-->
<Style x:Key="PortraitBackButtonStyle" TargetType="Button" BasedOn="{StaticResource BackButtonStyle}">
<Setter Property="Margin" Value="26,0,26,36"/>
</Style>
<!--
SnappedBackButtonStyle is used to style a Button for use in the title area of a snapped page. Margins appropriate
for the conventional page layout are included as part of the style.
The obvious duplication here is necessary as the glyphs used in snapped are not merely smaller versions of the same
glyph but are actually distinct.
-->
<Style x:Key="SnappedBackButtonStyle" TargetType="Button">
<Setter Property="MinWidth" Value="0"/>
<Setter Property="Margin" Value="20,0,0,0"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="FontFamily" Value="Segoe UI Symbol"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="FontSize" Value="26.66667"/>
<Setter Property="AutomationProperties.AutomationId" Value="BackButton"/>
<Setter Property="AutomationProperties.Name" Value="Back"/>
<Setter Property="AutomationProperties.ItemType" Value="Navigation Button"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="RootGrid" Width="36" Height="36" Margin="-3,0,7,33">
<Grid Margin="-1,-1,0,0">
<TextBlock x:Name="BackgroundGlyph" Text="" Foreground="{StaticResource BackButtonBackgroundThemeBrush}"/>
<TextBlock x:Name="NormalGlyph" Text="{StaticResource BackButtonSnappedGlyph}" Foreground="{StaticResource BackButtonForegroundThemeBrush}"/>
<TextBlock x:Name="ArrowGlyph" Text="" Foreground="{StaticResource BackButtonPressedForegroundThemeBrush}" Opacity="0"/>
</Grid>
<Rectangle
x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="1.5"/>
<Rectangle
x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="0.5"/>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverBackgroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource BackButtonForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation
Storyboard.TargetName="ArrowGlyph"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
<DoubleAnimation
Storyboard.TargetName="NormalGlyph"
Storyboard.TargetProperty="Opacity"
To="0"
Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
<DoubleAnimation
Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused" />
<VisualState x:Name="PointerFocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Item templates -->
<!-- Grid-appropriate 250 pixel square item template as seen in the GroupedItemsPage and ItemsPage -->
<DataTemplate x:Key="Standard250x250ItemTemplate">
<Grid HorizontalAlignment="Left" Width="250" Height="250">
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image Source="{Binding Image}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
</Border>
<StackPanel VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}">
<TextBlock Text="{Binding Title}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}" Height="60" Margin="15,0,15,0"/>
<TextBlock Text="{Binding Subtitle}" Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,15,10"/>
</StackPanel>
</Grid>
</DataTemplate>
<!-- Grid-appropriate 500 by 130 pixel item template as seen in the GroupDetailPage -->
<DataTemplate x:Key="Standard500x130ItemTemplate">
<Grid Height="110" Width="480" Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110">
<Image Source="{Binding Image}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
</Border>
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
<TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextStyle}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" MaxHeight="60"/>
</StackPanel>
</Grid>
</DataTemplate>
<!-- List-appropriate 130 pixel high item template as seen in the SplitPage -->
<DataTemplate x:Key="Standard130ItemTemplate">
<Grid Height="110" Margin="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="110" Height="110">
<Image Source="{Binding Image}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
</Border>
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
<TextBlock Text="{Binding Title}" Style="{StaticResource TitleTextStyle}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" MaxHeight="60"/>
</StackPanel>
</Grid>
</DataTemplate>
<!--
List-appropriate 80 pixel high item template as seen in the SplitPage when Filled, and
the following pages when snapped: GroupedItemsPage, GroupDetailPage, and ItemsPage
-->
<DataTemplate x:Key="Standard80ItemTemplate">
<Grid Margin="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Width="60" Height="60">
<Image Source="{Binding Image}" Stretch="UniformToFill"/>
</Border>
<StackPanel Grid.Column="1" Margin="10,0,0,0">
<TextBlock Text="{Binding Title}" Style="{StaticResource ItemTextStyle}" MaxHeight="40"/>
<TextBlock Text="{Binding Subtitle}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap"/>
</StackPanel>
</Grid>
</DataTemplate>
<!-- Grid-appropriate 300 by 70 pixel item template as seen in the SearchResultsPage -->
<DataTemplate x:Key="StandardSmallIcon300x70ItemTemplate">
<Grid Width="294" Margin="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="0,0,0,10" Width="40" Height="40">
<Image Source="{Binding Image}" Stretch="UniformToFill"/>
</Border>
<StackPanel Grid.Column="1" Margin="10,-10,0,0">
<TextBlock Text="{Binding Title}" Style="{StaticResource BodyTextStyle}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Subtitle}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
</StackPanel>
</Grid>
</DataTemplate>
<!-- List-appropriate 70 pixel high item template as seen in the SearchResultsPage when Snapped -->
<DataTemplate x:Key="StandardSmallIcon70ItemTemplate">
<Grid Margin="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="0,0,0,10" Width="40" Height="40">
<Image Source="{Binding Image}" Stretch="UniformToFill"/>
</Border>
<StackPanel Grid.Column="1" Margin="10,-10,0,0">
<TextBlock Text="{Binding Title}" Style="{StaticResource BodyTextStyle}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Subtitle}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
<TextBlock Text="{Binding Description}" Style="{StaticResource BodyTextStyle}" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" TextWrapping="NoWrap"/>
</StackPanel>
</Grid>
</DataTemplate>
<!--
190x130 pixel item template for displaying file previews as seen in the FileOpenPickerPage
Includes an elaborate tooltip to display title and description text
-->
<DataTemplate x:Key="StandardFileWithTooltip190x130ItemTemplate">
<Grid>
<Grid Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
<Image
Source="{Binding Image}"
Width="190"
Height="130"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"/>
</Grid>
<ToolTipService.Placement>Mouse</ToolTipService.Placement>
<ToolTipService.ToolTip>
<ToolTip>
<ToolTip.Style>
<Style TargetType="ToolTip">
<Setter Property="BorderBrush" Value="{StaticResource ToolTipBackgroundThemeBrush}" />
<Setter Property="Padding" Value="0" />
</Style>
</ToolTip.Style>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}" Margin="20">
<Image
Source="{Binding Image}"
Width="160"
Height="160"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"/>
</Grid>
<StackPanel Width="200" Grid.Column="1" Margin="0,20,20,20">
<TextBlock Text="{Binding Title}" TextWrapping="NoWrap" Style="{StaticResource BodyTextStyle}"/>
<TextBlock Text="{Binding Description}" MaxHeight="140" Foreground="{StaticResource ApplicationSecondaryForegroundThemeBrush}" Style="{StaticResource BodyTextStyle}"/>
</StackPanel>
</Grid>
</ToolTip>
</ToolTipService.ToolTip>
</Grid>
</DataTemplate>
<!-- ScrollViewer styles -->
<Style x:Key="HorizontalScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="VerticalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Enabled" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
</Style>
<Style x:Key="VerticalScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled" />
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled" />
</Style>
<!-- Page layout roots typically use entrance animations and a theme-appropriate background color -->
<Style x:Key="LayoutRootStyle" TargetType="Panel">
<Setter Property="Background" Value="{StaticResource ApplicationPageBackgroundThemeBrush}"/>
<Setter Property="ChildrenTransitions">
<Setter.Value>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
``` | /content/code_sandbox/Clients/WindowsRTDemo/Common/StandardStyles.xaml | xml | 2016-10-27T20:15:17 | 2024-08-16T02:15:03 | ZXing.Net | micjahn/ZXing.Net | 2,676 | 23,542 |
```xml
import { useEffect } from "react";
import { GetStaticPaths, GetStaticProps } from "next";
import NotFound from "src/NotFound";
import Layout from "src/Layout";
import {
RenderingType,
SitecoreContext,
ComponentPropsContext,
handleEditorFastRefresh,
EditingComponentPlaceholder,
StaticPath,
} from "@sitecore-jss/sitecore-jss-nextjs";
import { SitecorePageProps } from "lib/page-props";
import { sitecorePagePropsFactory } from "lib/page-props-factory";
// different componentFactory method will be used based on whether page is being edited
import {
componentFactory,
editingComponentFactory,
} from "temp/componentFactory";
import { sitemapFetcher } from "lib/sitemap-fetcher";
const SitecorePage = ({
notFound,
componentProps,
layoutData,
}: SitecorePageProps): JSX.Element => {
useEffect(() => {
// Since Sitecore editors do not support Fast Refresh, need to refresh editor chromes after Fast Refresh finished
handleEditorFastRefresh();
}, []);
if (notFound || !layoutData.sitecore.route) {
// Shouldn't hit this (as long as 'notFound' is being returned below), but just to be safe
return <NotFound />;
}
const isEditing = layoutData.sitecore.context.pageEditing;
const isComponentRendering =
layoutData.sitecore.context.renderingType === RenderingType.Component;
return (
<ComponentPropsContext value={componentProps}>
<SitecoreContext
componentFactory={
isEditing ? editingComponentFactory : componentFactory
}
layoutData={layoutData}
>
{/*
Sitecore Pages supports component rendering to avoid refreshing the entire page during component editing.
If you are using Experience Editor only, this logic can be removed, Layout can be left.
*/}
{isComponentRendering ? (
<EditingComponentPlaceholder rendering={layoutData.sitecore.route} />
) : (
<Layout layoutData={layoutData} />
)}
</SitecoreContext>
</ComponentPropsContext>
);
};
// This function gets called at build and export time to determine
// pages for SSG ("paths", as tokenized array).
export const getStaticPaths: GetStaticPaths = async (context) => {
// Fallback, along with revalidate in getStaticProps (below),
// enables Incremental Static Regeneration. This allows us to
// leave certain (or all) paths empty if desired and static pages
// will be generated on request (development mode in this example).
// Alternatively, the entire sitemap could be pre-rendered
// ahead of time (non-development mode in this example).
// See path_to_url
let paths: StaticPath[] = [];
let fallback: boolean | "blocking" = "blocking";
if (
process.env.NODE_ENV !== "development" &&
!process.env.DISABLE_SSG_FETCH
) {
try {
// Note: Next.js runs export in production mode
paths = await sitemapFetcher.fetch(context);
} catch (error) {
console.log("Error occurred while fetching static paths");
console.log(error);
}
fallback = process.env.EXPORT_MODE ? false : fallback;
}
return {
paths,
fallback,
};
};
// This function gets called at build time on server-side.
// It may be called again, on a serverless function, if
// revalidation (or fallback) is enabled and a new request comes in.
export const getStaticProps: GetStaticProps = async (context) => {
const props = await sitecorePagePropsFactory.create(context);
return {
props,
// Next.js will attempt to re-generate the page:
// - When a request comes in
// - At most once every 5 seconds
revalidate: 5, // In seconds
notFound: props.notFound, // Returns custom 404 page with a status code of 404 when true
};
};
export default SitecorePage;
``` | /content/code_sandbox/examples/cms-sitecore-xmcloud/src/pages/[[...path]].tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 862 |
```xml
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input, NgModule, ViewEncapsulation } from '@angular/core';
/**
* ProgressSpinner is a process status indicator.
* @group Components
*/
@Component({
selector: 'p-progressSpinner',
template: `
<div class="p-progress-spinner" [ngStyle]="style" [ngClass]="styleClass" role="progressbar" [attr.aria-label]="ariaLabel" [attr.aria-busy]="true" [attr.data-pc-name]="'progressspinner'" [attr.data-pc-section]="'root'">
<svg class="p-progress-spinner-svg" viewBox="25 25 50 50" [style.animation-duration]="animationDuration" [attr.data-pc-section]="'root'">
<circle class="p-progress-spinner-circle" cx="50" cy="50" r="20" [attr.fill]="fill" [attr.stroke-width]="strokeWidth" stroke-miterlimit="10" />
</svg>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
styleUrls: ['./progressspinner.css'],
host: {
class: 'p-element'
}
})
export class ProgressSpinner {
/**
* Class of the element.
* @group Props
*/
@Input() styleClass: string | undefined;
/**
* Inline style of the element.
* @group Props
*/
@Input() style: { [klass: string]: any } | null | undefined;
/**
* Width of the circle stroke.
* @group Props
*/
@Input() strokeWidth: string = '2';
/**
* Color for the background of the circle.
* @group Props
*/
@Input() fill: string = 'none';
/**
* Duration of the rotate animation.
* @group Props
*/
@Input() animationDuration: string = '2s';
/**
* Used to define a aria label attribute the current element.
* @group Props
*/
@Input() ariaLabel: string | undefined;
}
@NgModule({
imports: [CommonModule],
exports: [ProgressSpinner],
declarations: [ProgressSpinner]
})
export class ProgressSpinnerModule {}
``` | /content/code_sandbox/src/app/components/progressspinner/progressspinner.ts | xml | 2016-01-16T09:23:28 | 2024-08-16T19:58:20 | primeng | primefaces/primeng | 9,969 | 488 |
```xml
import { type FC, useCallback } from 'react';
import { c } from 'ttag';
import { CircleLoader } from '@proton/atoms/CircleLoader';
import { InlineLinkButton } from '@proton/atoms/InlineLinkButton';
import { Icon } from '@proton/components/components';
import { NotificationButton } from '@proton/components/containers';
import { usePassCore } from '@proton/pass/components/Core/PassCoreProvider';
import { AccountPath } from '@proton/pass/constants';
import { useNavigateToAccount } from '@proton/pass/hooks/useNavigateToAccount';
import type { Notification } from '@proton/pass/store/actions/enhancers/notification';
import { NotificationKey } from '@proton/pass/types/worker/notification';
import { usePassConfig } from './usePassConfig';
type NotificationEnhancerOptions = { onLink: (url: string) => void };
const ReactivateLink: FC<NotificationEnhancerOptions> = ({ onLink }) => {
const { SSO_URL } = usePassConfig();
return (
<InlineLinkButton
key="reactivate-link"
className="text-semibold"
onClick={() => onLink(`${SSO_URL}/encryption-keys`)}
>
{c('Action').t`Learn more`} <Icon name="arrow-out-square" />{' '}
</InlineLinkButton>
);
};
export const useNotificationEnhancer = () => {
const { onLink } = usePassCore();
const navigateToAccount = useNavigateToAccount(AccountPath.ACCOUNT_PASSWORD_2FA);
return useCallback((notification: Notification): Notification => {
const reactivateLink = <ReactivateLink onLink={onLink} key="reactactivate-link" />;
switch (notification.key) {
case NotificationKey.INACTIVE_SHARES: {
return {
...notification,
text: (
<div>
{c('Error')
.jt`Some vaults are no longer accessible due to a password reset. Reactivate your account keys in order to regain access. ${reactivateLink}`}
</div>
),
};
}
case NotificationKey.ORG_MISSING_2FA: {
return {
...notification,
text: (
<>
<span>{c('Info')
.t`Your account is restricted because your organization has enforced two-factor authentication. Please enable two-factor authentication in your Account Settings or contact your administrator.`}</span>
<NotificationButton onClick={navigateToAccount}>
{c('Action').t`Setup 2FA`}
</NotificationButton>
</>
),
};
}
default:
return {
...notification,
showCloseButton: notification.showCloseButton && !notification.loading,
text: notification.loading ? (
<>
{notification.text} <CircleLoader />
</>
) : (
`${notification.text}${notification.errorMessage ? ` (${notification.errorMessage})` : ''}`
),
};
}
}, []);
};
``` | /content/code_sandbox/packages/pass/hooks/useNotificationEnhancer.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 623 |
```xml
import path from 'node:path';
import { defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths';
const CWD = process.cwd();
export default defineConfig({
test: {
globals: true,
alias: {
'graphql-config': path.join(CWD, 'src', 'index.ts'),
// fixes Duplicate "graphql" modules cannot be used at the same time since different
graphql: path.join(CWD, 'node_modules', 'graphql', 'index.js'),
},
},
plugins: [tsconfigPaths()],
});
``` | /content/code_sandbox/vitest.config.ts | xml | 2016-07-29T09:54:26 | 2024-08-08T15:15:52 | graphql-config | kamilkisiela/graphql-config | 1,160 | 124 |
```xml
// See LICENSE in the project root for license information.
/* eslint-disable @typescript-eslint/no-redeclare */
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
import type { DeserializerContext } from '../model/DeserializerContext';
/**
* Constructor options for {@link (IApiOptionalMixinOptions:interface)}.
* @public
*/
export interface IApiOptionalMixinOptions extends IApiItemOptions {
isOptional: boolean;
}
export interface IApiOptionalMixinJson extends IApiItemJson {
isOptional: boolean;
}
const _isOptional: unique symbol = Symbol('ApiOptionalMixin._isOptional');
/**
* The mixin base class for API items that can be marked as optional by appending a `?` to them.
* For example, a property of an interface can be optional.
*
* @remarks
*
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
* API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use
* TypeScript "mixin" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various
* features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class
* to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components:
* the function that generates a subclass, an interface that describes the members of the subclass, and
* a namespace containing static members of the class.
*
* @public
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ApiOptionalMixin extends ApiItem {
/**
* True if this is an optional property.
* @remarks
* For example:
* ```ts
* interface X {
* y: string; // not optional
* z?: string; // optional
* }
* ```
*/
readonly isOptional: boolean;
/** @override */
serializeInto(jsonObject: Partial<IApiItemJson>): void;
}
/**
* Mixin function for {@link (ApiOptionalMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiOptionalMixin:interface)} functionality.
*
* @public
*/
export function ApiOptionalMixin<TBaseClass extends IApiItemConstructor>(
baseClass: TBaseClass
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): TBaseClass & (new (...args: any[]) => ApiOptionalMixin) {
class MixedClass extends baseClass implements ApiOptionalMixin {
public [_isOptional]: boolean;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public constructor(...args: any[]) {
super(...args);
const options: IApiOptionalMixinOptions = args[0];
this[_isOptional] = !!options.isOptional;
}
/** @override */
public static onDeserializeInto(
options: Partial<IApiOptionalMixinOptions>,
context: DeserializerContext,
jsonObject: IApiOptionalMixinJson
): void {
baseClass.onDeserializeInto(options, context, jsonObject);
options.isOptional = !!jsonObject.isOptional;
}
public get isOptional(): boolean {
return this[_isOptional];
}
/** @override */
public serializeInto(jsonObject: Partial<IApiOptionalMixinJson>): void {
super.serializeInto(jsonObject);
jsonObject.isOptional = this.isOptional;
}
}
return MixedClass;
}
/**
* Optional members for {@link (ApiOptionalMixin:interface)}.
* @public
*/
export namespace ApiOptionalMixin {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiOptionalMixin` mixin.
*
* @remarks
*
* The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
* the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
* the TypeScript type system cannot invoke a runtime test.)
*/
export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiOptionalMixin {
return apiItem.hasOwnProperty(_isOptional);
}
}
``` | /content/code_sandbox/libraries/api-extractor-model/src/mixins/ApiOptionalMixin.ts | xml | 2016-09-30T00:28:20 | 2024-08-16T18:54:35 | rushstack | microsoft/rushstack | 5,790 | 935 |
```xml
import { AsyncIterableX } from '../asynciterablex.js';
import { MonoTypeOperatorAsyncFunction } from '../../interfaces.js';
import { wrapWithAbort } from './withabort.js';
import { throwIfAborted } from '../../aborterror.js';
/** @ignore */
export class SkipLastAsyncIterable<TSource> extends AsyncIterableX<TSource> {
private _source: AsyncIterable<TSource>;
private _count: number;
constructor(source: AsyncIterable<TSource>, count: number) {
super();
this._source = source;
this._count = count;
}
async *[Symbol.asyncIterator](signal?: AbortSignal) {
throwIfAborted(signal);
const q = [] as TSource[];
for await (const item of wrapWithAbort(this._source, signal)) {
q.push(item);
if (q.length > this._count) {
yield q.shift()!;
}
}
}
}
/**
* Bypasses a specified number of elements at the end of an async-iterable sequence.
*
* @template TSource The type of the elements in the source sequence.
* @param {number} count Number of elements to bypass at the end of the source sequence.
* @returns {MonoTypeOperatorAsyncFunction<TSource>} An async-iterable sequence containing the
* source sequence elements except for the bypassed ones at the end.
*/
export function skipLast<TSource>(count: number): MonoTypeOperatorAsyncFunction<TSource> {
return function skipLastOperatorFunction(
source: AsyncIterable<TSource>
): AsyncIterableX<TSource> {
return new SkipLastAsyncIterable<TSource>(source, count);
};
}
``` | /content/code_sandbox/src/asynciterable/operators/skiplast.ts | xml | 2016-02-22T20:04:19 | 2024-08-09T18:46:41 | IxJS | ReactiveX/IxJS | 1,319 | 344 |
```xml
import { NextRequest, NextResponse } from 'next/server'
export const runtime = 'edge'
let count = 0
export const GET = async (req: NextRequest) => {
await fetch(req.nextUrl)
count++
return NextResponse.json({ count })
}
``` | /content/code_sandbox/test/e2e/app-dir/app-routes-subrequests/app/route.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 59 |
```xml
import { PermissionResponse } from 'expo-modules-core';
// @needsAudit
/**
* Enum with available location accuracies.
*/
export enum LocationAccuracy {
/**
* Accurate to the nearest three kilometers.
*/
Lowest = 1,
/**
* Accurate to the nearest kilometer.
*/
Low = 2,
/**
* Accurate to within one hundred meters.
*/
Balanced = 3,
/**
* Accurate to within ten meters of the desired target.
*/
High = 4,
/**
* The best level of accuracy available.
*/
Highest = 5,
/**
* The highest possible accuracy that uses additional sensor data to facilitate navigation apps.
*/
BestForNavigation = 6,
}
// @needsAudit
/**
* Enum with available activity types of background location tracking.
*/
export enum LocationActivityType {
/**
* Default activity type. Use it if there is no other type that matches the activity you track.
*/
Other = 1,
/**
* Location updates are being used specifically during vehicular navigation to track location
* changes to the automobile.
*/
AutomotiveNavigation = 2,
/**
* Use this activity type if you track fitness activities such as walking, running, cycling,
* and so on.
*/
Fitness = 3,
/**
* Activity type for movements for other types of vehicular navigation that are not automobile
* related.
*/
OtherNavigation = 4,
/**
* Intended for airborne activities. Fall backs to `ActivityType.Other` if
* unsupported.
* @platform ios
*/
Airborne = 5,
}
// @needsAudit
/**
* A type of the event that geofencing task can receive.
*/
export enum LocationGeofencingEventType {
/**
* Emitted when the device entered observed region.
*/
Enter = 1,
/**
* Occurs as soon as the device left observed region
*/
Exit = 2,
}
// @needsAudit
/**
* State of the geofencing region that you receive through the geofencing task.
*/
export enum LocationGeofencingRegionState {
/**
* Indicates that the device position related to the region is unknown.
*/
Unknown = 0,
/**
* Indicates that the device is inside the region.
*/
Inside = 1,
/**
* Inverse of inside state.
*/
Outside = 2,
}
// @needsAudit
/**
* Type representing options argument in `getCurrentPositionAsync`.
*/
export type LocationOptions = {
/**
* Location manager accuracy. Pass one of `Accuracy` enum values.
* For low-accuracies the implementation can avoid geolocation providers
* that consume a significant amount of power (such as GPS).
*/
accuracy?: LocationAccuracy;
/**
* Specifies whether to ask the user to turn on improved accuracy location mode
* which uses Wi-Fi, cell networks and GPS sensor.
* @default true
* @platform android
*/
mayShowUserSettingsDialog?: boolean;
/**
* Minimum time to wait between each update in milliseconds.
* Default value may depend on `accuracy` option.
* @platform android
*/
timeInterval?: number;
/**
* Receive updates only when the location has changed by at least this distance in meters.
* Default value may depend on `accuracy` option.
*/
distanceInterval?: number;
};
// @needsAudit
/**
* Type representing options object that can be passed to `getLastKnownPositionAsync`.
*/
export type LocationLastKnownOptions = {
/**
* A number of milliseconds after which the last known location starts to be invalid and thus
* `null` is returned.
*/
maxAge?: number;
/**
* The maximum radius of uncertainty for the location, measured in meters. If the last known
* location's accuracy radius is bigger (less accurate) then `null` is returned.
*/
requiredAccuracy?: number;
};
// @needsAudit
/**
* Type representing background location task options.
*/
export type LocationTaskOptions = LocationOptions & {
/**
* A boolean indicating whether the status bar changes its appearance when
* location services are used in the background.
* @default false
* @platform ios
*/
showsBackgroundLocationIndicator?: boolean;
/**
* The distance in meters that must occur between last reported location and the current location
* before deferred locations are reported.
* @default 0
*/
deferredUpdatesDistance?: number;
// @docsMissing
deferredUpdatesTimeout?: number;
/**
* Minimum time interval in milliseconds that must pass since last reported location before all
* later locations are reported in a batched update
* @default 0
*/
deferredUpdatesInterval?: number;
/**
* The type of user activity associated with the location updates.
* @see See [Apple docs](path_to_url for more details.
* @default ActivityType.Other
* @platform ios
*/
activityType?: LocationActivityType;
/**
* A boolean value indicating whether the location manager can pause location
* updates to improve battery life without sacrificing location data. When this option is set to
* `true`, the location manager pauses updates (and powers down the appropriate hardware) at times
* when the location data is unlikely to change. You can help the determination of when to pause
* location updates by assigning a value to the `activityType` property.
* @default false
* @platform ios
*/
pausesUpdatesAutomatically?: boolean;
foregroundService?: LocationTaskServiceOptions;
};
// @needsAudit
export type LocationTaskServiceOptions = {
/**
* Title of the foreground service notification.
*/
notificationTitle: string;
/**
* Subtitle of the foreground service notification.
*/
notificationBody: string;
/**
* Color of the foreground service notification. Accepts `#RRGGBB` and `#AARRGGBB` hex formats.
*/
notificationColor?: string;
/**
* Boolean value whether to destroy the foreground service if the app is killed.
*/
killServiceOnDestroy?: boolean;
};
// @needsAudit
/**
* Type representing geofencing region object.
*/
export type LocationRegion = {
/**
* The identifier of the region object. Defaults to auto-generated UUID hash.
*/
identifier?: string;
/**
* The latitude in degrees of region's center point.
*/
latitude: number;
/**
* The longitude in degrees of region's center point.
*/
longitude: number;
/**
* The radius measured in meters that defines the region's outer boundary.
*/
radius: number;
/**
* Boolean value whether to call the task if the device enters the region.
* @default true
*/
notifyOnEnter?: boolean;
/**
* Boolean value whether to call the task if the device exits the region.
* @default true
*/
notifyOnExit?: boolean;
/**
* One of [GeofencingRegionState](#geofencingregionstate) region state. Determines whether the
* device is inside or outside a region.
*/
state?: LocationGeofencingRegionState;
};
// @needsAudit
/**
* Type representing the location object.
*/
export type LocationObject = {
/**
* The coordinates of the position.
*/
coords: LocationObjectCoords;
/**
* The time at which this position information was obtained, in milliseconds since epoch.
*/
timestamp: number;
/**
* Whether the location coordinates is mocked or not.
* @platform android
*/
mocked?: boolean;
};
// @needsAudit
/**
* Type representing the location GPS related data.
*/
export type LocationObjectCoords = {
/**
* The latitude in degrees.
*/
latitude: number;
/**
* The longitude in degrees.
*/
longitude: number;
/**
* The altitude in meters above the WGS 84 reference ellipsoid. Can be `null` on Web if it's not available.
*/
altitude: number | null;
/**
* The radius of uncertainty for the location, measured in meters. Can be `null` on Web if it's not available.
*/
accuracy: number | null;
/**
* The accuracy of the altitude value, in meters. Can be `null` on Web if it's not available.
*/
altitudeAccuracy: number | null;
/**
* Horizontal direction of travel of this device, measured in degrees starting at due north and
* continuing clockwise around the compass. Thus, north is 0 degrees, east is 90 degrees, south is
* 180 degrees, and so on. Can be `null` on Web if it's not available.
*/
heading: number | null;
/**
* The instantaneous speed of the device in meters per second. Can be `null` on Web if it's not available.
*/
speed: number | null;
};
// @needsAudit
/**
* Represents `watchPositionAsync` callback.
*/
export type LocationCallback = (location: LocationObject) => any;
// @needsAudit
/**
* Represents the object containing details about location provider.
*/
export type LocationProviderStatus = {
/**
* Whether location services are enabled. See [Location.hasServicesEnabledAsync](#locationhasservicesenabledasync)
* for a more convenient solution to get this value.
*/
locationServicesEnabled: boolean;
// @docsMissing
backgroundModeEnabled: boolean;
/**
* Whether the GPS provider is available. If `true` the location data will come
* from GPS, especially for requests with high accuracy.
* @platform android
*/
gpsAvailable?: boolean;
/**
* Whether the network provider is available. If `true` the location data will
* come from cellular network, especially for requests with low accuracy.
* @platform android
*/
networkAvailable?: boolean;
/**
* Whether the passive provider is available. If `true` the location data will
* be determined passively.
* @platform android
*/
passiveAvailable?: boolean;
};
// @needsAudit
/**
* Type of the object containing heading details and provided by `watchHeadingAsync` callback.
*/
export type LocationHeadingObject = {
/**
* Measure of true north in degrees (needs location permissions, will return `-1` if not given).
*/
trueHeading: number;
/**
* Measure of magnetic north in degrees.
*/
magHeading: number;
/**
* Level of calibration of compass:
* - `3`: high accuracy
* - `2`: medium accuracy
* - `1`: low accuracy
* - `0`: none
*
* Reference for iOS:
* - `3`: < 20 degrees uncertainty
* - `2`: < 35 degrees
* - `1`: < 50 degrees
* - `0`: > 50 degrees
*/
accuracy: number;
};
// @needsAudit
/**
* Represents `watchHeadingAsync` callback.
*/
export type LocationHeadingCallback = (location: LocationHeadingObject) => any;
// @needsAudit
/**
* Type representing a result of `geocodeAsync`.
*/
export type LocationGeocodedLocation = {
/**
* The latitude in degrees.
*/
latitude: number;
/**
* The longitude in degrees.
*/
longitude: number;
/**
* The altitude in meters above the WGS 84 reference ellipsoid.
*/
altitude?: number;
/**
* The radius of uncertainty for the location, measured in meters.
*/
accuracy?: number;
};
// @needsAudit
/**
* Type representing a result of `reverseGeocodeAsync`.
*/
export type LocationGeocodedAddress = {
/**
* City name of the address.
*/
city: string | null;
/**
* Additional city-level information like district name.
*/
district: string | null;
/**
* Street number of the address.
*/
streetNumber: string | null;
/**
* Street name of the address.
*/
street: string | null;
/**
* The state or province associated with the address.
*/
region: string | null;
/**
* Additional information about administrative area.
*/
subregion: string | null;
/**
* Localized country name of the address.
*/
country: string | null;
/**
* Postal code of the address.
*/
postalCode: string | null;
/**
* The name of the placemark, for example, "Tower Bridge".
*/
name: string | null;
/**
* Localized (ISO) country code of the address, if available.
*/
isoCountryCode: string | null;
/**
* The timezone identifier associated with the address.
* @platform ios
*/
timezone: string | null;
/**
* Composed string of the address components, for example, "111 8th Avenue, New York, NY".
* @platform android
*/
formattedAddress: string | null;
};
// @needsAudit
/**
* Represents subscription object returned by methods watching for new locations or headings.
*/
export type LocationSubscription = {
/**
* Call this function with no arguments to remove this subscription. The callback will no longer
* be called for location updates.
*/
remove: () => void;
};
// @needsAudit
export type PermissionDetailsLocationIOS = {
/**
* The scope of granted permission. Indicates when it's possible to use location.
*/
scope: 'whenInUse' | 'always' | 'none';
};
// @needsAudit
export type PermissionDetailsLocationAndroid = {
/**
* Indicates the type of location provider.
*/
accuracy: 'fine' | 'coarse' | 'none';
};
// @needsAudit
/**
* `LocationPermissionResponse` extends [`PermissionResponse`](#permissionresponse)
* type exported by `expo-modules-core` and contains additional platform-specific fields.
*/
export type LocationPermissionResponse = PermissionResponse & {
ios?: PermissionDetailsLocationIOS;
android?: PermissionDetailsLocationAndroid;
};
export type { PermissionResponse };
``` | /content/code_sandbox/packages/expo-location/src/Location.types.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 3,075 |
```xml
/**
* Rectangle helper class.
*
* @public
* {@docCategory Rectangle}
*/
export class Rectangle {
public top: number;
public bottom: number;
public left: number;
public right: number;
constructor(left: number = 0, right: number = 0, top: number = 0, bottom: number = 0) {
this.top = top;
this.bottom = bottom;
this.left = left;
this.right = right;
}
/**
* Calculated automatically by subtracting the right from left
*/
public get width(): number {
return this.right - this.left;
}
/**
* Calculated automatically by subtracting the bottom from top.
*/
public get height(): number {
return this.bottom - this.top;
}
/**
* Tests if another rect is approximately equal to this rect (within 4 decimal places.)
*/
public equals(rect: Rectangle): boolean {
// Fixing to 4 decimal places because it allows enough precision and will handle cases when something
// should be rounded, like .999999 should round to 1.
return (
parseFloat(this.top.toFixed(4)) === parseFloat(rect.top.toFixed(4)) &&
parseFloat(this.bottom.toFixed(4)) === parseFloat(rect.bottom.toFixed(4)) &&
parseFloat(this.left.toFixed(4)) === parseFloat(rect.left.toFixed(4)) &&
parseFloat(this.right.toFixed(4)) === parseFloat(rect.right.toFixed(4))
);
}
}
``` | /content/code_sandbox/packages/utilities/src/Rectangle.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 316 |
```xml
import { notFound } from 'next/navigation'
export function generateMetadata() {
notFound()
}
export default function Page() {
return <div>@foobar slot</div>
}
``` | /content/code_sandbox/test/e2e/app-dir/parallel-route-not-found/app/not-found-metadata/no-page/@foobar/page.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 39 |
```xml
import {StoreSet, useDecorators} from "@tsed/core";
import {Configuration, Injectable} from "@tsed/di";
import {ProtocolOptions} from "../interfaces/ProtocolOptions.js";
import {PROVIDER_TYPE_PROTOCOL} from "../contants/constants.js";
/**
* Declare a new Protocol base on a Passport Strategy
*
* @decorator
* @class
*/
export function Protocol<T = any>(options: ProtocolOptionsDecorator<T>) {
return useDecorators(
Injectable({
type: PROVIDER_TYPE_PROTOCOL
}),
StoreSet("protocol", options),
Configuration({
passport: {
protocols: {
[options.name]: options
}
}
})
);
}
export type ProtocolOptionsDecorator<T = any> = {name: string} & Partial<ProtocolOptions<T>>;
``` | /content/code_sandbox/packages/security/passport/src/decorators/protocol.ts | xml | 2016-02-21T18:38:47 | 2024-08-14T21:19:48 | tsed | tsedio/tsed | 2,817 | 171 |
```xml
export { attachmentVariables as attachmentBodyVariables } from './attachmentVariables';
``` | /content/code_sandbox/packages/fluentui/react-northstar/src/themes/teams/components/Attachment/attachmentBodyVariables.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 15 |
```xml
testNamespace.withCallback(function () {})
testNamespace.withCallback(function () { testNamespace.noArgument() })
testNamespace.withCallback(function() {
testNamespace.noArgument();
testNamespace.noArgument();
})
testNamespace.withCallbackAndArguments(TestEnum.testValue2, 10, function() {
testNamespace.noArgument();
})
``` | /content/code_sandbox/tests/decompile-test/cases/functions_callbacks2.ts | xml | 2016-01-24T19:35:52 | 2024-08-16T16:39:39 | pxt | microsoft/pxt | 2,069 | 68 |
```xml
export class ParserOptions {
static default: ParserOptions = new ParserOptions();
parseSecureNotesToAccount = true;
}
``` | /content/code_sandbox/libs/importer/src/importers/lastpass/access/models/parser-options.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 27 |
```xml
<!--
Description: entry link - no rel
-->
<feed xmlns="path_to_url">
<entry>
<link href="path_to_url" type="text/html"></link>
</entry>
</feed>
``` | /content/code_sandbox/testdata/parser/atom/atom10_feed_entry_link_no_rel.xml | xml | 2016-01-23T02:44:34 | 2024-08-16T15:16:03 | gofeed | mmcdole/gofeed | 2,547 | 46 |
```xml
import * as React from "react";
import * as utils from "../utils/utils";
import * as strings from "spfxReactGridStrings";
import {connect} from "react-redux";
import * as _ from "lodash";
import { SharePointLookupCellFormatter } from "../components/SharePointFormatters";
import WebSelector from "../components/WebSelector";
import ListEditor from "../components/ListEditor";
import { addList, removeList, saveList, removeAllLists } from "../actions/listActions";
import { getWebsAction, getListsForWebAction, getFieldsForListAction } from "../actions/SiteActions";
import { Button, ButtonType, Dropdown, IDropdownOption, TextField, CommandBar } from "office-ui-fabric-react";
import ListDefinition from "../model/ListDefinition";
import { FieldDefinition } from "../model/ListDefinition";
import { ColumnReference } from "../model/ListDefinition";
import { Site, Web, WebList, WebListField } from "../model/Site";
import ColumnDefinition from "../model/ColumnDefinition";
import Container from "../components/container";
import { Guid, Log } from "@microsoft/sp-core-library";
import { PageContext } from "@microsoft/sp-page-context";
export class GridColumn {
constructor(
public id: string,
public name: string,
public title: string,
public editable: boolean,
public width: number,
public type: string,
public formatter: string = "",
public editor?: string) { }
}
export interface IListViewPageProps extends React.Props<any> {
lists: Array<ListDefinition>;
columnRefs: Array<ColumnDefinition>;
sites: Array<Site>;
addList: (siteUrl: string) => void;
removeList: (List) => void;
removeAllLists: () => void;
saveList: (List) => void;
getWebs: (siteUrl) => Promise<any>;
getListsForWeb: (webUrl) => Promise<any>;
getFieldsForList: (webUrl, listId) => Promise<any>;
save: () => void;
pageContext: PageContext;
}
function mapStateToProps(state) {
return {
lists: state.lists,
sites: state.sites,
columnRefs: state.columns,
pageContext: state.pageContext
};
}
function mapDispatchToProps(dispatch) {
return {
addList: (siteUrl: string): void => {
const id = Guid.newGuid();
const list: ListDefinition = new ListDefinition(id.toString(), null, null, siteUrl, null, null);
dispatch(addList(list));
},
removeList: (list: ListDefinition): void => {
dispatch(removeList(list));
},
removeAllLists: (): void => {
dispatch(removeAllLists());
},
getWebs: (siteUrl): Promise<any> => {
return dispatch(getWebsAction(dispatch, siteUrl));
},
getListsForWeb(webUrl): Promise<any> {
return dispatch(getListsForWebAction(dispatch, webUrl));
},
getFieldsForList(webUrl, listId): Promise<any> {
return dispatch(getFieldsForListAction(dispatch, webUrl, listId));
},
saveList: (list): void => {
const action = saveList(list);
dispatch(action);
},
};
}
export interface IGridProps {
editing: {
entityid: string;
columnid: string;
};
}
export class ListDefinitionContainerNative extends React.Component<IListViewPageProps, IGridProps> {
public defaultColumns: Array<GridColumn> = [
{
id: "rowGuid",
name: "guid",
title: "List Definition ID",
editable: false,
width: 250,
formatter: "",
type: "Text"
},
{
id: "SiteUrl",
name: "siteUrl", // the url to the site
title: "SiteUrl",
editable: true,
width: 359,
formatter: "",
type: "Text"
},
{
id: "listDefTitle",
name: "listDefTitle",
title: "List Definition Title",
editable: true,
width: 100,
formatter: "",
type: "Text"
},
{
id: "WebLookup",
name: "webLookup", // the name of the field in the model
title: "Web Containing List",
editable: true,
width: 300,
editor: "WebEditor",
formatter: "SharePointLookupCellFormatter",
type: "Lookup"
},
{
id: "listlookup",
width: 300,
name: "listLookup",
title: "List",
editable: true,
editor: "ListEditor",
formatter: "SharePointLookupCellFormatter",
type: "Lookup"
}];
public extendedColumns: Array<GridColumn> = [];
public constructor() {
super();
this.getWebsForSite = this.getWebsForSite.bind(this);
this.getListsForWeb = this.getListsForWeb.bind(this);
this.getFieldsForlist = this.getFieldsForlist.bind(this);
this.getFieldDefinition = this.getFieldDefinition.bind(this);
this.CellContentsEditable = this.CellContentsEditable.bind(this);
this.CellContents = this.CellContents.bind(this);
this.TableDetail = this.TableDetail.bind(this);
this.TableRow = this.TableRow.bind(this);
this.TableRows = this.TableRows.bind(this);
this.toggleEditing = this.toggleEditing.bind(this);
this.handleCellUpdated = this.handleCellUpdated.bind(this);
this.handleCellUpdatedEvent = this.handleCellUpdatedEvent.bind(this);
this.deleteList = this.deleteList.bind(this);
this.addList = this.addList.bind(this);
}
public componentWillMount(): void {
if (this.props.sites.length === 0) {
// prload current site, assuming user wants lists from current site
// this.props.getWebs(this.props.pageContext.site.absoluteUrl);
}
this.extendedColumns = _.clone(this.defaultColumns);
for (const columnRef of this.props.columnRefs) {
const newCol = new GridColumn(columnRef.guid, columnRef.name, columnRef.name, columnRef.editable, columnRef.width, columnRef.type, "FieldFormatter", "FieldEditor");
this.extendedColumns.push(newCol);
}
}
private isdeafaultColumn(columnid): boolean {
for (const col of this.defaultColumns) {
if (col.id === columnid) return true;
}
return false;
}
private updateExtendedColumn(entity: ListDefinition, columnid: string, value: any) {
const internalName = utils.ParseSPField(value).id;
const fieldDefinition: FieldDefinition = this.getFieldDefinition(entity, internalName); // values is the fueld just selected.... get the definition for it
for (const col of entity.columnReferences) {
if (col.columnDefinitionId === columnid) {
col.name = value;
col.fieldDefinition = fieldDefinition;
return;
}
}
const x = new ColumnReference(columnid, value, fieldDefinition);
entity.columnReferences.push(x);
}
public getFieldDefinition(listdef: ListDefinition, internalName: string): FieldDefinition {
const field = this.getFieldInList(listdef, internalName);
return field.fieldDefinition;
}
private handleCellUpdatedEvent(event) { //native react uses a Synthetic event
this.handleCellUpdated(event.target.value);
}
private handleCellUpdated(value) { // Office UI Fabric does not use events. It just calls this method with the new value
const {entityid, columnid} = this.state.editing;
const entity: ListDefinition = _.find(this.props.lists,(temp) => temp.guid === entityid);
const column = _.find(this.extendedColumns,temp => temp.id === columnid);
// if it is a default column, just set its value , otheriwse update it in the list of extended columns (i.e. sharepoint columns)
if (this.isdeafaultColumn(columnid)) {
/** need to save the web url if the web column was updated
* Sharepoint rest wont let me go from an SPSite to an SPWeb using just the id. Need tis
* I need the url to the Web.
* hmmmm... can i construct it (dont store the Id of the we, store the path instead?)
* need this for lookup columns.. they only stote a weid and list id...ohhhh noooo
*/
entity[column.name] = value;
}
else {
this.updateExtendedColumn(entity, columnid, value);
}
// this.props.saveList(entity);
}
public addList(event): any {
this.props.addList(this.props.pageContext.site.absoluteUrl);
return;
}
public deleteList(event) {
Log.verbose("list-Page", "Row changed-fired when row changed or leaving cell ");
const target = this.getParent(event.target, "TD");
const attributes: NamedNodeMap = target.attributes;
const entity = attributes.getNamedItem("data-entityid").value;
const list: ListDefinition = _.find(this.props.lists,temp => temp.guid === entity);
this.props.removeList(list);
return;
}
public getParent(node: Node, type: string): Node {
while (node.nodeName !== "TD") {
node = node.parentNode;
}
return node;
}
public getWebsForSite(listDef: ListDefinition): Array<Web> {
for (const site of this.props.sites) {
if (site.url === listDef.siteUrl) {
return site.webs;
}
}
// not in our cache/ go get it
this.props.getWebs(listDef.siteUrl);
return [];
}
public getListsForWeb(listDef: ListDefinition): Array<WebList> {
const webs = this.getWebsForSite(listDef);
for (const web of webs) {
if (web.url === utils.ParseSPField(listDef.webLookup).id) {
if (web.listsFetched) {
return web.lists;
}
else {
this.props.getListsForWeb(utils.ParseSPField(listDef.webLookup).id);
return [];
}
}
}
this.props.getListsForWeb(utils.ParseSPField(listDef.webLookup).id);
return []; // havent fetched parent yet,
}
public getFieldsForlist(listDef: ListDefinition, colType?: string): Array<WebListField> {
const lists = this.getListsForWeb(listDef);
for (const list of lists) {
if (list.id === utils.ParseSPField(listDef.listLookup).id) {
if (list.fieldsFetched) {
if (colType === undefined || colType === null) {
return list.fields;
} else {
return _.filter(list.fields, (f) => f.fieldDefinition.TypeAsString === colType);
}
}
else {
this.props.getFieldsForList(utils.ParseSPField(listDef.webLookup).id, utils.ParseSPField(listDef.listLookup).id);
return [];
}
}
}
return [];// havent fetched parent yet,
}
/** This method is called just before we ara going to save a field in our listdef. It gets the Field Deefinition from sharepoint. */
public getFieldInList(listDef: ListDefinition, internalName): WebListField {
const fields = this.getFieldsForlist(listDef);
for (const field of fields) {
if (utils.ParseSPField(field.name).id === internalName) {
return field;
}
}
}
public GetColumnReferenence(listDefinition: ListDefinition, columnDefinitionId: string): ColumnReference {
for (const columnref of listDefinition.columnReferences) {
if (columnref.columnDefinitionId === columnDefinitionId) {
return columnref;
}
}
}
public toggleEditing(event) {
Log.verbose("list-Page", "focus event fired editing when entering cell");
const target = this.getParent(event.target, "TD"); // walk up the Dom to the TD, thats where the IDs are stored
const attributes: NamedNodeMap = target.attributes;
const entityid = attributes.getNamedItem("data-entityid").value;
const columnid = attributes.getNamedItem("data-columnid").value;
this.setState({ "editing": { entityid: entityid, columnid: columnid } });
}
public CellContentsEditable(props: { entity: ListDefinition, column: GridColumn, cellUpdated: (newValue) => void, cellUpdatedEvent: (event: React.SyntheticEvent<any>) => void; }): JSX.Element {
const {entity, column, cellUpdated, cellUpdatedEvent} = props;
let columnValue;
if (this.isdeafaultColumn(column.id)) {
columnValue = entity[column.name];
}
else {
const colRef: ColumnReference = this.GetColumnReferenence(entity, column.id);
if (colRef) {
columnValue = this.GetColumnReferenence(entity, column.id).name;
}
}
switch (column.editor) {
case "WebEditor":
return (
<WebSelector
selectedWeb={columnValue}
onChange={cellUpdated}
PageContext={this.props.pageContext}
siteUrl={entity.siteUrl}
headerText={strings.WebSelectorHeaderText}
/>
);
case "ListEditor":
let lists = this.getListsForWeb(entity);// the Id portion of the WebLookup is the URL
return (<ListEditor selectedValue={columnValue} onChange={cellUpdated} lists={lists} />);
case "FieldEditor":
const colType = column.type;
let fields: Array<IDropdownOption> = this.getFieldsForlist(entity, colType).map(fld => {
return { key: fld.name, text: utils.ParseSPField(fld.name).value };
});
fields.unshift({ key: null, text: "(Select one)" });
return (<Dropdown options={fields} label="" selectedKey={columnValue} onChanged={(selection: IDropdownOption) => cellUpdated(selection.key)} />);
default:
return (
<TextField autoFocus width={column.width}
value={entity[column.name]}
onChanged={cellUpdated} />);
}
}
public CellContents(props: { entity: ListDefinition, column: GridColumn }): JSX.Element {
const {entity, column} = props;
switch (column.formatter) {
case "SharePointLookupCellFormatter":
return (<SharePointLookupCellFormatter value={entity[column.name]} onFocus={this.toggleEditing} />);
default:
if (this.isdeafaultColumn(column.id)) {
return (<a href="#" onFocus={this.toggleEditing} style={{ textDecoration: "none" }}>
{entity[column.name]}
</a>
);
}
else {
const colref = _.find(entity.columnReferences,cr => cr.columnDefinitionId === column.id);
let displaytext = "";
if (colref != null) {
displaytext = utils.ParseSPField(colref.name).value;
}
return (<a href="#" onFocus={this.toggleEditing} style={{ textDecoration: "none" }}>
{displaytext}
</a>
);
}
}
}
public TableDetail(props: { entity: ListDefinition, column: GridColumn, cellUpdated: (newValue) => void, cellUpdatedEvent: (event: React.SyntheticEvent<any>) => void; }): JSX.Element {
const {entity, column, cellUpdated, cellUpdatedEvent} = props;
if (this.state && this.state.editing && this.state.editing.entityid === entity.guid && this.state.editing.columnid === column.id) {
return (<td data-entityid={entity.guid} data-columnid={column.id} style={{ width: column.width, border: "1px solid red", padding: "0px" }}>
<this.CellContentsEditable entity={entity} column={column} cellUpdated={this.handleCellUpdated} cellUpdatedEvent={this.handleCellUpdatedEvent} />
</td>
);
} else {
return (<td data-entityid={entity.guid} data-columnid={column.id} style={{ width: column.width, border: "1px solid black", padding: "0px" }} onClick={this.toggleEditing} >
<this.CellContents entity={entity} column={column} />
</td>
);
}
}
public TableRow(props: { entity: ListDefinition, columns: Array<GridColumn>, cellUpdated: (newValue) => void, cellUpdatedEvent: (event: React.SyntheticEvent<any>) => void; }): JSX.Element {
const {entity, columns, cellUpdated, cellUpdatedEvent} = props;
return (
<tr>
{
columns.filter(c => c.type !== "__LISTDEFINITIONTITLE__").map(function (column) {
return (
<this.TableDetail key={column.id} entity={entity} column={column} cellUpdated={this.handleCellUpdated} cellUpdatedEvent={this.handleCellUpdatedEvent} />
);
}, this)
}
<td data-entityid={entity.guid} data-columnid={""}>
<Button
onClick={this.deleteList}
buttonType={ButtonType.icon}
icon="Delete" />
</td>
</tr>);
};
public TableRows(props: { entities: Array<ListDefinition>, columns: Array<GridColumn>, cellUpdated: (newValue) => void, cellUpdatedEvent: (event: React.SyntheticEvent<any>) => void; }): JSX.Element {
const {entities, columns, cellUpdated, cellUpdatedEvent} = props;
return (
<tbody>
{
entities.map(function (list) {
return (
<this.TableRow key={list.guid} entity={list} columns={columns} cellUpdated={this.handleCellUpdated} cellUpdatedEvent={this.handleCellUpdatedEvent} />
);
}, this)
}
</tbody>
);
}
public render() {
return (
<Container testid="columns" size={2} center>
<CommandBar items={[{
key: "Add LIST",
name: "Add a List",
icon: "Add",
onClick: this.addList
},
{
key: "Clear All Lists",
name: "Remove All Lists",
icon: "Delete",
onClick: this.props.removeAllLists
},
{
key: "Allow All Types ",
name: "Allow All Types ",
canCheck: true,
isChecked: true,
icon: "ClearFilter"
},
{
key: "save",
name: "save",
canCheck: true,
icon: "Save",
onClick: this.props.save
}]} />
<table >
<thead>
<tr>
{this.extendedColumns.filter(c => c.type !== "__LISTDEFINITIONTITLE__").map((column) => {
return <th key={column.name}>{column.title}</th>;
})}
</tr>
</thead>
{
<this.TableRows entities={this.props.lists} columns={this.extendedColumns} cellUpdated={this.handleCellUpdated} cellUpdatedEvent={this.handleCellUpdatedEvent} />
})}
</table>
</Container>
);
}
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(ListDefinitionContainerNative);
``` | /content/code_sandbox/samples/react-multilist-grid/src/webparts/spfxReactGrid/containers/ListDefinitionContainer.tsx | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 4,174 |
```xml
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<transfer op="approve">
<domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>example.net</domain:name>
</domain:transfer>
</transfer>
<clTRID>ABC-12345</clTRID>
</command>
</epp>
``` | /content/code_sandbox/core/src/test/resources/google/registry/flows/domain/domain_transfer_approve_net.xml | xml | 2016-02-29T20:16:48 | 2024-08-15T19:49:29 | nomulus | google/nomulus | 1,685 | 102 |
```xml
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"path_to_url">
<refentry id="flatpak-document-export">
<refentryinfo>
<title>flatpak document-export</title>
<productname>flatpak</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Alexander</firstname>
<surname>Larsson</surname>
<email>alexl@redhat.com</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>flatpak document-export</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>flatpak-document-export</refname>
<refpurpose>Export a file to a sandboxed application</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>flatpak document-export</command>
<arg choice="opt" rep="repeat">OPTION</arg>
<arg choice="plain">FILE</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Creates a document id for a local file that can be exposed to
sandboxed applications, allowing them access to files that they
would not otherwise see. The exported files are exposed in a
fuse filesystem at <filename>/run/user/$UID/doc/</filename>.
</para>
<para>
This command also lets you modify the per-application
permissions of the documents, granting or revoking access
to the file on a per-application basis.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<para>The following options are understood:</para>
<variablelist>
<varlistentry>
<term><option>-h</option></term>
<term><option>--help</option></term>
<listitem><para>
Show help options and exit.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-u</option></term>
<term><option>--unique</option></term>
<listitem><para> Don't reuse an existing document id
for the file. This makes it safe to later remove the
document when you're finished with it.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-t</option></term>
<term><option>--transient</option></term>
<listitem><para>
The document will only exist for the length of
the session. This is useful for temporary grants.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option></term>
<term><option>--noexist</option></term>
<listitem><para>
Don't require the file to exist already.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-a</option></term>
<term><option>--app=APPID</option></term>
<listitem><para>
Grant read access to the specified application. The
<option>--allow</option> and <option>--forbid</option> options
can be used to grant or remove additional privileges.
This option can be used multiple times.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-r</option></term>
<term><option>--allow-read</option></term>
<listitem><para>
Grant read access to the applications specified with <option>--app</option>.
This defaults to TRUE.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--forbid-read</option></term>
<listitem><para>
Revoke read access for the applications specified with <option>--app</option>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-w</option></term>
<term><option>--allow-write</option></term>
<listitem><para>
Grant write access to the applications specified with <option>--app</option>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--forbid-write</option></term>
<listitem><para>
Revoke write access for the applications specified with <option>--app</option>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-d</option></term>
<term><option>--allow-delete</option></term>
<listitem><para>
Grant the ability to remove the document from the document portal to the applications specified with <option>--app</option>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--forbid-delete</option></term>
<listitem><para>
Revoke the ability to remove the document from the document portal from the applications specified with <option>--app</option>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-g</option></term>
<term><option>--allow-grant-permission</option></term>
<listitem><para>
Grant the ability to grant further permissions to the applications specified with <option>--app</option>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--forbid-grant-permission</option></term>
<listitem><para>
Revoke the ability to grant further permissions for the applications specified with <option>--app</option>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option></term>
<term><option>--verbose</option></term>
<listitem><para>
Print debug information during command processing.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--ostree-verbose</option></term>
<listitem><para>
Print OSTree debug information during command processing.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Examples</title>
<para>
<command>$ flatpak document-export --app=org.gnome.gedit ~/test.txt</command>
</para>
<programlisting>
/run/user/1000/doc/e52f9c6a/test.txt
</programlisting>
</refsect1>
<refsect1>
<title>See also</title>
<para>
<citerefentry><refentrytitle>flatpak</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>flatpak-document-unexport</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>flatpak-document-info</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>flatpak-documents</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>
``` | /content/code_sandbox/doc/flatpak-document-export.xml | xml | 2016-05-19T14:19:21 | 2024-08-16T16:20:45 | flatpak | flatpak/flatpak | 4,157 | 1,716 |
```xml
import {inject, TestBed} from '@angular/core/testing';
import {UserService} from './user.service';
import {UserDTO} from '../../../../common/entities/UserDTO';
import {LoginCredential} from '../../../../common/entities/LoginCredential';
import {AuthenticationService} from './authentication.service';
import {NetworkService} from './network.service';
import {ErrorDTO} from '../../../../common/entities/Error';
import {VersionService} from '../version.service';
import {ShareService} from '../../ui/gallery/share.service';
class MockUserService {
public login(credential: LoginCredential): Promise<UserDTO> {
return Promise.resolve({name: 'testUserName'} as UserDTO);
}
public async getSessionUser(): Promise<UserDTO> {
return null;
}
}
class MockNetworkService {
addGlobalErrorHandler(fn: (error: ErrorDTO) => boolean): void {
// mock fn
}
}
class MockShareService {
onNewUser(user: any): void {
// mock fn
}
}
describe('AuthenticationService', () => {
beforeEach(() => {
localStorage.clear();
TestBed.configureTestingModule({
providers: [
VersionService,
{provide: NetworkService, useClass: MockNetworkService},
{provide: UserService, useClass: MockUserService},
{provide: ShareService, useClass: MockShareService},
AuthenticationService,
],
});
});
it('should call UserDTO service login', inject(
[AuthenticationService, UserService],
async (authService: AuthenticationService, userService: UserService) => {
spyOn(userService, 'login').and.callThrough();
expect(userService.login).not.toHaveBeenCalled();
await authService.login(null);
expect(userService.login).toHaveBeenCalled();
}
));
it('should have NO Authenticated use', inject(
[AuthenticationService],
(authService: AuthenticationService) => {
expect(authService.user.value).toBe(null);
expect(authService.isAuthenticated()).toBe(false);
}
));
it('should have Authenticated use', (done) =>
inject([AuthenticationService], (authService: AuthenticationService) => {
spyOn(authService.user, 'next').and.callThrough();
authService.user.subscribe((user) => {
if (user == null) {
return;
}
expect(authService.user.next).toHaveBeenCalled();
expect(authService.user.value).not.toBe(null);
expect(authService.isAuthenticated()).toBe(true);
done();
});
authService.login({} as any);
})());
});
``` | /content/code_sandbox/src/frontend/app/model/network/autehentication.service.spec.ts | xml | 2016-03-12T11:46:41 | 2024-08-16T19:56:44 | pigallery2 | bpatrik/pigallery2 | 1,727 | 511 |
```xml
import { expectTypeOf } from "expect-type";
import plugin from "../src/index";
import type { Linter } from "eslint";
import tseslint from "typescript-eslint";
describe("flat configs typing", () => {
it("should be compatible with @types/eslint ", () => {
expectTypeOf([plugin.configs["flat/recommended"]]).toMatchTypeOf<
Linter.FlatConfig[]
>();
});
it("should be compatible with `tseslint.config()`", () => {
tseslint.config(plugin.configs["flat/recommended"]);
tseslint.config({
extends: [plugin.configs["flat/recommended"]],
});
});
});
``` | /content/code_sandbox/test/flat-config-typing.spec.ts | xml | 2016-09-30T15:47:58 | 2024-08-13T22:04:07 | eslint-plugin-compat | amilajack/eslint-plugin-compat | 3,058 | 143 |
```xml
export const DEFAULT_STYLE_CLASS = 'jp-DefaultStyle';
export interface IElementRefProps<E extends HTMLElement> {
/** Ref handler to access the instance of the internal HTML element. */
elementRef?: (ref: E | null) => void;
}
``` | /content/code_sandbox/packages/ui-components/src/components/interface.ts | xml | 2016-06-03T20:09:17 | 2024-08-16T19:12:44 | jupyterlab | jupyterlab/jupyterlab | 14,019 | 55 |
```xml
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="path_to_url"
xmlns:ext="path_to_url"
xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url path_to_url path_to_url"
logicalFilePath="migration/node-services.changelog-init.xml">
<changeSet author="R3.Corda" id="nullability">
<addNotNullConstraint tableName="node_raft_committed_states" columnName="state_index" columnDataType="BIGINT"/>
<addNotNullConstraint tableName="node_raft_committed_states" columnName="state_value" columnDataType="BLOB"/>
</changeSet>
</databaseChangeLog>
``` | /content/code_sandbox/node/src/main/resources/migration/notary-raft.changelog-v1.xml | xml | 2016-10-06T08:46:29 | 2024-08-15T09:36:24 | corda | corda/corda | 3,974 | 154 |
```xml
///
///
///
/// path_to_url
///
/// Unless required by applicable law or agreed to in writing, software
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
///
import {
ChangeDetectorRef,
Component,
ElementRef,
forwardRef,
Input,
OnDestroy,
OnInit,
ViewChild,
ViewEncapsulation
} from '@angular/core';
import { ControlValueAccessor, UntypedFormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR, Validator } from '@angular/forms';
import { Ace } from 'ace-builds';
import { getAce } from '@shared/models/ace/ace.models';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { UtilsService } from '@core/services/utils.service';
import { TranslateService } from '@ngx-translate/core';
import { CancelAnimationFrame, RafService } from '@core/services/raf.service';
import { ResizeObserver } from '@juggle/resize-observer';
import { beautifyHtml } from '@shared/models/beautify.models';
@Component({
selector: 'tb-html',
templateUrl: './html.component.html',
styleUrls: ['./html.component.scss'],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => HtmlComponent),
multi: true
},
{
provide: NG_VALIDATORS,
useExisting: forwardRef(() => HtmlComponent),
multi: true,
}
],
encapsulation: ViewEncapsulation.None
})
export class HtmlComponent implements OnInit, OnDestroy, ControlValueAccessor, Validator {
@ViewChild('htmlEditor', {static: true})
htmlEditorElmRef: ElementRef;
private htmlEditor: Ace.Editor;
private editorsResizeCaf: CancelAnimationFrame;
private editorResize$: ResizeObserver;
private ignoreChange = false;
@Input() label: string;
@Input() disabled: boolean;
@Input() fillHeight: boolean;
@Input() minHeight = '200px';
private requiredValue: boolean;
get required(): boolean {
return this.requiredValue;
}
@Input()
set required(value: boolean) {
this.requiredValue = coerceBooleanProperty(value);
}
fullscreen = false;
modelValue: string;
hasErrors = false;
private propagateChange = null;
constructor(public elementRef: ElementRef,
private utils: UtilsService,
private translate: TranslateService,
protected store: Store<AppState>,
private raf: RafService,
private cd: ChangeDetectorRef) {
}
ngOnInit(): void {
const editorElement = this.htmlEditorElmRef.nativeElement;
let editorOptions: Partial<Ace.EditorOptions> = {
mode: 'ace/mode/html',
showGutter: true,
showPrintMargin: true,
readOnly: this.disabled
};
const advancedOptions = {
enableSnippets: true,
enableBasicAutocompletion: true,
enableLiveAutocompletion: true
};
editorOptions = {...editorOptions, ...advancedOptions};
getAce().subscribe(
(ace) => {
this.htmlEditor = ace.edit(editorElement, editorOptions);
this.htmlEditor.session.setUseWrapMode(true);
this.htmlEditor.setValue(this.modelValue ? this.modelValue : '', -1);
this.htmlEditor.setReadOnly(this.disabled);
this.htmlEditor.on('change', () => {
if (!this.ignoreChange) {
this.updateView();
}
});
// @ts-ignore
this.htmlEditor.session.on('changeAnnotation', () => {
const annotations = this.htmlEditor.session.getAnnotations();
const hasErrors = annotations.filter(annotation => annotation.type === 'error').length > 0;
if (this.hasErrors !== hasErrors) {
this.hasErrors = hasErrors;
this.propagateChange(this.modelValue);
this.cd.markForCheck();
}
});
this.editorResize$ = new ResizeObserver(() => {
this.onAceEditorResize();
});
this.editorResize$.observe(editorElement);
}
);
}
ngOnDestroy(): void {
if (this.editorResize$) {
this.editorResize$.disconnect();
}
if (this.htmlEditor) {
this.htmlEditor.destroy();
}
}
private onAceEditorResize() {
if (this.editorsResizeCaf) {
this.editorsResizeCaf();
this.editorsResizeCaf = null;
}
this.editorsResizeCaf = this.raf.raf(() => {
this.htmlEditor.resize();
this.htmlEditor.renderer.updateFull();
});
}
registerOnChange(fn: any): void {
this.propagateChange = fn;
}
registerOnTouched(fn: any): void {
}
setDisabledState(isDisabled: boolean): void {
this.disabled = isDisabled;
if (this.htmlEditor) {
this.htmlEditor.setReadOnly(this.disabled);
}
}
public validate(c: UntypedFormControl) {
return (!this.hasErrors) ? null : {
html: {
valid: false,
},
};
}
beautifyHtml() {
beautifyHtml(this.modelValue, {indent_size: 4}).subscribe(
(res) => {
if (this.modelValue !== res) {
this.htmlEditor.setValue(res ? res : '', -1);
this.updateView();
}
}
);
}
writeValue(value: string): void {
this.modelValue = value;
if (this.htmlEditor) {
this.ignoreChange = true;
this.htmlEditor.setValue(this.modelValue ? this.modelValue : '', -1);
this.ignoreChange = false;
}
}
updateView() {
const editorValue = this.htmlEditor.getValue();
if (this.modelValue !== editorValue) {
this.modelValue = editorValue;
this.propagateChange(this.modelValue);
this.cd.markForCheck();
}
}
}
``` | /content/code_sandbox/ui-ngx/src/app/shared/components/html.component.ts | xml | 2016-12-01T09:33:30 | 2024-08-16T19:58:25 | thingsboard | thingsboard/thingsboard | 16,820 | 1,273 |
```xml
<StaticExtensionWrapper Param="{x:Static StaticExtensionWrapper.Foo}" xmlns="clr-namespace:MonoTests.System.Xaml;assembly=System.Xaml.TestCases" xmlns:x="path_to_url" />
``` | /content/code_sandbox/src/Test/System.Xaml.TestCases/XmlFiles/StaticExtensionWrapper.xml | xml | 2016-08-25T20:07:20 | 2024-08-13T22:23:35 | CoreWF | UiPath/CoreWF | 1,126 | 42 |
```xml
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google LLC nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// MachIPC.mm
// Wrapper for mach IPC calls
#import <stdio.h>
#import "MachIPC.h"
#include "common/mac/bootstrap_compat.h"
namespace google_breakpad {
//==============================================================================
MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() {
head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0);
// head.msgh_remote_port = ...; // filled out in MachPortSender::SendMessage()
head.msgh_local_port = MACH_PORT_NULL;
head.msgh_reserved = 0;
head.msgh_id = 0;
SetDescriptorCount(0); // start out with no descriptors
SetMessageID(message_id);
SetData(NULL, 0); // client may add data later
}
//==============================================================================
// returns true if successful
bool MachMessage::SetData(void* data,
int32_t data_length) {
// first check to make sure we have enough space
size_t size = CalculateSize();
size_t new_size = size + data_length;
if (new_size > sizeof(MachMessage)) {
return false; // not enough space
}
GetDataPacket()->data_length = EndianU32_NtoL(data_length);
if (data) memcpy(GetDataPacket()->data, data, data_length);
CalculateSize();
return true;
}
//==============================================================================
// calculates and returns the total size of the message
// Currently, the entire message MUST fit inside of the MachMessage
// messsage size <= sizeof(MachMessage)
mach_msg_size_t MachMessage::CalculateSize() {
size_t size = sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t);
// add space for MessageDataPacket
int32_t alignedDataLength = (GetDataLength() + 3) & ~0x3;
size += 2*sizeof(int32_t) + alignedDataLength;
// add space for descriptors
size += GetDescriptorCount() * sizeof(MachMsgPortDescriptor);
head.msgh_size = static_cast<mach_msg_size_t>(size);
return head.msgh_size;
}
//==============================================================================
MachMessage::MessageDataPacket* MachMessage::GetDataPacket() {
size_t desc_size = sizeof(MachMsgPortDescriptor)*GetDescriptorCount();
MessageDataPacket* packet =
reinterpret_cast<MessageDataPacket*>(padding + desc_size);
return packet;
}
//==============================================================================
void MachMessage::SetDescriptor(int n,
const MachMsgPortDescriptor& desc) {
MachMsgPortDescriptor* desc_array =
reinterpret_cast<MachMsgPortDescriptor*>(padding);
desc_array[n] = desc;
}
//==============================================================================
// returns true if successful otherwise there was not enough space
bool MachMessage::AddDescriptor(const MachMsgPortDescriptor& desc) {
// first check to make sure we have enough space
int size = CalculateSize();
size_t new_size = size + sizeof(MachMsgPortDescriptor);
if (new_size > sizeof(MachMessage)) {
return false; // not enough space
}
// unfortunately, we need to move the data to allow space for the
// new descriptor
u_int8_t* p = reinterpret_cast<u_int8_t*>(GetDataPacket());
bcopy(p, p+sizeof(MachMsgPortDescriptor), GetDataLength()+2*sizeof(int32_t));
SetDescriptor(GetDescriptorCount(), desc);
SetDescriptorCount(GetDescriptorCount() + 1);
CalculateSize();
return true;
}
//==============================================================================
void MachMessage::SetDescriptorCount(int n) {
body.msgh_descriptor_count = n;
if (n > 0) {
head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
} else {
head.msgh_bits &= ~MACH_MSGH_BITS_COMPLEX;
}
}
//==============================================================================
MachMsgPortDescriptor* MachMessage::GetDescriptor(int n) {
if (n < GetDescriptorCount()) {
MachMsgPortDescriptor* desc =
reinterpret_cast<MachMsgPortDescriptor*>(padding);
return desc + n;
}
return nil;
}
//==============================================================================
mach_port_t MachMessage::GetTranslatedPort(int n) {
if (n < GetDescriptorCount()) {
return GetDescriptor(n)->GetMachPort();
}
return MACH_PORT_NULL;
}
#pragma mark -
//==============================================================================
// create a new mach port for receiving messages and register a name for it
ReceivePort::ReceivePort(const char* receive_port_name) {
mach_port_t current_task = mach_task_self();
init_result_ = mach_port_allocate(current_task,
MACH_PORT_RIGHT_RECEIVE,
&port_);
if (init_result_ != KERN_SUCCESS)
return;
init_result_ = mach_port_insert_right(current_task,
port_,
port_,
MACH_MSG_TYPE_MAKE_SEND);
if (init_result_ != KERN_SUCCESS)
return;
mach_port_t task_bootstrap_port = 0;
init_result_ = task_get_bootstrap_port(current_task, &task_bootstrap_port);
if (init_result_ != KERN_SUCCESS)
return;
init_result_ = breakpad::BootstrapRegister(
bootstrap_port,
const_cast<char*>(receive_port_name),
port_);
}
//==============================================================================
// create a new mach port for receiving messages
ReceivePort::ReceivePort() {
mach_port_t current_task = mach_task_self();
init_result_ = mach_port_allocate(current_task,
MACH_PORT_RIGHT_RECEIVE,
&port_);
if (init_result_ != KERN_SUCCESS)
return;
init_result_ = mach_port_insert_right(current_task,
port_,
port_,
MACH_MSG_TYPE_MAKE_SEND);
}
//==============================================================================
// Given an already existing mach port, use it. We take ownership of the
// port and deallocate it in our destructor.
ReceivePort::ReceivePort(mach_port_t receive_port)
: port_(receive_port),
init_result_(KERN_SUCCESS) {
}
//==============================================================================
ReceivePort::~ReceivePort() {
if (init_result_ == KERN_SUCCESS)
mach_port_deallocate(mach_task_self(), port_);
}
//==============================================================================
kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage* out_message,
mach_msg_timeout_t timeout) {
if (!out_message) {
return KERN_INVALID_ARGUMENT;
}
// return any error condition encountered in constructor
if (init_result_ != KERN_SUCCESS)
return init_result_;
out_message->head.msgh_bits = 0;
out_message->head.msgh_local_port = port_;
out_message->head.msgh_remote_port = MACH_PORT_NULL;
out_message->head.msgh_reserved = 0;
out_message->head.msgh_id = 0;
mach_msg_option_t options = MACH_RCV_MSG;
if (timeout != MACH_MSG_TIMEOUT_NONE)
options |= MACH_RCV_TIMEOUT;
kern_return_t result = mach_msg(&out_message->head,
options,
0,
sizeof(MachMessage),
port_,
timeout, // timeout in ms
MACH_PORT_NULL);
return result;
}
#pragma mark -
//==============================================================================
// get a port with send rights corresponding to a named registered service
MachPortSender::MachPortSender(const char* receive_port_name) {
mach_port_t task_bootstrap_port = 0;
init_result_ = task_get_bootstrap_port(mach_task_self(),
&task_bootstrap_port);
if (init_result_ != KERN_SUCCESS)
return;
init_result_ = bootstrap_look_up(task_bootstrap_port,
const_cast<char*>(receive_port_name),
&send_port_);
}
//==============================================================================
MachPortSender::MachPortSender(mach_port_t send_port)
: send_port_(send_port),
init_result_(KERN_SUCCESS) {
}
//==============================================================================
kern_return_t MachPortSender::SendMessage(MachSendMessage& message,
mach_msg_timeout_t timeout) {
if (message.head.msgh_size == 0) {
return KERN_INVALID_VALUE; // just for safety -- never should occur
};
if (init_result_ != KERN_SUCCESS)
return init_result_;
message.head.msgh_remote_port = send_port_;
kern_return_t result = mach_msg(&message.head,
MACH_SEND_MSG | MACH_SEND_TIMEOUT,
message.head.msgh_size,
0,
MACH_PORT_NULL,
timeout, // timeout in ms
MACH_PORT_NULL);
return result;
}
} // namespace google_breakpad
``` | /content/code_sandbox/src/common/mac/MachIPC.mm | xml | 2016-02-29T16:14:14 | 2024-08-16T15:28:44 | breakpad | google/breakpad | 2,599 | 2,115 |
```xml
<services version='1.0' xmlns:deploy="vespa" xmlns:preprocess="properties">
<preprocess:properties>
<qrs.port>4099</qrs.port>
<qrs.port>5000</qrs.port>
</preprocess:properties>
<preprocess:properties deploy:environment='prod'>
<qrs.port deploy:region='us-west'>5001</qrs.port>
<qrs.port deploy:region='us-east us-central'>5002</qrs.port>
</preprocess:properties>
<admin version='2.0'>
<adminserver hostalias='node0'/>
</admin>
<admin version='2.0' deploy:environment='staging prod' deploy:region='us-east us-central'>
<adminserver hostalias='node1'/>
</admin>
<preprocess:include file='jdisc.xml'/>
<content version='1.0' id='foo'>
<thread deploy:region="us-central us-east" count="128"/>
<preprocess:include file='content/content_foo.xml'/>
</content>
<preprocess:include file='doesnotexist.xml' required='false' />
</services>
``` | /content/code_sandbox/config-application-package/src/test/resources/multienvapp/services.xml | xml | 2016-06-03T20:54:20 | 2024-08-16T15:32:01 | vespa | vespa-engine/vespa | 5,524 | 266 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<com.larswerkman.holocolorpicker.ColorPicker
android:id="@+id/picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="24dp"/>
<com.larswerkman.holocolorpicker.SVBar
android:id="@+id/svbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/picker"
android:layout_alignLeft="@+id/picker"
android:layout_alignRight="@+id/picker"
android:layout_alignStart="@+id/picker"
android:layout_below="@+id/picker"
android:layout_marginTop="12dp"/>
<Button
android:id="@+id/btn_save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/svbar"
android:layout_marginTop="24dp"
android:text="@string/btn_set"/>
</RelativeLayout>
``` | /content/code_sandbox/wallpaper/src/main/res/layout/fragment_color_picker.xml | xml | 2016-02-10T13:44:54 | 2024-08-14T03:11:57 | WaveInApp | Cleveroad/WaveInApp | 1,785 | 293 |
```xml
import { Range } from "../entities/geometry/Range"
import { isEventInRange, isEventOverlapRange } from "./filterEvents"
describe("filterEvents", () => {
const events = [
{ tick: 0 },
{ tick: 5, duration: 5 },
{ tick: 5, duration: 6 },
{ tick: 5, duration: 100 },
{ tick: 10 },
{ tick: 20 },
{ tick: 50 },
]
describe("isEventInRange", () => {
it("should contain the event placed at the start tick but the end tick", () => {
expect(events.filter(isEventInRange(Range.create(10, 50)))).toStrictEqual(
[{ tick: 10 }, { tick: 20 }],
)
})
})
describe("isEventOverlapRange", () => {
it("should contain events with duration", () => {
expect(
events.filter(isEventOverlapRange(Range.create(10, 50))),
).toStrictEqual([
{ tick: 5, duration: 6 },
{ tick: 5, duration: 100 },
{ tick: 10 },
{ tick: 20 },
])
})
})
})
``` | /content/code_sandbox/app/src/helpers/filterEvents.test.ts | xml | 2016-03-06T15:19:53 | 2024-08-15T14:27:10 | signal | ryohey/signal | 1,238 | 269 |
```xml
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { LockfileMissingDependencyError } from '@pnpm/error'
import {
type Lockfile,
type PackageSnapshots,
} from '@pnpm/lockfile.types'
import { nameVerFromPkgSnapshot } from '@pnpm/lockfile.utils'
import { logger } from '@pnpm/logger'
import { packageIsInstallable } from '@pnpm/package-is-installable'
import { type DepPath, type SupportedArchitectures, type DependenciesField, type ProjectId } from '@pnpm/types'
import * as dp from '@pnpm/dependency-path'
import mapValues from 'ramda/src/map'
import pickBy from 'ramda/src/pickBy'
import unnest from 'ramda/src/unnest'
import { filterImporter } from './filterImporter'
const lockfileLogger = logger('lockfile')
export interface FilterLockfileResult {
lockfile: Lockfile
selectedImporterIds: ProjectId[]
}
export function filterLockfileByEngine (
lockfile: Lockfile,
opts: FilterLockfileOptions
): FilterLockfileResult {
const importerIds = Object.keys(lockfile.importers) as ProjectId[]
return filterLockfileByImportersAndEngine(lockfile, importerIds, opts)
}
export interface FilterLockfileOptions {
currentEngine: {
nodeVersion?: string
pnpmVersion: string
}
engineStrict: boolean
include: { [dependenciesField in DependenciesField]: boolean }
includeIncompatiblePackages?: boolean
failOnMissingDependencies: boolean
lockfileDir: string
skipped: Set<string>
supportedArchitectures?: SupportedArchitectures
}
export function filterLockfileByImportersAndEngine (
lockfile: Lockfile,
importerIds: ProjectId[],
opts: FilterLockfileOptions
): FilterLockfileResult {
const importerIdSet = new Set(importerIds)
const directDepPaths = toImporterDepPaths(lockfile, importerIds, {
include: opts.include,
importerIdSet,
})
const packages =
lockfile.packages != null
? pickPkgsWithAllDeps(lockfile, directDepPaths, importerIdSet, {
currentEngine: opts.currentEngine,
engineStrict: opts.engineStrict,
failOnMissingDependencies: opts.failOnMissingDependencies,
include: opts.include,
includeIncompatiblePackages:
opts.includeIncompatiblePackages === true,
lockfileDir: opts.lockfileDir,
skipped: opts.skipped,
supportedArchitectures: opts.supportedArchitectures,
})
: {}
const importers = mapValues((importer) => {
const newImporter = filterImporter(importer, opts.include)
if (newImporter.optionalDependencies != null) {
newImporter.optionalDependencies = pickBy((ref, depName) => {
const depPath = dp.refToRelative(ref, depName)
return !depPath || packages[depPath] != null
}, newImporter.optionalDependencies)
}
return newImporter
}, lockfile.importers)
return {
lockfile: {
...lockfile,
importers,
packages,
},
selectedImporterIds: Array.from(importerIdSet),
}
}
function pickPkgsWithAllDeps (
lockfile: Lockfile,
depPaths: DepPath[],
importerIdSet: Set<ProjectId>,
opts: {
currentEngine: {
nodeVersion?: string
pnpmVersion: string
}
engineStrict: boolean
failOnMissingDependencies: boolean
include: { [dependenciesField in DependenciesField]: boolean }
includeIncompatiblePackages: boolean
lockfileDir: string
skipped: Set<string>
supportedArchitectures?: SupportedArchitectures
}
): PackageSnapshots {
const pickedPackages = {} as PackageSnapshots
pkgAllDeps({ lockfile, pickedPackages, importerIdSet }, depPaths, true, opts)
return pickedPackages
}
function pkgAllDeps (
ctx: {
lockfile: Lockfile
pickedPackages: PackageSnapshots
importerIdSet: Set<ProjectId>
},
depPaths: DepPath[],
parentIsInstallable: boolean,
opts: {
currentEngine: {
nodeVersion?: string
pnpmVersion: string
}
engineStrict: boolean
failOnMissingDependencies: boolean
include: { [dependenciesField in DependenciesField]: boolean }
includeIncompatiblePackages: boolean
lockfileDir: string
skipped: Set<string>
supportedArchitectures?: SupportedArchitectures
}
) {
for (const depPath of depPaths) {
if (ctx.pickedPackages[depPath]) continue
const pkgSnapshot = ctx.lockfile.packages![depPath]
if (!pkgSnapshot && !depPath.startsWith('link:')) {
if (opts.failOnMissingDependencies) {
throw new LockfileMissingDependencyError(depPath)
}
lockfileLogger.debug(`No entry for "${depPath}" in ${WANTED_LOCKFILE}`)
continue
}
let installable!: boolean
if (!parentIsInstallable) {
installable = false
if (!ctx.pickedPackages[depPath] && pkgSnapshot.optional === true) {
opts.skipped.add(depPath)
}
} else {
const pkg = {
...nameVerFromPkgSnapshot(depPath, pkgSnapshot),
cpu: pkgSnapshot.cpu,
engines: pkgSnapshot.engines,
os: pkgSnapshot.os,
libc: pkgSnapshot.libc,
}
// TODO: depPath is not the package ID. Should be fixed
installable =
opts.includeIncompatiblePackages ||
packageIsInstallable(pkgSnapshot.id ?? depPath, pkg, {
engineStrict: opts.engineStrict,
lockfileDir: opts.lockfileDir,
nodeVersion: opts.currentEngine.nodeVersion,
optional: pkgSnapshot.optional === true,
supportedArchitectures: opts.supportedArchitectures,
}) !== false
if (!installable) {
if (!ctx.pickedPackages[depPath] && pkgSnapshot.optional === true) {
opts.skipped.add(depPath)
}
} else {
opts.skipped.delete(depPath)
}
}
ctx.pickedPackages[depPath] = pkgSnapshot
const { depPaths: nextRelDepPaths, importerIds: additionalImporterIds } = parseDepRefs(Object.entries({
...pkgSnapshot.dependencies,
...(opts.include.optionalDependencies
? pkgSnapshot.optionalDependencies
: {}),
}), ctx.lockfile)
additionalImporterIds.forEach((importerId) => ctx.importerIdSet.add(importerId))
nextRelDepPaths.push(
...toImporterDepPaths(ctx.lockfile, additionalImporterIds, {
include: opts.include,
importerIdSet: ctx.importerIdSet,
})
)
pkgAllDeps(ctx, nextRelDepPaths, installable, opts)
}
}
function toImporterDepPaths (
lockfile: Lockfile,
importerIds: ProjectId[],
opts: {
include: { [dependenciesField in DependenciesField]: boolean }
importerIdSet: Set<ProjectId>
}
): DepPath[] {
const importerDeps = importerIds
.map(importerId => lockfile.importers[importerId])
.map(importer => ({
...(opts.include.dependencies ? importer.dependencies : {}),
...(opts.include.devDependencies ? importer.devDependencies : {}),
...(opts.include.optionalDependencies
? importer.optionalDependencies
: {}),
}))
.map(Object.entries)
const { depPaths, importerIds: nextImporterIds } = parseDepRefs(unnest(importerDeps), lockfile)
if (!nextImporterIds.length) {
return depPaths
}
nextImporterIds.forEach((importerId) => {
opts.importerIdSet.add(importerId)
})
return [
...depPaths,
...toImporterDepPaths(lockfile, nextImporterIds, opts),
]
}
interface ParsedDepRefs {
depPaths: DepPath[]
importerIds: ProjectId[]
}
function parseDepRefs (refsByPkgNames: Array<[string, string]>, lockfile: Lockfile): ParsedDepRefs {
return refsByPkgNames
.reduce((acc, [pkgName, ref]) => {
if (ref.startsWith('link:')) {
const importerId = ref.substring(5) as ProjectId
if (lockfile.importers[importerId]) {
acc.importerIds.push(importerId)
}
return acc
}
const depPath = dp.refToRelative(ref, pkgName)
if (depPath == null) return acc
acc.depPaths.push(depPath)
return acc
}, { depPaths: [], importerIds: [] } as ParsedDepRefs)
}
``` | /content/code_sandbox/lockfile/filtering/src/filterLockfileByImportersAndEngine.ts | xml | 2016-01-28T07:40:43 | 2024-08-16T12:38:47 | pnpm | pnpm/pnpm | 28,869 | 1,914 |
```xml
import { Column } from "../../../../src/decorator/columns/Column"
import { PrimaryGeneratedColumn } from "../../../../src/decorator/columns/PrimaryGeneratedColumn"
import { Entity } from "../../../../src/decorator/entity/Entity"
@Entity()
export class Dummy {
@PrimaryGeneratedColumn()
id: number
@Column({ nullable: true, default: () => "GETDATE()" })
UploadDate: string
}
``` | /content/code_sandbox/test/github-issues/2733/entity/MSSQLDummy.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 90 |
```xml
/*
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
// TypeScript Version: 4.1
/// <reference types="@stdlib/types"/>
import { Iterator as Iter, IterableIterator } from '@stdlib/types/iter';
import * as random from '@stdlib/types/random';
// Define a union type representing both iterable and non-iterable iterators:
type Iterator = Iter | IterableIterator;
/**
* Interface defining function options.
*/
interface Options {
/**
* Pseudorandom number generator which generates pseudorandom numbers drawn from a standard normal distribution.
*
* ## Notes
*
* - If provided, the `state` and `seed` options are ignored. In order to seed the returned iterator, one must seed the provided `prng` (assuming the provided `prng` is seedable).
*/
prng?: random.PRNG;
/**
* Pseudorandom number generator state.
*
* ## Notes
*
* - If provided, the `seed` option is ignored.
*/
state?: random.PRNGStateMT19937;
/**
* Pseudorandom number generator seed.
*/
seed?: random.PRNGSeedMT19937;
/**
* Specifies whether to copy a provided pseudorandom number generator state.
*
* ## Notes
*
* - Setting this option to `false` allows sharing state between two or more pseudorandom number generators. Setting this option to `true` ensures that a returned iterator has exclusive control over its internal state.
*/
copy?: boolean;
}
/**
* Interface defining a returned iterator.
*/
interface ExtendedIter extends Iter {
/**
* Underlying PRNG.
*/
readonly PRNG: random.PRNG | null;
/**
* PRNG seed.
*/
readonly seed: random.PRNGSeedMT19937 | null;
/**
* PRNG seed length.
*/
readonly seedLength: number | null;
/**
* PRNG state.
*/
state: random.PRNGStateMT19937 | null;
/**
* PRNG state length.
*/
readonly stateLength: number | null;
/**
* PRNG state size (in bytes).
*/
readonly byteLength: number | null;
}
/**
* Interface defining a returned iterable iterator.
*/
interface ExtendedIterableIterator extends ExtendedIter {
/**
* Returns a new iterable iterator.
*
* @returns iterable iterator
*/
[Symbol.iterator](): IterableIterator;
}
// Define a union type representing both iterable and non-iterable returned iterators:
type ExtendedIterator = ExtendedIter | ExtendedIterableIterator;
/**
* Returns an iterator which introduces additive white Gaussian noise with standard deviation `sigma`.
*
* @param iterator - input iterator
* @param sigma - standard deviation of the noise
* @param options - function options
* @param options.prng - pseudorandom number generator for generating pseudorandom numbers drawn from a standard normal distribution
* @param options.state - pseudorandom number generator state
* @param options.seed - pseudorandom number generator seed
* @param options.copy - boolean indicating whether to copy a provided pseudorandom number generator state (default: true)
* @throws `sigma` must be a positive number
* @throws must provide a valid state
* @returns iterator
*
* @example
* var iterSineWave = require( '@stdlib/simulate/iter/sine-wave' );
*
* var sine = iterSineWave({
* 'iter': 100
* });
*
* var it = iterawgn( sine, 0.5 );
*
* var v = it.next().value;
* // returns <number>
*
* v = it.next().value;
* // returns <number>
*
* v = it.next().value;
* // returns <number>
*
* // ...
*/
declare function iterawgn( iterator: Iterator, sigma: number, options?: Options ): ExtendedIterator;
// EXPORTS //
export = iterawgn;
``` | /content/code_sandbox/lib/node_modules/@stdlib/simulate/iter/awgn/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 879 |
```xml
import { Alert, __ } from "coreui/utils";
import { Disabled, HelperText, RowTitle } from "@erxes/ui-engage/src/styles";
import { IEngageMessage, IEngageMessenger } from "@erxes/ui-engage/src/types";
import {
MESSAGE_KINDS,
MESSAGE_KIND_FILTERS,
METHODS
} from "@erxes/ui-engage/src/constants";
import ActionButtons from "@erxes/ui/src/components/ActionButtons";
import Button from "@erxes/ui/src/components/Button";
import { Capitalize } from "@erxes/ui-settings/src/permissions/styles";
import FormControl from "@erxes/ui/src/components/form/Control";
import { IBrand } from "@erxes/ui/src/brands/types";
import { ISegment } from "@erxes/ui-segments/src/types";
import Icon from "@erxes/ui/src/components/Icon";
import Label from "@erxes/ui/src/components/Label";
import NameCard from "@erxes/ui/src/components/nameCard/NameCard";
import React from "react";
import Tags from "@erxes/ui/src/components/Tags";
import Tip from "@erxes/ui/src/components/Tip";
import dayjs from "dayjs";
import { isEnabled } from "@erxes/ui/src/utils/core";
import s from "underscore.string";
type Props = {
message: any;
// TODO: add types
edit: () => void;
show: () => void;
remove: () => void;
setLive: () => void;
setLiveManual: () => void;
setPause: () => void;
copy: () => void;
isChecked: boolean;
toggleBulk: (value: IEngageMessage, isChecked: boolean) => void;
};
class Row extends React.Component<Props> {
renderLink(text: string, iconName: string, onClick, disabled?: boolean) {
const button = <Button btnStyle="link" onClick={onClick} icon={iconName} />;
return (
<Tip
text={__(text)}
key={`${text}-${this.props.message._id}`}
placement="top"
>
{disabled ? <Disabled>{button}</Disabled> : button}
</Tip>
);
}
onEdit = () => {
const msg = this.props.message;
if (msg.isLive && msg.kind != MESSAGE_KINDS.MANUAL) {
return Alert.info("Pause the Campaign first and try editing");
}
if (msg.isLive && msg.kind === MESSAGE_KINDS.MANUAL) {
return Alert.warning(
"Unfortunately once a campaign has been sent, it cannot be stopped or edited."
);
}
return this.props.edit();
};
renderStatus() {
const { message } = this.props;
const { kind, isLive, runCount, isDraft } = message;
let labelStyle = "primary";
let labelText = "Sending";
if (isDraft === true) {
return <Label lblStyle="simple">{__("Draft")}</Label>;
}
if (!isLive) {
labelStyle = "simple";
labelText = "Paused";
} else {
labelStyle = "primary";
labelText = "Sending";
}
if (kind === MESSAGE_KINDS.MANUAL) {
if (runCount > 0) {
labelStyle = "success";
labelText = "Sent";
} else {
labelStyle = "danger";
labelText = "Not Sent";
}
}
// scheduled auto campaign
return <Label lblStyle={labelStyle}>{labelText}</Label>;
}
renderLinks() {
const msg = this.props.message;
const live = this.renderLink("Set live", "play-circle", this.props.setLive);
const liveM = this.renderLink(
"Set live",
"play-circle",
this.props.setLiveManual
);
const show = this.renderLink("Show statistics", "eye", this.props.show);
const copy = this.renderLink("Duplicate", "copy-1", this.props.copy);
const editLink = this.renderLink("Edit", "edit-3", this.onEdit, msg.isLive);
const links: React.ReactNode[] = [];
if ([METHODS.EMAIL, METHODS.SMS, METHODS.MESSENGER].includes(msg.method)) {
links.push(editLink, copy);
}
if (
[METHODS.EMAIL, METHODS.SMS, METHODS.NOTIFICATION].includes(msg.method) &&
!msg.isDraft
) {
links.push(show);
}
if (msg.kind === MESSAGE_KINDS.MANUAL) {
if (msg.isDraft) {
return [...links, liveM];
}
return links;
}
return [...links, live];
}
renderRemoveButton = onClick => {
const { message } = this.props;
const { runCount } = message;
if (runCount > 0) {
return null;
}
return (
<Tip text={__("Delete")} placement="top">
<Button btnStyle="link" onClick={onClick} icon="times-circle" />
</Tip>
);
};
toggleBulk = e => {
this.props.toggleBulk(this.props.message, e.target.checked);
};
renderSegments(message) {
let segments = message.segments || ([] as ISegment[]);
segments = segments.filter(segment => segment && segment._id);
return segments.map(segment => (
<HelperText key={segment._id}>
<Icon icon="chart-pie" /> {segment.name}
</HelperText>
));
}
renderMessengerRules(message) {
const messenger = message.messenger || ({} as IEngageMessenger);
const rules = messenger.rules || [];
return rules.map(rule => (
<HelperText key={rule._id}>
<Icon icon="sign-alt" /> {rule.text} {rule.condition} {rule.value}
</HelperText>
));
}
renderBrands(message) {
const brands = message.brands || ([] as IBrand[]);
return brands.map(brand => (
<HelperText key={brand._id}>
<Icon icon="award" /> {brand.name}
</HelperText>
));
}
onClick = () => {
const { message } = this.props;
if ([METHODS.EMAIL, METHODS.SMS].includes(message.method)) {
return this.props.show();
}
if (message.kind !== MESSAGE_KINDS.MANUAL) {
return this.props.edit();
}
};
renderType(msg) {
let icon: string = "multiply";
let label: string = "Other type";
switch (msg.method) {
case METHODS.EMAIL:
icon = "envelope";
label = __("Email");
break;
case METHODS.SMS:
icon = "comment-alt-message";
label = __("Sms");
break;
case METHODS.MESSENGER:
icon = "comment-1";
label = __("Messenger");
break;
case METHODS.NOTIFICATION:
icon = "message";
label = __("Notification");
break;
default:
break;
}
const kind = MESSAGE_KIND_FILTERS.find(item => item.name === msg.kind);
return (
<div>
<Icon icon={icon} /> {label}
<HelperText>
<Icon icon="clipboard-notes" /> {kind && kind.text}
</HelperText>
</div>
);
}
render() {
const { isChecked, message, remove } = this.props;
const { brand = { name: "" }, totalCustomersCount } = message;
return (
<tr key={message._id}>
<td>
<FormControl
checked={isChecked}
componentclass="checkbox"
onChange={this.toggleBulk}
/>
</td>
<td>
<RowTitle onClick={this.onClick}>{message.title}</RowTitle>
{this.renderBrands(message)}
{this.renderSegments(message)}
{this.renderMessengerRules(message)}
</td>
<td>{this.renderStatus()}</td>
<td className="text-primary">
<Icon icon="cube-2" />
<b> {s.numberFormat(totalCustomersCount || 0)}</b>
</td>
<td>{this.renderType(message)}</td>
<td>
<strong>{brand ? brand.name : "-"}</strong>
</td>
<td className="text-normal">
<NameCard user={message.fromUser} avatarSize={30} />
</td>
<td className="text-normal">
<Capitalize>{message.createdUserName || "-"}</Capitalize>
</td>
<td>
<Icon icon="calender" />{" "}
{dayjs(message.createdAt).format("DD MMM YYYY")}
</td>
<td>
<Tags
tags={[...(message.customerTags || []), ...(message.getTags || [])]}
/>
</td>
<td>
<ActionButtons>
{this.renderLinks()}
{this.renderRemoveButton(remove)}
</ActionButtons>
</td>
</tr>
);
}
}
export default Row;
``` | /content/code_sandbox/packages/plugin-engages-ui/src/campaigns/components/MessageListRow.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 1,945 |
```xml
import { type FactoryOpts } from 'imask';
import { h, watch, toRef, defineComponent, PropType } from 'vue-demi';
import props from './props';
import useIMask, { type ComposableParams } from './composable';
import { extractOptionsFromProps } from './utils';
export
type MaskProps = FactoryOpts & {
modelValue: string,
value: string,
unmasked: string,
typed: any,
}
// order does matter = priority
const VALUE_PROPS = ['typed', 'unmasked', 'value', 'modelValue'] as const;
export default defineComponent<MaskProps>({
name: 'imask-input',
inheritAttrs: false,
props: {
// plugin
modelValue: String,
value: String,
unmasked: String,
typed: { validator: () => true } as unknown as PropType<any>,
...props,
},
emits: [
'update:modelValue',
'update:masked',
'update:value',
'update:unmasked',
'update:typed',
'accept',
'accept:value',
'accept:masked',
'accept:unmasked',
'accept:typed',
'complete',
'complete:value',
'complete:masked',
'complete:unmasked',
'complete:typed',
],
setup (props, { attrs, emit }) {
const { el, mask, masked, unmasked, typed } = useIMask(extractOptionsFromProps(props as MaskProps, VALUE_PROPS) as FactoryOpts, {
emit,
onAccept: (event?: InputEvent) => {
// emit more events
const v = masked.value;
emit('accept:value', v, event);
emit('update:value', v, event);
emit('update:masked', v, event);
emit('update:modelValue', v, event);
emit('update:unmasked', unmasked.value, event);
emit('update:typed', typed.value, event);
},
onComplete: (event?: InputEvent) => {
emit('complete:value', masked.value, event);
},
} as ComposableParams<MaskProps>);
const pvalue = toRef(props, 'value');
const pmodelValue = toRef(props, 'modelValue');
const punmasked = toRef(props, 'unmasked');
const ptyped = toRef(props, 'typed');
masked.value = pmodelValue.value || pvalue.value || '';
unmasked.value = punmasked.value || '';
typed.value = ptyped.value;
watch(pvalue, v => masked.value = v);
watch(pmodelValue, v => masked.value = v);
watch(punmasked, v => unmasked.value = v);
watch(ptyped, v => typed.value = v);
return () => {
// TODO type?
const data: Record<string, any> = {
...attrs,
value: props.value != null ? props.value :
props.modelValue != null ? props.modelValue :
mask.value ? mask.value.displayValue :
'',
ref: el,
};
if (!props.mask) {
data.onInput = (event: InputEvent) => {
emit('update:modelValue', (event.target as HTMLInputElement).value);
emit('update:value', (event.target as HTMLInputElement).value);
}
}
return h('input', data);
};
},
});
``` | /content/code_sandbox/packages/vue-imask/src/component3-composition.ts | xml | 2016-11-10T13:04:29 | 2024-08-16T15:16:18 | imaskjs | uNmAnNeR/imaskjs | 4,881 | 740 |
```xml
import React, {FunctionComponent, PropsWithChildren} from 'react';
import {Container} from 'unstated-next';
type ContainerOrWithInitialState<T = any> = Container<any, T> | [Container<any, T>, T];
const combineUnstatedContainers = (containers: ContainerOrWithInitialState[]) => ({children}: PropsWithChildren<Record<string, unknown>>) => {
// eslint-disable-next-line unicorn/no-array-reduce
return containers.reduce<React.ReactElement>(
(tree, ContainerOrWithInitialState) => {
if (Array.isArray(ContainerOrWithInitialState)) {
const [Container, initialState] = ContainerOrWithInitialState;
return <Container.Provider initialState={initialState}>{tree}</Container.Provider>;
}
return <ContainerOrWithInitialState.Provider>{tree}</ContainerOrWithInitialState.Provider>;
},
// @ts-expect-error
children
);
};
export default combineUnstatedContainers;
``` | /content/code_sandbox/renderer/utils/combine-unstated-containers.tsx | xml | 2016-08-10T19:37:08 | 2024-08-16T07:01:58 | Kap | wulkano/Kap | 17,864 | 195 |
```xml
import * as React from 'react';
import { render } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { TestImages } from '@fluentui/example-data';
import { setRTL } from '../../Utilities';
import { Facepile } from './Facepile';
import { OverflowButtonType } from './Facepile.types';
import { PersonaSize } from '../../Persona';
import { isConformant } from '../../common/isConformant';
import type { IFacepilePersona } from './Facepile.types';
const facepilePersonas: IFacepilePersona[] = [
{
imageUrl: TestImages.personaFemale,
personaName: 'Annie Lindqvist',
data: '50%',
},
{
imageUrl: TestImages.personaFemale,
personaName: 'Aaron Reid',
data: '$1,000',
},
{
personaName: 'Alex Lundberg',
data: '75%',
onClick: (ev: React.MouseEvent<HTMLElement>, persona: IFacepilePersona) =>
console.log('You clicked on ' + persona.personaName + '. Extra data: ' + persona.data),
},
];
describe('Facepile', () => {
beforeEach(() => {
setRTL(false);
});
it('renders Facepile correctly', () => {
const { container } = render(<Facepile personas={facepilePersonas} />);
expect(container).toMatchSnapshot();
});
isConformant({
Component: Facepile,
displayName: 'Facepile',
// Problem: Doesnt pass ref to the root element.
// Solution: Ensure ref is passed correctly to the root element.
disabledTests: ['component-handles-ref', 'component-has-root-ref'],
});
it('renders with only add button if no personas found and addButtonProps are not null', () => {
const { getAllByRole } = render(<Facepile personas={[]} addButtonProps={{}} showAddButton={true} />);
expect(getAllByRole('button')).toHaveLength(1);
});
it('renders chevron overflow button if overflowButtonProps are not null and OverflowButtonType is downArrow', () => {
const { getAllByRole } = render(
<Facepile personas={[]} overflowButtonProps={{}} overflowButtonType={OverflowButtonType.downArrow} />,
);
expect(getAllByRole('button')).toHaveLength(1);
});
it('renders more overflow button if overflowButtonProps are not null as OverflowButtonType is more', () => {
const { getAllByRole } = render(
<Facepile personas={[]} overflowButtonProps={{}} overflowButtonType={OverflowButtonType.more} />,
);
expect(getAllByRole('button')).toHaveLength(1);
});
// eslint-disable-next-line @fluentui/max-len
it('renders without descriptive overflow button if overflowButtonProps are not null and maximum personas are not exceeded', () => {
const { queryAllByRole } = render(
<Facepile personas={[]} overflowButtonProps={{}} overflowButtonType={OverflowButtonType.descriptive} />,
);
expect(queryAllByRole('button')).toHaveLength(0);
});
// eslint-disable-next-line @fluentui/max-len
it('renders with descriptive overflow button if overflowButtonProps are not null and maximum personas are exceeded', () => {
const personas: IFacepilePersona[] = facepilePersonas.concat(...facepilePersonas, ...facepilePersonas);
const { getAllByRole } = render(
<Facepile
personas={personas}
maxDisplayablePersonas={5}
overflowButtonProps={{}}
overflowButtonType={OverflowButtonType.descriptive}
/>,
);
const overflowButton = getAllByRole('button')[1];
const personasDisplayed = getAllByRole('listitem');
expect(overflowButton.className).toContain('ms-Facepile-descriptiveOverflowButton');
expect(personasDisplayed).toHaveLength(5);
});
it('renders descriptive overflow button with comma-delimited persona names as title value by default', () => {
const personas: IFacepilePersona[] = facepilePersonas.concat(...facepilePersonas, ...facepilePersonas);
const maxDisplayablePersonas: number = 5;
const { getAllByRole } = render(
<Facepile
personas={personas}
maxDisplayablePersonas={maxDisplayablePersonas}
overflowButtonProps={{}}
overflowButtonType={OverflowButtonType.descriptive}
/>,
);
const overflowPersonasTitle = personas
.slice(maxDisplayablePersonas, personas.length)
.map((p: IFacepilePersona) => p.personaName)
.join(', ');
const overflowButton = getAllByRole('button')[1];
expect(overflowButton.getAttribute('title')).toEqual(overflowPersonasTitle);
});
it('renders a descriptive overflow button with a custom title', () => {
const personas: IFacepilePersona[] = facepilePersonas.concat(...facepilePersonas, ...facepilePersonas);
const title: string = 'custom title';
const { getAllByRole } = render(
<Facepile
personas={personas}
maxDisplayablePersonas={5}
overflowButtonProps={{ title }}
overflowButtonType={OverflowButtonType.descriptive}
/>,
);
const overflowButton = getAllByRole('button')[1];
expect(overflowButton.getAttribute('title')).toEqual(title);
});
it('renders no more than maximum allowed personas', () => {
const { getAllByRole } = render(
<Facepile
personas={facepilePersonas.concat(facepilePersonas, facepilePersonas, facepilePersonas)}
maxDisplayablePersonas={2}
/>,
);
expect(getAllByRole('listitem')).toHaveLength(2);
});
it('persona is clickable if onClick property is set', () => {
let clicked = 0;
const personas: IFacepilePersona[] = [
{
personaName: 'Alex Lundberg',
onClick: (ev: React.MouseEvent<HTMLElement>, persona: IFacepilePersona) => {
clicked++;
ev.preventDefault();
},
},
];
const { getAllByRole } = render(<Facepile personas={personas} />);
const buttons = getAllByRole('button');
expect(buttons).toHaveLength(1);
userEvent.click(buttons[0]);
expect(clicked).toEqual(1);
});
it('personas and buttons render default size if not specified', () => {
const { getAllByRole } = render(
<Facepile
personas={facepilePersonas}
addButtonProps={{}}
showAddButton={true}
overflowButtonProps={{}}
overflowButtonType={OverflowButtonType.downArrow}
/>,
);
const [addButton, overflowButton] = getAllByRole('button');
expect(addButton.querySelectorAll('.ms-Persona--size32')).toHaveLength(1);
expect(overflowButton.querySelectorAll('.ms-Persona--size32')).toHaveLength(1);
const faces = getAllByRole('listitem');
expect(faces).toHaveLength(facepilePersonas.length);
for (let i = 0; i < faces.length; ++i) {
expect(faces[i].querySelector('.ms-Persona--size32')).toBeTruthy();
}
});
it('personas and buttons render specified size', () => {
// Test XXS size renders
const { getAllByRole, rerender } = render(
<Facepile personas={facepilePersonas} personaSize={PersonaSize.size24} />,
);
expect(getAllByRole('listitem')).toHaveLength(facepilePersonas.length);
getAllByRole('listitem').forEach(node => {
expect(node.querySelectorAll('.ms-Persona--size24')).toHaveLength(1);
});
// Test small size renders
rerender(<Facepile personas={facepilePersonas} personaSize={PersonaSize.size40} />);
expect(getAllByRole('listitem')).toHaveLength(facepilePersonas.length);
getAllByRole('listitem').forEach(node => {
expect(node.querySelectorAll('.ms-Persona--size40')).toHaveLength(1);
});
});
it('renders Persona control if exactly one persona is sent in props', () => {
const { getAllByRole } = render(<Facepile personas={facepilePersonas.slice(0, 1)} overflowPersonas={[]} />);
expect(getAllByRole('listitem')).toHaveLength(1);
});
it('renders no Persona or PersonaCoin if 0 is passed in for maxDisplayablePersonas', () => {
const { queryAllByRole } = render(<Facepile personas={facepilePersonas} maxDisplayablePersonas={0} />);
expect(queryAllByRole('listitem')).toHaveLength(0);
});
});
``` | /content/code_sandbox/packages/react/src/components/Facepile/Facepile.test.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 1,874 |
```xml
import _ from 'lodash';
import {
utils,
TxOutputDestinationType,
AddressType,
TxAuxiliaryDataType, // CHECK THIS
CredentialParamsType,
CIP36VoteRegistrationFormat,
} from '@cardano-foundation/ledgerjs-hw-app-cardano';
import {
str_to_path,
base58_decode,
} from '@cardano-foundation/ledgerjs-hw-app-cardano/dist/utils/address';
import {
derivationPathToLedgerPath,
CERTIFICATE_TYPE,
groupTokensByPolicyId,
CATALYST_VOTING_REGISTRATION_TYPE,
} from './hardwareWalletUtils';
import { AddressStyles } from '../domains/WalletAddress';
import type { AddressStyle } from '../api/addresses/types';
import type {
CoinSelectionInput,
CoinSelectionOutput,
CoinSelectionCertificate,
CoinSelectionWithdrawal,
CoinSelectionAssetsType,
} from '../api/transactions/types';
import { TxAuxiliaryData } from './dataSerialization';
export const toTokenBundle = (assets: CoinSelectionAssetsType) => {
const tokenObject = groupTokensByPolicyId(assets);
const tokenObjectEntries = Object.entries(tokenObject);
const tokenBundle = _.map(tokenObjectEntries, ([policyId, tokens]) => {
// @ts-ignore ts-migrate(2339) FIXME: Property 'map' does not exist on type 'unknown'.
const tokensList = tokens.map(({ assetName, quantity }) => ({
assetNameHex: assetName,
amount: quantity.toString(),
}));
return {
policyIdHex: policyId,
tokens: tokensList,
};
});
return tokenBundle;
};
export const toLedgerCertificate = (cert: CoinSelectionCertificate) => {
return {
type: CERTIFICATE_TYPE[cert.certificateType],
params: {
stakeCredential: {
type: CredentialParamsType.KEY_PATH,
keyPath: derivationPathToLedgerPath(cert.rewardAccountPath),
},
poolKeyHashHex: cert.pool
? utils.buf_to_hex(utils.bech32_decodeAddress(cert.pool))
: null,
},
};
};
export const toLedgerWithdrawal = (withdrawal: CoinSelectionWithdrawal) => {
return {
stakeCredential: {
type: CredentialParamsType.KEY_PATH,
keyPath: derivationPathToLedgerPath(withdrawal.derivationPath),
},
amount: withdrawal.amount.quantity.toString(),
};
};
export const toLedgerInput = (input: CoinSelectionInput) => {
return {
txHashHex: input.id,
outputIndex: input.index,
path: derivationPathToLedgerPath(input.derivationPath),
};
};
export const toLedgerOutput = (
output: CoinSelectionOutput,
addressStyle: AddressStyle
) => {
const isChange = output.derivationPath !== null;
let tokenBundle = [];
if (output.assets) {
tokenBundle = toTokenBundle(output.assets);
}
if (isChange) {
return {
destination: {
type: TxOutputDestinationType.DEVICE_OWNED,
params: {
type: AddressType.BASE_PAYMENT_KEY_STAKE_KEY,
params: {
spendingPath: derivationPathToLedgerPath(output.derivationPath),
stakingPath: str_to_path("1852'/1815'/0'/2/0"),
},
},
},
amount: output.amount.quantity.toString(),
tokenBundle,
};
}
return {
destination: {
type: TxOutputDestinationType.THIRD_PARTY,
params: {
addressHex:
addressStyle === AddressStyles.ADDRESS_SHELLEY
? utils.buf_to_hex(utils.bech32_decodeAddress(output.address))
: utils.buf_to_hex(base58_decode(output.address)),
},
},
amount: output.amount.quantity.toString(),
tokenBundle,
};
};
export const toLedgerAuxiliaryData = (txAuxiliaryData: TxAuxiliaryData) => {
const { votingPubKey, rewardDestinationAddress, type } = txAuxiliaryData;
if (type === CATALYST_VOTING_REGISTRATION_TYPE) {
return {
type: TxAuxiliaryDataType.CIP36_REGISTRATION,
params: {
format: CIP36VoteRegistrationFormat.CIP_15,
voteKeyHex: votingPubKey,
stakingPath: rewardDestinationAddress.stakingPath,
paymentDestination: {
type: TxOutputDestinationType.DEVICE_OWNED,
params: {
type: AddressType.BASE_PAYMENT_KEY_STAKE_KEY,
params: {
stakingPath: rewardDestinationAddress.stakingPath,
spendingPath: str_to_path(
rewardDestinationAddress.address.spendingPath
),
},
},
},
nonce: `${txAuxiliaryData.nonce}`,
},
};
}
// Regular tx has no voting metadata
return null;
};
``` | /content/code_sandbox/source/renderer/app/utils/shelleyLedger.ts | xml | 2016-10-05T13:48:54 | 2024-08-13T22:03:19 | daedalus | input-output-hk/daedalus | 1,230 | 1,041 |
```xml
export * from './components/Carousel/index';
``` | /content/code_sandbox/packages/react-components/react-carousel-preview/library/src/Carousel.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 10 |
```xml
import { G2Spec } from '../../../src';
export function miserableForceDefault(): G2Spec {
return {
type: 'forceGraph',
data: {
type: 'fetch',
value: 'data/miserable.json',
},
scale: { color: { type: 'ordinal' } },
};
}
``` | /content/code_sandbox/__tests__/plots/static/miserable-force-default.ts | xml | 2016-05-26T09:21:04 | 2024-08-15T16:11:17 | G2 | antvis/G2 | 12,060 | 70 |
```xml
export default class Maker {
platforms = ['win32'];
}
``` | /content/code_sandbox/packages/api/core/test/fixture/maker-wrong-platform.ts | xml | 2016-10-05T14:51:53 | 2024-08-15T20:08:12 | forge | electron/forge | 6,380 | 14 |
```xml
import {
ComponentRef,
Injector,
ViewContainerRef
} from '@angular/core';
export interface ComponentType<T> {
new (...args: any[]): T;
}
/**
* A `ComponentPortal` is a portal that instantiates some Component upon attachment.
*/
export class ComponentPortal<T> {
private _attachedHost?: BasePortalHost;
/** The type of the component that will be instantiated for attachment. */
component: ComponentType<T>;
/**
* [Optional] Where the attached component should live in Angular's *logical* component tree.
* This is different from where the component *renders*, which is determined by the PortalHost.
* The origin necessary when the host is outside of the Angular application context.
*/
viewContainerRef!: ViewContainerRef;
/** Injector used for the instantiation of the component. */
injector: Injector;
constructor(component: ComponentType<T>, injector: Injector) {
this.component = component;
this.injector = injector;
}
/** Attach this portal to a host. */
attach(host: BasePortalHost, newestOnTop: boolean): ComponentRef<any> {
this._attachedHost = host;
return host.attach(this, newestOnTop);
}
/** Detach this portal from its host */
detach() {
const host = this._attachedHost;
if (host) {
this._attachedHost = undefined;
return host.detach();
}
}
/** Whether this portal is attached to a host. */
get isAttached(): boolean {
return this._attachedHost != null;
}
/**
* Sets the PortalHost reference without performing `attach()`. This is used directly by
* the PortalHost when it is performing an `attach()` or `detach()`.
*/
setAttachedHost(host?: BasePortalHost) {
this._attachedHost = host;
}
}
/**
* Partial implementation of PortalHost that only deals with attaching a
* ComponentPortal
*/
export abstract class BasePortalHost {
/** The portal currently attached to the host. */
private _attachedPortal?: ComponentPortal<any>;
/** A function that will permanently dispose this host. */
private _disposeFn?: () => void;
attach(portal: ComponentPortal<any>, newestOnTop: boolean) {
this._attachedPortal = portal;
return this.attachComponentPortal(portal, newestOnTop);
}
abstract attachComponentPortal<T>(portal: ComponentPortal<T>, newestOnTop: boolean): ComponentRef<T>;
detach() {
if (this._attachedPortal) {
this._attachedPortal.setAttachedHost();
}
this._attachedPortal = undefined;
if (this._disposeFn) {
this._disposeFn();
this._disposeFn = undefined;
}
}
setDisposeFn(fn: () => void) {
this._disposeFn = fn;
}
}
``` | /content/code_sandbox/src/lib/portal/portal.ts | xml | 2016-07-28T17:19:43 | 2024-08-12T13:14:04 | ngx-toastr | scttcper/ngx-toastr | 2,491 | 610 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../LocalizableStrings.resx">
<body>
<trans-unit id="DownloadVersionFailed">
<source>Downloading {0} version {1} failed.</source>
<target state="translated">{0} {1} </target>
<note />
</trans-unit>
<trans-unit id="FailedToFindSourceUnderPackageSourceMapping">
<source>Package Source Mapping is enabled, but no source found under the specified package ID: {0}. See the documentation for Package Source Mapping at path_to_url for more details.</source>
<target state="translated"> ID {0} path_to_url </target>
<note />
</trans-unit>
<trans-unit id="FailedToLoadNuGetSource">
<source>Failed to load NuGet source {0}</source>
<target state="translated">NuGet {0} </target>
<note />
</trans-unit>
<trans-unit id="FailedToLoadNuGetSourceSourceIsNotValid">
<source>Failed to load NuGet source {0}: the source is not valid. It will be skipped in further processing.</source>
<target state="translated">NuGet {0} : </target>
<note />
</trans-unit>
<trans-unit id="FailedToMapSourceUnderPackageSourceMapping">
<source>Package Source Mapping is enabled, but no source mapped under the specified package ID: {0}. See the documentation for Package Source Mapping at path_to_url for more details.</source>
<target state="translated"> ID {0} path_to_url </target>
<note />
</trans-unit>
<trans-unit id="FailedToValidatePackageSigning">
<source>Failed to validate package signing.</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="IsNotFoundInNuGetFeeds">
<source>{0} is not found in NuGet feeds {1}.</source>
<target state="needs-review-translation">{0} NuGet {1} </target>
<note />
</trans-unit>
<trans-unit id="NuGetPackageSignatureVerificationSkipped">
<source>Skipping NuGet package signature verification.</source>
<target state="translated">NuGet </target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionDefault">
<source>A version of {0} of package {1}</source>
<target state="translated"> {1} {0} </target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionForExactVersionMatch">
<source>Version {0} of package {1}</source>
<target state="translated"> {1} {0}</target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionForVersionWithLowerAndUpperBounds">
<source>A version between {0} and {1} of package {2}</source>
<target state="translated"> {2} {0} {1} </target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionForVersionWithLowerBound">
<source>A version higher than {0} of package {1}</source>
<target state="translated"> {1} {0} </target>
<note />
</trans-unit>
<trans-unit id="PackageVersionDescriptionForVersionWithUpperBound">
<source>A version less than {0} of package {1}</source>
<target state="translated"> {1} {0} </target>
<note />
</trans-unit>
<trans-unit id="SkipNuGetpackageSigningValidationmacOSLinux">
<source>Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS path_to_url .</source>
<target state="translated">NuGet NuGet Linux macOS path_to_url </target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Cli/dotnet/NugetPackageDownloader/xlf/LocalizableStrings.ja.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 984 |
```xml
<vector xmlns:android="path_to_url"
xmlns:aapt="path_to_url"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:pathData="M37,6H11C9.343,6 8,7.343 8,9V39C8,40.657 9.343,42 11,42H37C38.657,42 40,40.657 40,39V9C40,7.343 38.657,6 37,6ZM10,9C10,8.448 10.448,8 11,8H37C37.552,8 38,8.448 38,9V39C38,39.552 37.552,40 37,40H11C10.448,40 10,39.552 10,39V9ZM25,15C24.448,15 24,15.448 24,16V34C24,34.552 24.448,35 25,35H28C28.552,35 29,34.552 29,34V16C29,15.448 28.552,15 28,15H25ZM18,27C18,26.448 18.448,26 19,26H22C22.552,26 23,26.448 23,27V34C23,34.552 22.552,35 22,35H19C18.448,35 18,34.552 18,34V27ZM13,31C12.448,31 12,31.448 12,32V34C12,34.552 12.448,35 13,35H16C16.552,35 17,34.552 17,34V32C17,31.448 16.552,31 16,31H13ZM12.5,36C12.224,36 12,36.224 12,36.5C12,36.776 12.224,37 12.5,37H34.5C34.776,37 35,36.776 35,36.5C35,36.224 34.776,36 34.5,36H12.5ZM30,22C30,21.448 30.448,21 31,21H34C34.552,21 35,21.448 35,22V34C35,34.552 34.552,35 34,35H31C30.448,35 30,34.552 30,34V22Z"
android:fillType="evenOdd">
<aapt:attr name="android:fillColor">
<gradient
android:startX="24"
android:startY="6"
android:endX="24"
android:endY="42"
android:type="linear">
<item android:offset="0" android:color="#FF29DD74"/>
<item android:offset="1" android:color="#FF09BF5B"/>
</gradient>
</aapt:attr>
</path>
</vector>
``` | /content/code_sandbox/icon-pack/src/main/res/drawable/ic_numbers_thumbnail_outline.xml | xml | 2016-05-04T11:46:20 | 2024-08-15T16:29:10 | android | meganz/android | 1,537 | 724 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A0C1595C-FA3E-4B7A-936C-306BC6294C5E}</ProjectGuid>
<RootNamespace>Updater</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>Updater</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\Plugins.props" />
</ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Link>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>bcrypt.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Link>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>bcrypt.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Link>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>bcrypt.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Link>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>bcrypt.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>bcrypt.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Link>
<AdditionalDependencies>bcrypt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>bcrypt.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.c" />
<ClCompile Include="options.c" />
<ClCompile Include="page1.c" />
<ClCompile Include="page2.c" />
<ClCompile Include="page3.c" />
<ClCompile Include="page4.c" />
<ClCompile Include="page5.c" />
<ClCompile Include="updater.c" />
<ClCompile Include="verify.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="updater.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<None Include="CHANGELOG.txt" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Updater.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
``` | /content/code_sandbox/plugins/Updater/Updater.vcxproj | xml | 2016-02-01T08:10:21 | 2024-08-16T17:50:20 | systeminformer | winsiderss/systeminformer | 10,712 | 1,413 |
```xml
/*
* Wire
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program. If not, see path_to_url
*
*/
import {render} from '@testing-library/react';
import ko from 'knockout';
import {CompositeMessage} from 'src/script/entity/message/CompositeMessage';
import {MessageButton} from './MessageButton';
import {withTheme} from '../../../../../../auth/util/test/TestUtil';
describe('MessageButton', () => {
it('shows error message', async () => {
const messageId = 'id';
const messageError = 'error';
const message: Partial<CompositeMessage> = {
errorButtonId: ko.observable<string | undefined>(messageId),
errorMessage: ko.observable(messageError),
selectedButtonId: ko.observable<string | undefined>(''),
waitingButtonId: ko.observable<string | undefined>(''),
};
const props = {
id: messageId,
label: 'buttonLabel',
message: message as CompositeMessage,
};
const {queryByText} = render(withTheme(<MessageButton {...props} />));
expect(queryByText(messageError)).not.toBeNull();
});
it('renders selected button', async () => {
const messageId = 'id';
const message: Partial<CompositeMessage> = {
errorButtonId: ko.observable<string | undefined>(''),
errorMessage: ko.observable(''),
selectedButtonId: ko.observable<string | undefined>(messageId),
waitingButtonId: ko.observable<string | undefined>(''),
};
const props = {
id: messageId,
label: 'buttonLabel',
message: message as CompositeMessage,
};
const {queryByTestId, container} = render(withTheme(<MessageButton {...props} />));
expect(queryByTestId('message-button-error')).toBeNull();
const selectedButton = container.querySelector(`button[data-uie-uid="${messageId}"]`);
expect(selectedButton).not.toBeNull();
expect(selectedButton!.getAttribute('data-uie-selected')).toBe('true');
});
});
``` | /content/code_sandbox/src/script/components/MessagesList/Message/ContentMessage/asset/MessageButton/MessageButton.test.tsx | xml | 2016-07-21T15:34:05 | 2024-08-16T11:40:13 | wire-webapp | wireapp/wire-webapp | 1,125 | 481 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
path_to_url
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-->
<resources xmlns:android="path_to_url"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="bsp_done_label" msgid="7007948707597430919">"Gotowe"</string>
<string name="bsp_hour_picker_description" msgid="7586639618712934060">"Koowy suwak godzin"</string>
<string name="bsp_minute_picker_description" msgid="6024811202872705251">"Koowy suwak minut"</string>
<string name="bsp_select_hours" msgid="7651068754188418859">"Wybierz godziny"</string>
<string name="bsp_select_minutes" msgid="8327182090226828481">"Wybierz minuty"</string>
<string name="bsp_day_picker_description" msgid="3968620852217927702">"Siatka miesiczna z dniami"</string>
<string name="bsp_year_picker_description" msgid="6963340404644587098">"Lista lat"</string>
<string name="bsp_select_day" msgid="3973338219107019769">"Wybierz miesic i dzie"</string>
<string name="bsp_select_year" msgid="2603330600102539372">"Wybierz rok"</string>
<string name="bsp_item_is_selected" msgid="2674929164900463786">"Wybrae <xliff:g id="ITEM">%1$s</xliff:g>"</string>
<string name="bsp_deleted_key" msgid="6908431551612331381">"<xliff:g id="KEY">%1$s</xliff:g> usunite"</string>
</resources>
``` | /content/code_sandbox/bottomsheetpickers/src/main/res/values-pl/strings.xml | xml | 2016-10-06T01:20:05 | 2024-08-05T10:12:07 | BottomSheetPickers | philliphsu/BottomSheetPickers | 1,101 | 430 |
```xml
testNamespace.callbackWithDraggableParamsReporters(function (hello, goodbye, e, f) {
})
testNamespace.callbackWithDraggableParamsReporters(function (what, are, you, doing) {
})
testNamespace.callbackWithDraggableParamsReporters(function (stahp, d, e, f) {
})
testNamespace.callbackWithDraggableParamsReporters(function (c, d, e, f) {
})
``` | /content/code_sandbox/tests/blocklycompiler-test/baselines/draggable_parameters_reporters.ts | xml | 2016-01-24T19:35:52 | 2024-08-16T16:39:39 | pxt | microsoft/pxt | 2,069 | 87 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>RNPermissionsExample</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSAppleMusicUsageDescription</key>
<string>Let me use your media library</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Let me use bluetooth</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Let me use bluetooth</string>
<key>NSCalendarsFullAccessUsageDescription</key>
<string>Let me use your calendars</string>
<key>NSCalendarsWriteOnlyAccessUsageDescription</key>
<string>Let me use your calendars</string>
<key>NSCameraUsageDescription</key>
<string>Let me use the camera</string>
<key>NSContactsUsageDescription</key>
<string>Let me use your contacts</string>
<key>NSFaceIDUsageDescription</key>
<string>Let me use FaceID</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Let me use your location, even in background</string>
<key>NSLocationTemporaryUsageDescriptionDictionary</key>
<dict>
<key>full-accuracy</key>
<string>Let me use your precise location temporarily</string>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Let me use your location when the app is opened</string>
<key>NSMicrophoneUsageDescription</key>
<string>Let me use the microphone</string>
<key>NSMotionUsageDescription</key>
<string>Let me use your motion data</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Let me add photos</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Let me use your photo library</string>
<key>NSRemindersFullAccessUsageDescription</key>
<string>Let me use your reminders</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>Let me use speech recognition</string>
<key>NSUserTrackingUsageDescription</key>
<string>Let me use your ad identifier</string>
<key>UIAppFonts</key>
<array>
<string>MaterialCommunityIcons.ttf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-peripheral</string>
<string>location</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
``` | /content/code_sandbox/example/ios/RNPermissionsExample/Info.plist | xml | 2016-03-24T16:33:42 | 2024-08-15T16:56:05 | react-native-permissions | zoontek/react-native-permissions | 4,008 | 938 |
```xml
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
``` | /content/code_sandbox/apps/core-create-react-app/src/App.test.tsx | xml | 2016-09-29T17:24:17 | 2024-08-11T17:06:15 | clarity | vmware-archive/clarity | 6,431 | 64 |
```xml
<dict>
<key>CommonPeripheralDSP</key>
<array>
<dict>
<key>DeviceID</key>
<integer>0</integer>
<key>DeviceType</key>
<string>Headphone</string>
</dict>
<dict>
<key>DeviceID</key>
<integer>0</integer>
<key>DeviceType</key>
<string>Microphone</string>
</dict>
</array>
<key>PathMaps</key>
<array>
<dict>
<key>PathMap</key>
<array>
<array>
<array>
<array>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<true/>
<key>PublishMute</key>
<true/>
<key>PublishVolume</key>
<true/>
<key>VolumeInputAmp</key>
<true/>
</dict>
<key>NodeID</key>
<integer>9</integer>
</dict>
<dict>
<key>NodeID</key>
<integer>34</integer>
</dict>
<dict>
<key>Boost</key>
<integer>1</integer>
<key>NodeID</key>
<integer>18</integer>
</dict>
</array>
</array>
</array>
<array>
<array>
<array>
<dict>
<key>NodeID</key>
<integer>23</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>MuteInputAmp</key>
<true/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<false/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>13</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<false/>
<key>PublishMute</key>
<true/>
<key>PublishVolume</key>
<true/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>3</integer>
</dict>
</array>
</array>
<array>
<array>
<dict>
<key>NodeID</key>
<integer>33</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>MuteInputAmp</key>
<true/>
<key>PublishMute</key>
<false/>
<key>PublishVolume</key>
<false/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>12</integer>
</dict>
<dict>
<key>Amp</key>
<dict>
<key>Channels</key>
<array>
<dict>
<key>Bind</key>
<integer>1</integer>
<key>Channel</key>
<integer>1</integer>
</dict>
<dict>
<key>Bind</key>
<integer>2</integer>
<key>Channel</key>
<integer>2</integer>
</dict>
</array>
<key>MuteInputAmp</key>
<false/>
<key>PublishMute</key>
<true/>
<key>PublishVolume</key>
<true/>
<key>VolumeInputAmp</key>
<false/>
</dict>
<key>NodeID</key>
<integer>2</integer>
</dict>
</array>
</array>
</array>
</array>
<key>PathMapID</key>
<integer>3266</integer>
</dict>
</array>
</dict>
``` | /content/code_sandbox/Resources/ALC298/Platforms72.xml | xml | 2016-03-07T20:45:58 | 2024-08-14T08:57:03 | AppleALC | acidanthera/AppleALC | 3,420 | 1,301 |
```xml
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
import { getMockedCrypto } from '../../MockedCrypto'
import { EncryptedInputParameters, EncryptedOutputParameters } from '../../../../Types/EncryptedParameters'
import { GenerateSymmetricPayloadSignatureResultUseCase } from './GenerateSymmetricPayloadSignatureResult'
import { GenerateSymmetricAdditionalDataUseCase } from './GenerateSymmetricAdditionalData'
import { CreateConsistentBase64JsonPayloadUseCase } from '../Utils/CreateConsistentBase64JsonPayload'
import { doesPayloadRequireSigning } from '../../V004AlgorithmHelpers'
import { PersistentSignatureData } from '@standardnotes/models'
import { HashStringUseCase } from '../Hash/HashString'
import { HashingKey } from '../Hash/HashingKey'
describe('generate symmetric signing data usecase', () => {
let crypto: PureCryptoInterface
let usecase: GenerateSymmetricPayloadSignatureResultUseCase
let hashUsecase: HashStringUseCase
let additionalDataUseCase: GenerateSymmetricAdditionalDataUseCase
let encodeUseCase: CreateConsistentBase64JsonPayloadUseCase
beforeEach(() => {
crypto = getMockedCrypto()
usecase = new GenerateSymmetricPayloadSignatureResultUseCase(crypto)
hashUsecase = new HashStringUseCase(crypto)
additionalDataUseCase = new GenerateSymmetricAdditionalDataUseCase(crypto)
encodeUseCase = new CreateConsistentBase64JsonPayloadUseCase(crypto)
})
it('payload with shared vault uuid should require signature', () => {
const payload: Partial<EncryptedOutputParameters> = {
shared_vault_uuid: '456',
}
expect(doesPayloadRequireSigning(payload)).toBe(true)
})
it('payload with key system identifier only should not require signature', () => {
const payload: Partial<EncryptedOutputParameters> = {
key_system_identifier: '123',
}
expect(doesPayloadRequireSigning(payload)).toBe(false)
})
it('payload without key system identifier or shared vault uuid should not require signature', () => {
const payload: Partial<EncryptedOutputParameters> = {
key_system_identifier: undefined,
shared_vault_uuid: undefined,
}
expect(doesPayloadRequireSigning(payload)).toBe(false)
})
it('signature should be verified with correct parameters', () => {
const payload = {
key_system_identifier: '123',
shared_vault_uuid: '456',
} as jest.Mocked<EncryptedInputParameters>
const hashingKey: HashingKey = { key: 'secret-123' }
const content = 'contentplaintext'
const contentKey = 'contentkeysecret'
const keypair = crypto.sodiumCryptoSignSeedKeypair('seedling')
const contentAdditionalDataResultResult = additionalDataUseCase.execute(content, hashingKey, keypair)
const contentKeyAdditionalDataResultResult = additionalDataUseCase.execute(contentKey, hashingKey, keypair)
const result = usecase.execute(
payload,
hashingKey,
{
additionalData: encodeUseCase.execute(contentKeyAdditionalDataResultResult.additionalData),
plaintext: contentKey,
},
{
additionalData: encodeUseCase.execute(contentAdditionalDataResultResult.additionalData),
plaintext: content,
},
)
expect(result).toEqual({
required: true,
contentHash: expect.any(String),
result: {
passes: true,
publicKey: keypair.publicKey,
signature: expect.any(String),
},
})
})
it('should return required false with no result if no signing data is provided and signing is not required', () => {
const payloadWithOptionalSigning = {
key_system_identifier: undefined,
shared_vault_uuid: undefined,
} as jest.Mocked<EncryptedInputParameters>
const hashingKey: HashingKey = { key: 'secret-123' }
const content = 'contentplaintext'
const contentKey = 'contentkeysecret'
const contentAdditionalDataResult = additionalDataUseCase.execute(content, hashingKey, undefined)
const contentKeyAdditionalDataResult = additionalDataUseCase.execute(contentKey, hashingKey, undefined)
const result = usecase.execute(
payloadWithOptionalSigning,
hashingKey,
{
additionalData: encodeUseCase.execute(contentKeyAdditionalDataResult.additionalData),
plaintext: contentKey,
},
{
additionalData: encodeUseCase.execute(contentAdditionalDataResult.additionalData),
plaintext: content,
},
)
expect(result).toEqual({
required: false,
contentHash: expect.any(String),
})
})
it('should return required true with fail result if no signing data is provided and signing is required', () => {
const payloadWithRequiredSigning = {
key_system_identifier: '123',
shared_vault_uuid: '456',
} as jest.Mocked<EncryptedInputParameters>
const hashingKey: HashingKey = { key: 'secret-123' }
const content = 'contentplaintext'
const contentKey = 'contentkeysecret'
const contentAdditionalDataResult = additionalDataUseCase.execute(content, hashingKey, undefined)
const contentKeyAdditionalDataResult = additionalDataUseCase.execute(contentKey, hashingKey, undefined)
const result = usecase.execute(
payloadWithRequiredSigning,
hashingKey,
{
additionalData: encodeUseCase.execute(contentKeyAdditionalDataResult.additionalData),
plaintext: contentKey,
},
{
additionalData: encodeUseCase.execute(contentAdditionalDataResult.additionalData),
plaintext: content,
},
)
expect(result).toEqual({
required: true,
contentHash: expect.any(String),
result: {
passes: false,
publicKey: '',
signature: '',
},
})
})
it('should fail if content public key differs from contentKey public key', () => {
const payload = {
key_system_identifier: '123',
shared_vault_uuid: '456',
} as jest.Mocked<EncryptedInputParameters>
const hashingKey: HashingKey = { key: 'secret-123' }
const content = 'contentplaintext'
const contentKey = 'contentkeysecret'
const contentKeyPair = crypto.sodiumCryptoSignSeedKeypair('contentseed')
const contentKeyKeyPair = crypto.sodiumCryptoSignSeedKeypair('contentkeyseed')
const contentAdditionalDataResult = additionalDataUseCase.execute(content, hashingKey, contentKeyPair)
const contentKeyAdditionalDataResult = additionalDataUseCase.execute(contentKey, hashingKey, contentKeyKeyPair)
const result = usecase.execute(
payload,
hashingKey,
{
additionalData: encodeUseCase.execute(contentKeyAdditionalDataResult.additionalData),
plaintext: contentKey,
},
{
additionalData: encodeUseCase.execute(contentAdditionalDataResult.additionalData),
plaintext: content,
},
)
expect(result).toEqual({
required: true,
contentHash: expect.any(String),
result: {
passes: false,
publicKey: '',
signature: '',
},
})
})
it('if content hash has not changed and previous failing signature is supplied, new result should also be failing', () => {
const hashingKey: HashingKey = { key: 'secret-123' }
const content = 'contentplaintext'
const contentKey = 'contentkeysecret'
const contentHash = hashUsecase.execute(content, hashingKey)
const previousResult: PersistentSignatureData = {
required: true,
contentHash: contentHash,
result: {
passes: false,
publicKey: '',
signature: '',
},
}
const payload = {
key_system_identifier: '123',
shared_vault_uuid: '456',
signatureData: previousResult,
} as jest.Mocked<EncryptedInputParameters>
const keypair = crypto.sodiumCryptoSignSeedKeypair('seedling')
const contentAdditionalDataResultResult = additionalDataUseCase.execute(content, hashingKey, keypair)
const contentKeyAdditionalDataResultResult = additionalDataUseCase.execute(contentKey, hashingKey, keypair)
const result = usecase.execute(
payload,
hashingKey,
{
additionalData: encodeUseCase.execute(contentKeyAdditionalDataResultResult.additionalData),
plaintext: contentKey,
},
{
additionalData: encodeUseCase.execute(contentAdditionalDataResultResult.additionalData),
plaintext: content,
},
)
expect(result).toEqual({
required: true,
contentHash: contentHash,
result: {
passes: false,
publicKey: keypair.publicKey,
signature: expect.any(String),
},
})
})
it('previous failing signature should be ignored if content hash has changed', () => {
const hashingKey: HashingKey = { key: 'secret-123' }
const content = 'contentplaintext'
const contentKey = 'contentkeysecret'
const previousResult: PersistentSignatureData = {
required: true,
contentHash: 'different hash',
result: {
passes: false,
publicKey: '',
signature: '',
},
}
const payload = {
key_system_identifier: '123',
shared_vault_uuid: '456',
signatureData: previousResult,
} as jest.Mocked<EncryptedInputParameters>
const keypair = crypto.sodiumCryptoSignSeedKeypair('seedling')
const contentAdditionalDataResultResult = additionalDataUseCase.execute(content, hashingKey, keypair)
const contentKeyAdditionalDataResultResult = additionalDataUseCase.execute(contentKey, hashingKey, keypair)
const result = usecase.execute(
payload,
hashingKey,
{
additionalData: encodeUseCase.execute(contentKeyAdditionalDataResultResult.additionalData),
plaintext: contentKey,
},
{
additionalData: encodeUseCase.execute(contentAdditionalDataResultResult.additionalData),
plaintext: content,
},
)
expect(result).toEqual({
required: true,
contentHash: expect.any(String),
result: {
passes: true,
publicKey: keypair.publicKey,
signature: expect.any(String),
},
})
})
})
``` | /content/code_sandbox/packages/encryption/src/Domain/Operator/004/UseCase/Symmetric/GenerateSymmetricPayloadSignatureResult.spec.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 2,177 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<entries>
<!--
/cron/fanout params:
queue=<QUEUE_NAME>
endpoint=<ENDPOINT_NAME> // URL Path of servlet, which may contain placeholders:
runInEmpty // Run once, with no tld parameter
forEachRealTld // Run for tlds with getTldType() == TldType.REAL
forEachTestTld // Run for tlds with getTldType() == TldType.TEST
exclude=TLD1[,TLD2] // exclude something otherwise included
-->
<task>
<url>/_dr/task/rdeStaging</url>
<name>rdeStaging</name>
<description>
This job generates a full RDE escrow deposit as a single gigantic XML document
and streams it to cloud storage. When this job has finished successfully, it'll
launch a separate task that uploads the deposit file to Iron Mountain via SFTP.
</description>
<!--
This only needs to run once per day, but we launch additional jobs in case the
cursor is lagging behind, so it'll catch up to the current date as quickly as
possible. The only job that'll run under normal circumstances is the one that's
close to midnight, since if the cursor is up-to-date, the task is a no-op.
We want it to be close to midnight because that reduces the chance that the
point-in-time code won't have to go to the extra trouble of fetching old
versions of objects from the database. However, we don't want it to run too
close to midnight, because there's always a chance that a change which was
timestamped before midnight hasn't fully been committed to the database. So
we add a 4+ minute grace period to ensure the transactions cool down, since
our queries are not transactional.
-->
<schedule>7 */4 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=rde-upload&endpoint=/_dr/task/rdeUpload&forEachRealTld]]></url>
<name>rdeUpload</name>
<description>
This job is a no-op unless RdeUploadCursor falls behind for some reason.
</description>
<schedule>0 */4 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=rde-report&endpoint=/_dr/task/rdeReport&forEachRealTld]]></url>
<name>rdeReport</name>
<description>
This job is a no-op unless RdeReportCursor falls behind for some reason.
</description>
<schedule>0 */4 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=marksdb&endpoint=/_dr/task/tmchDnl&runInEmpty]]></url>
<name>tmchDnl</name>
<description>
This job downloads the latest DNL from MarksDB and inserts it into the database.
(See: TmchDnlAction, ClaimsList)
</description>
<schedule>0 */12 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=marksdb&endpoint=/_dr/task/tmchSmdrl&runInEmpty]]></url>
<name>tmchSmdrl</name>
<description>
This job downloads the latest SMDRL from MarksDB and inserts it into the database.
(See: TmchSmdrlAction, SignedMarkRevocationList)
</description>
<schedule>15 */12 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=marksdb&endpoint=/_dr/task/tmchCrl&runInEmpty]]></url>
<name>tmchCrl</name>
<description>
This job downloads the latest CRL from MarksDB and inserts it into the database.
(See: TmchCrlAction)
</description>
<schedule>0 */12 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=retryable-cron-tasks&endpoint=/_dr/task/syncGroupMembers&runInEmpty]]></url>
<name>syncGroupMembers</name>
<description>
Syncs RegistrarContact changes in the past hour to Google Groups.
</description>
<schedule>0 */1 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=sheet&endpoint=/_dr/task/syncRegistrarsSheet&runInEmpty]]></url>
<name>syncRegistrarsSheet</name>
<description>
Synchronize Registrar entities to Google Spreadsheets.
</description>
<schedule>0 */1 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=retryable-cron-tasks&endpoint=/_dr/task/deleteProberData&runInEmpty]]></url>
<name>deleteProberData</name>
<description>
This job clears out data from probers and runs once a week.
</description>
<schedule>0 14 * * 1</schedule>
</task>
<!-- TODO: Add borgmon job to check that these files are created and updated successfully. -->
<task>
<url><![CDATA[/_dr/cron/fanout?queue=retryable-cron-tasks&endpoint=/_dr/task/exportReservedTerms&forEachRealTld]]></url>
<name>exportReservedTerms</name>
<description>
Reserved terms export to Google Drive job for creating once-daily exports.
</description>
<schedule>30 5 * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/cron/fanout?queue=retryable-cron-tasks&endpoint=/_dr/task/exportPremiumTerms&forEachRealTld]]></url>
<name>exportPremiumTerms</name>
<description>
Exports premium price lists to the Google Drive folders for each TLD once per day.
</description>
<schedule>0 5 * * *</schedule>
</task>
<task>
<url>
<![CDATA[/_dr/cron/fanout?queue=dns-refresh&forEachRealTld&forEachTestTld&endpoint=/_dr/task/readDnsRefreshRequests&dnsJitterSeconds=45]]></url>
<name>readDnsRefreshRequests</name>
<description>
Enqueue a ReadDnsRefreshRequestAction for each TLD.
</description>
<schedule>*/1 * * * *</schedule>
</task>
<task>
<url><![CDATA[/_dr/task/deleteExpiredDomains]]></url>
<name>deleteExpiredDomains</name>
<description>
This job runs an action that deletes domains that are past their
autorenew end date.
</description>
<schedule>7 3 * * *</schedule>
</task>
</entries>
``` | /content/code_sandbox/core/src/main/java/google/registry/env/crash/default/WEB-INF/cloud-scheduler-tasks.xml | xml | 2016-02-29T20:16:48 | 2024-08-15T19:49:29 | nomulus | google/nomulus | 1,685 | 1,604 |
```xml
import { Component, Input, ViewChild, ViewEncapsulation, OnInit, OnDestroy, ElementRef } from '@angular/core';
import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ToastrService } from 'ngx-toastr';
import { AuthService } from '../auth/auth.service';
import { UtilitiesService } from '../utilities.service';
import { DatatableComponent } from '@swimlane/ngx-datatable';
import { WorkflowStatus } from '../models/execution/workflowStatus';
import { NodeStatuses } from '../models/execution/nodeStatus';
import { JsonModalComponent } from './json.modal.component';
@Component({
selector: 'results-modal-component',
templateUrl: './results.modal.html',
styleUrls: [
'./results.modal.scss',
],
encapsulation: ViewEncapsulation.None,
})
export class ResultsModalComponent implements OnInit, OnDestroy {
@Input() loadedWorkflowStatus: WorkflowStatus;
@ViewChild('nodeStatusContainer', { static: false }) nodeStatusContainer: ElementRef;
@ViewChild('nodeStatusTable', { static: false }) nodeStatusTable: DatatableComponent;
NodeStatuses = NodeStatuses;
editorOptionsData: any = {
mode: 'code',
modes: ['code', 'view'],
history: false,
search: false,
// mainMenuBar: false,
navigationBar: false,
statusBar: false,
enableSort: false,
enableTransform: false,
onEditable: () => false
}
constructor(public activeModal: NgbActiveModal, public utils: UtilitiesService,
public toastrService: ToastrService, public authService: AuthService,
public modalService: NgbModal) { }
ngOnInit(): void {}
ngOnDestroy(): void {}
resultsModal(results) {
const modalRef = this.modalService.open(JsonModalComponent, { size: 'lg', centered: true });
modalRef.componentInstance.results = results;
return false;
}
}
``` | /content/code_sandbox/api/client/src/app/execution/results.modal.component.ts | xml | 2016-06-08T16:34:46 | 2024-08-16T18:12:30 | WALKOFF | nsacyber/WALKOFF | 1,198 | 410 |
```xml
import React, { ReactNode } from 'react';
import { connectField } from 'uniforms';
import AutoField from './AutoField';
import ListDelField from './ListDelField';
export type ListItemFieldProps = { children?: ReactNode; value?: unknown };
function ListItem({
children = <AutoField label={null} name="" />,
}: ListItemFieldProps) {
return (
<div>
<ListDelField name="" />
{children}
</div>
);
}
export default connectField<ListItemFieldProps>(ListItem, {
initialValue: false,
});
``` | /content/code_sandbox/packages/uniforms-unstyled/src/ListItemField.tsx | xml | 2016-05-10T13:08:50 | 2024-08-13T11:27:18 | uniforms | vazco/uniforms | 1,934 | 122 |
```xml
import AsyncStorage from '@react-native-async-storage/async-storage';
import { Asset } from 'expo-asset';
import * as FileSystem from 'expo-file-system';
// import * as Progress from 'expo-progress';
import type {
DownloadProgressData,
DownloadResumable,
FileSystemNetworkTaskProgressCallback,
UploadProgressData,
UploadTask,
} from 'expo-file-system';
import React from 'react';
import { Alert, ScrollView, Text, Platform } from 'react-native';
import HeadingText from '../components/HeadingText';
import ListButton from '../components/ListButton';
import SimpleActionDemo from '../components/SimpleActionDemo';
const { StorageAccessFramework } = FileSystem;
interface State {
downloadProgress: number;
uploadProgress: number;
permittedURI: string | null;
createdFileURI: string | null;
}
export default class FileSystemScreen extends React.Component<object, State> {
static navigationOptions = {
title: 'FileSystem',
};
readonly state: State = {
downloadProgress: 0,
uploadProgress: 0,
permittedURI: null,
createdFileURI: null,
};
download?: DownloadResumable;
upload?: UploadTask;
_download = async () => {
const url = 'path_to_url
await FileSystem.downloadAsync(url, FileSystem.documentDirectory + 'sample-1.zip');
alert('Download complete!');
};
_startDownloading = async () => {
const url = 'path_to_url
const fileUri = FileSystem.documentDirectory + 'sample-5.zip';
const callback: FileSystemNetworkTaskProgressCallback<DownloadProgressData> = (
downloadProgress
) => {
const progress =
downloadProgress.totalBytesWritten / downloadProgress.totalBytesExpectedToWrite;
this.setState({
downloadProgress: progress,
});
};
const options = { md5: true };
this.download = FileSystem.createDownloadResumable(url, fileUri, options, callback);
try {
const result = await this.download.downloadAsync();
if (result) {
this._downloadComplete();
}
} catch (e) {
console.log(e);
}
};
_pause = async () => {
if (!this.download) {
alert('Initiate a download first!');
return;
}
try {
const downloadSnapshot = await this.download.pauseAsync();
await AsyncStorage.setItem('pausedDownload', JSON.stringify(downloadSnapshot));
alert('Download paused...');
} catch (e) {
console.log(e);
}
};
_resume = async () => {
try {
if (this.download) {
const result = await this.download.resumeAsync();
if (result) {
this._downloadComplete();
}
} else {
this._fetchDownload();
}
} catch (e) {
console.log(e);
}
};
_cancel = async () => {
if (!this.download) {
alert('Initiate a download first!');
return;
}
try {
await this.download.cancelAsync();
delete this.download;
await AsyncStorage.removeItem('pausedDownload');
this.setState({
downloadProgress: 0,
});
} catch (e) {
console.log(e);
}
};
_downloadComplete = () => {
if (this.state.downloadProgress !== 1) {
this.setState({
downloadProgress: 1,
});
}
alert('Download complete!');
};
_fetchDownload = async () => {
try {
const downloadJson = await AsyncStorage.getItem('pausedDownload');
if (downloadJson !== null) {
const downloadFromStore = JSON.parse(downloadJson);
const callback: FileSystemNetworkTaskProgressCallback<DownloadProgressData> = (
downloadProgress
) => {
const progress =
downloadProgress.totalBytesWritten / downloadProgress.totalBytesExpectedToWrite;
this.setState({
downloadProgress: progress,
});
};
this.download = new FileSystem.DownloadResumable(
downloadFromStore.url,
downloadFromStore.fileUri,
downloadFromStore.options,
callback,
downloadFromStore.resumeData
);
await this.download.resumeAsync();
if (this.state.downloadProgress === 1) {
alert('Download complete!');
}
} else {
alert('Initiate a download first!');
}
} catch (e) {
console.log(e);
}
};
_upload = async () => {
try {
const fileUri = FileSystem.documentDirectory + 'sample-4.zip';
const downloadUrl = 'path_to_url
await FileSystem.downloadAsync(downloadUrl, fileUri);
const callback: FileSystemNetworkTaskProgressCallback<UploadProgressData> = (
uploadProgress
) => {
const progress = uploadProgress.totalBytesSent / uploadProgress.totalBytesExpectedToSend;
this.setState({
uploadProgress: progress,
});
};
const uploadUrl = 'path_to_url
this.upload = FileSystem.createUploadTask(uploadUrl, fileUri, {}, callback);
await this.upload.uploadAsync();
} catch (e) {
console.log(e);
}
};
_getInfo = async () => {
if (!this.download) {
alert('Initiate a download first!');
return;
}
try {
const info = await FileSystem.getInfoAsync(this.download.fileUri);
Alert.alert('File Info:', JSON.stringify(info), [{ text: 'OK', onPress: () => {} }]);
} catch (e) {
console.log(e);
}
};
_readAsset = async () => {
const asset = Asset.fromModule(require('../../assets/index.html'));
await asset.downloadAsync();
try {
const result = await FileSystem.readAsStringAsync(asset.localUri!);
Alert.alert('Result', result);
} catch (e) {
Alert.alert('Error', e.message);
}
};
_getInfoAsset = async () => {
const asset = Asset.fromModule(require('../../assets/index.html'));
await asset.downloadAsync();
try {
const result = await FileSystem.getInfoAsync(asset.localUri!);
Alert.alert('Result', JSON.stringify(result, null, 2));
} catch (e) {
Alert.alert('Error', e.message);
}
};
_copyAndReadAsset = async () => {
const asset = Asset.fromModule(require('../../assets/index.html'));
await asset.downloadAsync();
const tmpFile = FileSystem.cacheDirectory + 'test.html';
try {
await FileSystem.copyAsync({ from: asset.localUri!, to: tmpFile });
const result = await FileSystem.readAsStringAsync(tmpFile);
Alert.alert('Result', result);
} catch (e) {
Alert.alert('Error', e.message);
}
};
_alertFreeSpace = async () => {
const freeBytes = await FileSystem.getFreeDiskStorageAsync();
alert(
`${Math.round(freeBytes / 1024 / 1024)} MB (1MB = 1024^2B), or ${Math.round(freeBytes / 1000000)} MB (1MB = 1000^2B) available.`
);
};
_askForDirPermissions = async () => {
const permissions = await StorageAccessFramework.requestDirectoryPermissionsAsync();
if (permissions.granted) {
const url = permissions.directoryUri;
this.setState({
permittedURI: url,
});
alert(`You selected: ${url}`);
}
};
_readSAFDirAsync = async () => {
return await StorageAccessFramework.readDirectoryAsync(this.state.permittedURI!);
};
_creatSAFFileAsync = async () => {
const createdFile = await StorageAccessFramework.createFileAsync(
// eslint-disable-next-line react/no-access-state-in-setstate
this.state.permittedURI!,
'test',
'text/plain'
);
this.setState({
createdFileURI: createdFile,
});
return createdFile;
};
_writeToSAFFileAsync = async () => {
await StorageAccessFramework.writeAsStringAsync(
this.state.createdFileURI!,
'Expo is awesome '
);
return 'Done ';
};
_readSAFFileAsync = async () => {
return await StorageAccessFramework.readAsStringAsync(this.state.createdFileURI!);
};
_deleteSAFFileAsync = async () => {
await StorageAccessFramework.deleteAsync(this.state.createdFileURI!);
this.setState({
createdFileURI: null,
});
};
_copySAFFileToInternalStorageAsync = async () => {
const outputDir = FileSystem.cacheDirectory! + '/SAFTest';
await StorageAccessFramework.copyAsync({
from: this.state.createdFileURI!,
to: outputDir,
});
return await FileSystem.readDirectoryAsync(outputDir);
};
_moveSAFFileToInternalStorageAsync = async () => {
await StorageAccessFramework.moveAsync({
from: this.state.createdFileURI!,
to: FileSystem.cacheDirectory!,
});
this.setState({
createdFileURI: null,
});
};
_downloadAndReadLocalAsset = async () => {
const asset = Asset.fromModule(require('../../assets/index.html')).uri;
const tmpFile = FileSystem.cacheDirectory + 'test.html';
try {
await FileSystem.downloadAsync(asset, tmpFile);
const result = await FileSystem.readAsStringAsync(tmpFile);
Alert.alert('Result', result);
} catch (e) {
Alert.alert('Error', e.message);
}
};
render() {
return (
<ScrollView style={{ padding: 10 }}>
<ListButton onPress={this._download} title="Download file (1.1MB)" />
<ListButton onPress={this._startDownloading} title="Start Downloading file (8.4MB)" />
{this.state.downloadProgress ? (
<Text style={{ paddingVertical: 15 }}>
Download progress: {this.state.downloadProgress * 100}%
</Text>
) : null}
{/* Add back progress bar once deprecation warnings from reanimated 2 are resolved */}
{/* <Progress.Bar style={styles.progress} isAnimated progress={this.state.downloadProgress} /> */}
<ListButton onPress={this._pause} title="Pause Download" />
<ListButton onPress={this._resume} title="Resume Download" />
<ListButton onPress={this._cancel} title="Cancel Download" />
<ListButton onPress={this._upload} title="Download & Upload file (2.8MB)" />
{this.state.uploadProgress ? (
<Text style={{ paddingVertical: 15 }}>
Upload progress: {this.state.uploadProgress * 100}%
</Text>
) : null}
<ListButton onPress={this._getInfo} title="Get Info" />
<ListButton onPress={this._readAsset} title="Read Asset" />
<ListButton onPress={this._getInfoAsset} title="Get Info Asset" />
<ListButton onPress={this._copyAndReadAsset} title="Copy and Read Asset" />
<ListButton onPress={this._alertFreeSpace} title="Alert free space" />
<ListButton
onPress={this._downloadAndReadLocalAsset}
title="Download and read local asset"
/>
{Platform.OS === 'android' && (
<>
<HeadingText>Storage Access Framework</HeadingText>
<ListButton
onPress={this._askForDirPermissions}
title="Ask for directory permissions"
/>
{this.state.permittedURI && (
<>
<SimpleActionDemo title="Read directory" action={this._readSAFDirAsync} />
<SimpleActionDemo title="Create a file" action={this._creatSAFFileAsync} />
{this.state.createdFileURI && (
<>
<SimpleActionDemo
title="Write to created file"
action={this._writeToSAFFileAsync}
/>
<SimpleActionDemo
title="Read from created file"
action={this._readSAFFileAsync}
/>
<ListButton title="Delete created file" onPress={this._deleteSAFFileAsync} />
<SimpleActionDemo
title="Copy file to internal storage"
action={this._copySAFFileToInternalStorageAsync}
/>
<ListButton
title="Move file to internal storage"
onPress={this._moveSAFFileToInternalStorageAsync}
/>
</>
)}
</>
)}
</>
)}
</ScrollView>
);
}
}
``` | /content/code_sandbox/apps/native-component-list/src/screens/FileSystemScreen.tsx | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 2,655 |
```xml
import * as React from 'react';
import { EyeFriendlierIcon, PresenceAvailableIcon } from '@fluentui/react-icons-northstar';
import { Chat, ChatProps } from '@fluentui/react-northstar';
const items: ChatProps['items'] = [
{
attached: 'top',
contentPosition: 'end',
message: (
<Chat.Message
content="Hello"
author="Cecil Folk"
timestamp="Yesterday, 10:15 PM"
readStatus={{
title: 'Read by All',
content: <EyeFriendlierIcon size="small" />,
}}
mine
/>
),
key: 'message-1',
},
{
attached: 'bottom',
contentPosition: 'end',
key: 'message-2',
message: (
<Chat.Message
content="I'm back!"
author="Cecil Folk"
timestamp="Yesterday, 10:15 PM"
readStatus={{
title: 'Sent',
content: <PresenceAvailableIcon size="small" />,
}}
mine
/>
),
},
];
const ChatExampleReadStatus = () => <Chat items={items} />;
export default ChatExampleReadStatus;
``` | /content/code_sandbox/packages/fluentui/docs/src/examples/components/Chat/Content/ChatExampleReadStatus.shorthand.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 265 |
```xml
<project xmlns="path_to_url" xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<modelVersion>4.0.0</modelVersion>
<groupId>Struts2TokenInterceptor</groupId>
<artifactId>Struts2TokenInterceptor</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.15.1</version>
</dependency>
</dependencies>
</project>
``` | /content/code_sandbox/Struts2/Struts2TokenInterceptor/pom.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 328 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.