라이브러리 프로젝트 업데이트

This commit is contained in:
villaingames 2023-10-21 18:07:01 +09:00
parent 05218bc657
commit 6d649fa797
102 changed files with 219497 additions and 0 deletions

Binary file not shown.

25
FirstVillainLibrary.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32802.440
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FirstVillainLibrary", "FirstVillainLibrary\FirstVillainLibrary.csproj", "{ACA1C0D8-97FB-4B5E-8FA8-401FFE098753}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ACA1C0D8-97FB-4B5E-8FA8-401FFE098753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACA1C0D8-97FB-4B5E-8FA8-401FFE098753}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACA1C0D8-97FB-4B5E-8FA8-401FFE098753}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACA1C0D8-97FB-4B5E-8FA8-401FFE098753}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {72632FD8-D325-472C-ABF5-677362ECEE34}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,73 @@
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Threading.Tasks;
namespace FirstVillain.ClassBuild
{
public class ClassBuilder
{
private string _className;
private CodeCompileUnit targetUnit;
private CodeTypeDeclaration targetClass;
public ClassBuilder(string className)
{
_className = className;
targetUnit = new CodeCompileUnit();
CodeNamespace namespaceTarget = new CodeNamespace("FirstVillain.Entities");
//namespaceTarget.Imports.Add(new CodeNamespaceImport("System")); //import도 가능...리스트 넣으면 추가해야함.
targetClass = new CodeTypeDeclaration(_className);
targetClass.IsClass = true;
targetClass.TypeAttributes = TypeAttributes.Public | TypeAttributes.Serializable;
namespaceTarget.Types.Add(targetClass);
targetUnit.Namespaces.Add(namespaceTarget);
}
public void CreateCode(Dictionary<string, Type> map, string path)
{
foreach (var typeData in map)
{
AddField(typeData.Key, typeData.Value);
}
GenerateCSharpCode(path);
}
private void GenerateCSharpCode(string path)
{
string fileName = Path.Combine(path, _className + ".cs");
if (File.Exists(fileName))
{
File.Delete(fileName);
}
CodeDomProvider provider = CodeDomProvider.CreateProvider("CSharp");
CodeGeneratorOptions options = new CodeGeneratorOptions();
options.BracingStyle = "C";
using (StreamWriter sourceWriter = new StreamWriter(fileName))
{
provider.GenerateCodeFromCompileUnit(
targetUnit, sourceWriter, options);
}
}
private void AddField(string name, Type type)
{
// Declare the widthValue field.
CodeMemberField fieldValue = new CodeMemberField();
fieldValue.Attributes = MemberAttributes.Public;
fieldValue.Name = name;
fieldValue.Type = new CodeTypeReference(type);
//widthValueField.Comments.Add(new CodeCommentStatement(
// "The width of the object."));
targetClass.Members.Add(fieldValue);
}
}
}

View File

@ -0,0 +1,76 @@
using FirstVillain.Singleton;
using System;
using System.Collections.Generic;
using UnityEngine.Events;
namespace FirstVillain.EventBus
{
public class EventBus : UnitySingleton<EventBus>
{
private readonly Dictionary<Type, EventDelegate> _delegateDict = new Dictionary<Type, EventDelegate>();
private readonly Dictionary<Delegate, EventDelegate> _delegateLookupDict = new Dictionary<Delegate, EventDelegate>();
public delegate void EventDelegate<T>(T myEvent) where T : EventBase;
private delegate void EventDelegate(EventBase myEvent);
public void Subscribe<T>(EventDelegate<T> callback) where T : EventBase
{
EventDelegate newDelegate = e => callback(e as T);
_delegateLookupDict[callback] = newDelegate;
var type = typeof(T);
if (!_delegateDict.TryGetValue(type, out EventDelegate tempDeletage))
{
_delegateDict[type] = tempDeletage;
}
_delegateDict[type] += newDelegate;
}
public void Unsubscribe<T>(EventDelegate<T> callback) where T : EventBase
{
if (_delegateLookupDict.TryGetValue(callback, out EventDelegate targetDelegate))
{
var type = typeof(T);
if (_delegateDict.TryGetValue(type, out EventDelegate tempDelegate))
{
tempDelegate -= targetDelegate;
if (tempDelegate == null)
{
_delegateDict.Remove(type);
}
else
{
_delegateDict[type] = tempDelegate;
}
}
_delegateLookupDict.Remove(callback);
}
}
public void Publish(EventBase eventType)
{
if (_delegateDict.TryGetValue(eventType.GetType(), out EventDelegate callback))
{
callback.Invoke(eventType);
}
}
public void Clear()
{
_delegateDict.Clear();
_delegateLookupDict.Clear();
}
}
public class EventBase
{
private int _errorCode;
public int ErrorCode
{
get { return _errorCode; }
set { _errorCode = value; }
}
}
}

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ACA1C0D8-97FB-4B5E-8FA8-401FFE098753}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FirstVillainLibrary</RootNamespace>
<AssemblyName>FirstVillainLibrary</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ExcelDataReader, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>..\packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll</HintPath>
</Reference>
<Reference Include="ExcelDataReader.DataSet, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>..\packages\ExcelDataReader.DataSet.3.6.0\lib\net35\ExcelDataReader.DataSet.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\Program Files\Unity\Hub\Editor\2021.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\Public\AssetBase\Library\ScriptAssemblies\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ClassBuilder.cs" />
<Compile Include="EventBus.cs" />
<Compile Include="HorizontalGridInfiniteScrollView.cs" />
<Compile Include="HorizontalInfiniteScrollView.cs" />
<Compile Include="InfiniteCell.cs" />
<Compile Include="InfiniteCellData.cs" />
<Compile Include="InfiniteScrollView.cs" />
<Compile Include="JsonConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UnitySingleton.cs" />
<Compile Include="VerticalGridInfiniteScrollView.cs" />
<Compile Include="VerticalInfiniteScrollView.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,122 @@
using System.Collections;
using UnityEngine;
namespace FirstVillain.ScrollView
{
public class HorizontalGridInfiniteScrollView : InfiniteScrollView
{
[SerializeField] private int _rowCount = 1;
[SerializeField] private bool _isAtLeft = true;
[SerializeField] private bool _isAtRight = true;
protected override void OnValueChanged(Vector2 normalizedPosition)
{
if (_rowCount <= 0)
{
_rowCount = 1;
}
float viewportInterval = _scrollRect.viewport.rect.width;
float minViewport = -_scrollRect.content.anchoredPosition.x;
Vector2 viewportRange = new Vector2(minViewport - _extendVisibleRange, minViewport + viewportInterval + _extendVisibleRange);
float contentWidth = _padding.x;
for (int i = 0; i < _dataList.Count; i += _rowCount)
{
for (int j = 0; j < _rowCount; j++)
{
int index = i + j;
if (index >= _dataList.Count)
break;
var visibleRange = new Vector2(contentWidth, contentWidth + _dataList[index].CellSize.x);
if (visibleRange.y < viewportRange.x || visibleRange.x > viewportRange.y)
{
RecycleCell(index);
}
}
contentWidth += _dataList[i].CellSize.x + _spacing;
}
contentWidth = _padding.x;
for (int i = 0; i < _dataList.Count; i += _rowCount)
{
for (int j = 0; j < _rowCount; j++)
{
int index = i + j;
if (index >= _dataList.Count)
break;
var visibleRange = new Vector2(contentWidth, contentWidth + _dataList[index].CellSize.x);
if (visibleRange.y >= viewportRange.x && visibleRange.x <= viewportRange.y)
{
SetupCell(index, new Vector2(contentWidth, (_dataList[index].CellSize.y + _spacing) * -j));
if (visibleRange.y >= viewportRange.x)
_cellList[index].transform.SetAsLastSibling();
else
_cellList[index].transform.SetAsFirstSibling();
}
}
contentWidth += _dataList[i].CellSize.x + _spacing;
}
if (_scrollRect.content.sizeDelta.x > viewportInterval)
{
_isAtLeft = viewportRange.x + _extendVisibleRange <= _dataList[0].CellSize.x;
_isAtRight = _scrollRect.content.sizeDelta.x - viewportRange.y + _extendVisibleRange <= _dataList[_dataList.Count - 1].CellSize.x;
}
else
{
_isAtLeft = true;
_isAtRight = true;
}
}
public sealed override void Refresh()
{
if (!IsInitialized)
{
Initialize();
}
if (_scrollRect.viewport.rect.width == 0)
StartCoroutine(DelayToRefresh());
else
DoRefresh();
}
private void DoRefresh()
{
float width = _padding.x;
for (int i = 0; i < _dataList.Count; i += _rowCount)
{
width += _dataList[i].CellSize.x + _spacing;
}
for (int i = 0; i < _cellList.Count; i++)
{
RecycleCell(i);
}
width += _padding.y;
_scrollRect.content.sizeDelta = new Vector2(width, _scrollRect.content.sizeDelta.y);
OnValueChanged(_scrollRect.normalizedPosition);
OnRefresh?.Invoke();
}
private IEnumerator DelayToRefresh()
{
yield return _waitEndOfFrame;
DoRefresh();
}
public override void Snap(int index, float duration)
{
if (!IsInitialized)
return;
if (index >= _dataList.Count)
return;
var columeNumber = index / _rowCount;
var width = _padding.x;
for (int i = 0; i < columeNumber; i++)
{
width += _dataList[i * _rowCount].CellSize.x + _spacing;
}
width = Mathf.Min(_scrollRect.content.rect.width - _scrollRect.viewport.rect.width, width);
if (_scrollRect.content.anchoredPosition.x != width)
{
DoSnapping(new Vector2(-width, 0), duration);
}
}
}
}

View File

@ -0,0 +1,122 @@
using System.Collections;
using UnityEngine;
namespace FirstVillain.ScrollView
{
public class HorizontalInfiniteScrollView : InfiniteScrollView
{
[SerializeField] private bool _isAtLeft = true;
[SerializeField] private bool _isAtRight = true;
public override void Initialize()
{
base.Initialize();
_isAtLeft = true;
_isAtRight = true;
}
protected override void OnValueChanged(Vector2 normalizedPosition)
{
if (_dataList.Count == 0)
return;
float viewportInterval = _scrollRect.viewport.rect.width;
float minViewport = -_scrollRect.content.anchoredPosition.x;
Vector2 viewportRange = new Vector2(minViewport - _extendVisibleRange, minViewport + viewportInterval + _extendVisibleRange);
float contentWidth = _padding.x;
for (int i = 0; i < _dataList.Count; i++)
{
var visibleRange = new Vector2(contentWidth, contentWidth + _dataList[i].CellSize.x);
if (visibleRange.y < viewportRange.x || visibleRange.x > viewportRange.y)
{
RecycleCell(i);
}
contentWidth += _dataList[i].CellSize.x + _spacing;
}
contentWidth = _padding.x;
for (int i = 0; i < _dataList.Count; i++)
{
var visibleRange = new Vector2(contentWidth, contentWidth + _dataList[i].CellSize.x);
if (visibleRange.y >= viewportRange.x && visibleRange.x <= viewportRange.y)
{
SetupCell(i, new Vector2(contentWidth, 0));
if (visibleRange.y >= viewportRange.x)
_cellList[i].transform.SetAsLastSibling();
else
_cellList[i].transform.SetAsFirstSibling();
}
contentWidth += _dataList[i].CellSize.x + _spacing;
}
if (_scrollRect.content.sizeDelta.x > viewportInterval)
{
_isAtLeft = viewportRange.x + _extendVisibleRange <= _dataList[0].CellSize.x;
_isAtRight = _scrollRect.content.sizeDelta.x - viewportRange.y + _extendVisibleRange <= _dataList[_dataList.Count - 1].CellSize.x;
}
else
{
_isAtLeft = true;
_isAtRight = true;
}
}
public sealed override void Refresh()
{
if (!IsInitialized)
{
Initialize();
}
if (_scrollRect.viewport.rect.width == 0)
StartCoroutine(DelayToRefresh());
else
DoRefresh();
}
private void DoRefresh()
{
float width = _padding.x;
for (int i = 0; i < _dataList.Count; i++)
{
width += _dataList[i].CellSize.x + _spacing;
}
for (int i = 0; i < _cellList.Count; i++)
{
RecycleCell(i);
}
width += _padding.y;
_scrollRect.content.sizeDelta = new Vector2(width, _scrollRect.content.sizeDelta.y);
OnValueChanged(_scrollRect.normalizedPosition);
OnRefresh?.Invoke();
}
private IEnumerator DelayToRefresh()
{
yield return _waitEndOfFrame;
DoRefresh();
}
public override void Snap(int index, float duration)
{
if (!IsInitialized)
return;
if (index >= _dataList.Count)
return;
if (_scrollRect.content.rect.width < _scrollRect.viewport.rect.width)
return;
float width = _padding.x;
for (int i = 0; i < index; i++)
{
width += _dataList[i].CellSize.x + _spacing;
}
width = Mathf.Min(_scrollRect.content.rect.width - _scrollRect.viewport.rect.width, width);
if (_scrollRect.content.anchoredPosition.x != width)
{
DoSnapping(new Vector2(-width, 0), duration);
}
}
public override void Remove(int index)
{
var removeCell = _dataList[index];
base.Remove(index);
_scrollRect.content.anchoredPosition -= new Vector2(removeCell.CellSize.x + _spacing, 0);
}
}
}

View File

@ -0,0 +1,43 @@
using System;
using UnityEngine;
namespace FirstVillain.ScrollView
{
public class InfiniteCell : MonoBehaviour
{
public event Action<GameObject> OnSelected;
private RectTransform _rectTransform;
public RectTransform RectTransform
{
get
{
if (_rectTransform == null)
_rectTransform = GetComponent<RectTransform>();
return _rectTransform;
}
}
private InfiniteCellData cellData;
public InfiniteCellData CellData
{
set
{
cellData = value;
cellData.OnUpdate(this);
}
get
{
return cellData;
}
}
public virtual void OnUpdate() { }
public void InvokeSelected()
{
if (OnSelected != null)
OnSelected.Invoke(gameObject);
}
}
}

View File

@ -0,0 +1,35 @@
using System;
using UnityEngine;
namespace FirstVillain.ScrollView
{
public class InfiniteCellData
{
public int Index { get; set; }
public Vector2 CellSize { get; private set; }
private object _data;
public Action<InfiniteCell> OnUpdated;
public InfiniteCellData()
{
}
public InfiniteCellData(Vector2 cellSize)
{
this.CellSize = cellSize;
}
public InfiniteCellData(Vector2 cellSize, object data)
{
this.CellSize = cellSize;
this._data = data;
}
public void OnUpdate(InfiniteCell cell)
{
OnUpdated?.Invoke(cell);
}
}
}

View File

@ -0,0 +1,181 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace FirstVillain.ScrollView
{
[RequireComponent(typeof(ScrollRect))]
public abstract class InfiniteScrollView : UIBehaviour
{
[SerializeField] private int _cellPoolSize = 20;
[SerializeField] protected float _spacing = 0f;
[SerializeField] protected Vector2 _padding;
[SerializeField] protected float _extendVisibleRange;
[SerializeField] private InfiniteCell _cellPrefab;
[SerializeField] protected ScrollRect _scrollRect;
protected List<InfiniteCellData> _dataList = new List<InfiniteCellData>();
protected List<InfiniteCell> _cellList = new List<InfiniteCell>();
protected Queue<InfiniteCell> _cellPool = new Queue<InfiniteCell>();
protected YieldInstruction _waitEndOfFrame = new WaitForEndOfFrame();
private Coroutine _snappingProcesser;
public event Action OnRectTransformUpdate;
public event Action<GameObject> OnCellSelected;
public Action OnRefresh;
public bool IsInitialized
{
get;
private set;
}
public virtual void Initialize()
{
if (IsInitialized)
return;
_scrollRect = GetComponent<ScrollRect>();
_scrollRect.onValueChanged.AddListener(OnValueChanged);
for (int i = 0; i < _cellPoolSize; i++)
{
var newCell = Instantiate(_cellPrefab, _scrollRect.content);
newCell.gameObject.SetActive(false);
_cellPool.Enqueue(newCell);
}
IsInitialized = true;
}
protected abstract void OnValueChanged(Vector2 normalizedPosition);
public abstract void Refresh();
public virtual void Add(InfiniteCellData data)
{
if (!IsInitialized)
{
Initialize();
}
data.Index = _dataList.Count;
_dataList.Add(data);
_cellList.Add(null);
}
public virtual void Remove(int index)
{
if (!IsInitialized)
{
Initialize();
}
if (_dataList.Count == 0)
return;
_dataList.RemoveAt(index);
Refresh();
}
public abstract void Snap(int index, float duration);
public void SnapLast(float duration)
{
Snap(_dataList.Count - 1, duration);
}
protected void DoSnapping(Vector2 target, float duration)
{
if (!gameObject.activeInHierarchy)
return;
StopSnapping();
_snappingProcesser = StartCoroutine(ProcessSnapping(target, duration));
}
public void StopSnapping()
{
if (_snappingProcesser != null)
{
StopCoroutine(_snappingProcesser);
_snappingProcesser = null;
}
}
private IEnumerator ProcessSnapping(Vector2 target, float duration)
{
_scrollRect.velocity = Vector2.zero;
Vector2 startPos = _scrollRect.content.anchoredPosition;
float t = 0;
while (t < 1f)
{
if (duration <= 0)
t = 1;
else
t += Time.deltaTime / duration;
_scrollRect.content.anchoredPosition = Vector2.Lerp(startPos, target, t);
var normalizedPos = _scrollRect.normalizedPosition;
if (normalizedPos.y < 0 || normalizedPos.x > 1)
{
break;
}
yield return null;
}
if (duration <= 0)
OnValueChanged(_scrollRect.normalizedPosition);
_snappingProcesser = null;
}
protected void SetupCell(int index, Vector2 pos)
{
if (_cellList[index] == null)
{
var cell = _cellPool.Dequeue();
cell.gameObject.SetActive(true);
cell.CellData = _dataList[index];
cell.RectTransform.anchoredPosition = pos;
_cellList[index] = cell;
cell.OnSelected += OnCellObjSelected;
}
}
protected void RecycleCell(int index)
{
if (_cellList[index] != null)
{
var cell = _cellList[index];
_cellList[index] = null;
_cellPool.Enqueue(cell);
cell.gameObject.SetActive(false);
cell.OnSelected -= OnCellObjSelected;
}
}
private void OnCellObjSelected(GameObject selectedCell)
{
OnCellSelected?.Invoke(selectedCell);
}
public virtual void Clear()
{
if (IsInitialized == false)
Initialize();
_scrollRect.velocity = Vector2.zero;
_scrollRect.content.anchoredPosition = Vector2.zero;
_dataList.Clear();
for (int i = 0; i < _cellList.Count; i++)
{
RecycleCell(i);
}
_cellList.Clear();
Refresh();
}
protected override void OnRectTransformDimensionsChange()
{
base.OnRectTransformDimensionsChange();
if (_scrollRect)
{
OnRectTransformUpdate?.Invoke();
}
}
}
}

View File

@ -0,0 +1,145 @@
using ExcelDataReader;
using FirstVillain.ClassBuild;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
namespace FirstVillain.Converter
{
[Serializable]
public class Wrapper<T>
{
public List<T> list;
}
public static class JsonConverter
{
private static Dictionary<string, int> _columnIdxDict;
private static Dictionary<int, Type> _columnTypeDict;
private static Dictionary<string, Type> _typeMap;
public static void ExcelToJsonAndClass(string excelPath, string jsonPath, string entityPath)
{
string[] allFiles = Directory.GetFiles(excelPath);
foreach (var excel in allFiles)
{
if (Path.GetExtension(excel) != ".xlsx")
{
continue;
}
using (var stream = File.Open(excel, FileMode.Open, FileAccess.Read, FileShare.Read))
{
using (var reader = ExcelReaderFactory.CreateReader(stream))
{
var excelData = reader.AsDataSet();
for (int i = 0; i < excelData.Tables.Count; i++)
{
if (excelData.Tables[i].TableName.StartsWith("#"))
{
continue;
}
string jsonName = "J" + excelData.Tables[i].TableName;
string outPath = Path.Combine(jsonPath, jsonName + ".json");
if (File.Exists(outPath))
{
File.Delete(outPath);
}
var classBuilder = new ClassBuilder(jsonName + "Data");
var jsonBase = new JObject();
var jsonArray = new JArray();
SetCoumnData(excelData.Tables[i].Rows[0], excelData.Tables[i].Rows[1]);
int columnCount = _columnIdxDict.Count;
for (int j = 2; j < excelData.Tables[i].Rows.Count; j++)
{
var json = new JObject();
foreach (var nameData in _columnIdxDict)
{
var data = excelData.Tables[i].Rows[j][nameData.Value];
if (_columnTypeDict[nameData.Value] == typeof(string))
{
json.Add(nameData.Key, data.ToString());
}
else if (_columnTypeDict[nameData.Value] == typeof(int))
{
if (int.TryParse(data.ToString(), out int result))
{
json.Add(nameData.Key, result);
}
}
else if (_columnTypeDict[nameData.Value] == typeof(float))
{
if (float.TryParse(data.ToString(), out float result))
{
json.Add(nameData.Key, result);
}
}
else
{
throw new Exception("Not supporting type of column");
}
}
jsonArray.Add(json);
}
jsonBase.Add("list", jsonArray);
File.WriteAllText(outPath, jsonBase.ToString());
classBuilder.CreateCode(_typeMap, entityPath);
}
}
}
}
}
private static void SetCoumnData(DataRow nameRow, DataRow typeRow)
{
_columnIdxDict = new Dictionary<string, int>();
_columnTypeDict = new Dictionary<int, Type>();
_typeMap = new Dictionary<string, Type>();
for (int i = 0; i < nameRow.Table.Columns.Count; i++)
{
if (nameRow[i].ToString().StartsWith("#"))
{
continue;
}
_columnIdxDict.Add(nameRow[i].ToString(), i);
_columnTypeDict.Add(i, ConvertType(typeRow[i].ToString()));
_typeMap.Add(nameRow[i].ToString(), ConvertType(typeRow[i].ToString()));
}
}
private static Type ConvertType(string typeString)
{
switch (typeString)
{
default:
return typeof(string);
case "int":
return typeof(int);
case "float":
return typeof(float);
}
}
public static List<T> GetDataList<T>(string json)
{
var data = JsonConvert.DeserializeObject<Wrapper<T>>(json);
return data.list;
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
// 이러한 특성 값을 변경하세요.
[assembly: AssemblyTitle("FirstVillainLibrary")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FirstVillainLibrary")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
[assembly: ComVisible(false)]
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
[assembly: Guid("aca1c0d8-97fb-4b5e-8fa8-401ffe098753")]
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
//
// 주 버전
// 부 버전
// 빌드 번호
// 수정 버전
//
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,93 @@
using UnityEngine;
namespace FirstVillain.Singleton
{
public class UnitySingleton<T> : MonoBehaviour where T : UnityEngine.Component
{
private static T _instance = null;
public static T Instance
{
get
{
if (_instance == null)
{
string name = (typeof(T)).ToString();
_instance = new GameObject(name).AddComponent<T>();
}
return _instance;
}
}
private void Awake()
{
if (_instance != null && _instance != this)
{
Destroy(gameObject);
return;
}
else
{
_instance = this as T;
}
DontDestroyOnLoad(gameObject);
AwakeSingleton();
}
private void OnDestroy()
{
if (_instance == this)
{
_instance = null;
}
}
protected virtual void AwakeSingleton()
{ }
}
public class UnitySingletonOnce<T> : MonoBehaviour where T : UnityEngine.Component
{
private static T _instance = null;
public static T Instance
{
get
{
if (_instance == null)
{
string name = (typeof(T)).ToString();
_instance = new GameObject(name).AddComponent<T>();
}
return _instance;
}
}
private void Awake()
{
if (_instance != null && _instance != this)
{
Destroy(gameObject);
return;
}
else
{
_instance = this as T;
}
AwakeSingleton();
}
private void OnDestroy()
{
if (_instance == this)
{
_instance = null;
}
}
protected virtual void AwakeSingleton()
{ }
}
}

View File

@ -0,0 +1,123 @@
using System.Collections;
using UnityEngine;
namespace FirstVillain.ScrollView
{
public class VerticalGridInfiniteScrollView : InfiniteScrollView
{
[SerializeField] private bool _isAtTop = true;
[SerializeField] private bool _isAtBottom = true;
[SerializeField] private int _columeCount = 1;
protected override void OnValueChanged(Vector2 normalizedPosition)
{
if (_columeCount <= 0)
{
_columeCount = 1;
}
float viewportInterval = _scrollRect.viewport.rect.height;
float minViewport = _scrollRect.content.anchoredPosition.y;
Vector2 viewportRange = new Vector2(minViewport, minViewport + viewportInterval);
float contentHeight = _padding.x;
for (int i = 0; i < _dataList.Count; i += _columeCount)
{
for (int j = 0; j < _columeCount; j++)
{
int index = i + j;
if (index >= _dataList.Count)
break;
var visibleRange = new Vector2(contentHeight, contentHeight + _dataList[index].CellSize.y);
if (visibleRange.y < viewportRange.x || visibleRange.x > viewportRange.y)
{
RecycleCell(index);
}
}
contentHeight += _dataList[i].CellSize.y + _spacing;
}
contentHeight = _padding.x;
for (int i = 0; i < _dataList.Count; i += _columeCount)
{
for (int j = 0; j < _columeCount; j++)
{
int index = i + j;
if (index >= _dataList.Count)
break;
var visibleRange = new Vector2(contentHeight, contentHeight + _dataList[index].CellSize.y);
if (visibleRange.y >= viewportRange.x && visibleRange.x <= viewportRange.y)
{
SetupCell(index, new Vector2((_dataList[index].CellSize.x + _spacing) * j, -contentHeight));
if (visibleRange.y >= viewportRange.x)
_cellList[index].transform.SetAsLastSibling();
else
_cellList[index].transform.SetAsFirstSibling();
}
}
contentHeight += _dataList[i].CellSize.y + _spacing;
}
if (_scrollRect.content.sizeDelta.y > viewportInterval)
{
_isAtTop = viewportRange.x + _extendVisibleRange <= _dataList[0].CellSize.y;
_isAtBottom = _scrollRect.content.sizeDelta.y - viewportRange.y + _extendVisibleRange <= _dataList[_dataList.Count - 1].CellSize.y;
}
else
{
_isAtTop = true;
_isAtBottom = true;
}
}
public sealed override void Refresh()
{
if (!IsInitialized)
{
Initialize();
}
if (_scrollRect.viewport.rect.height == 0)
StartCoroutine(DelayToRefresh());
else
DoRefresh();
}
private void DoRefresh()
{
float height = _padding.x;
for (int i = 0; i < _dataList.Count; i += _columeCount)
{
height += _dataList[i].CellSize.y + _spacing;
}
for (int i = 0; i < _cellList.Count; i++)
{
RecycleCell(i);
}
height += _padding.y;
_scrollRect.content.sizeDelta = new Vector2(_scrollRect.content.sizeDelta.x, height);
OnValueChanged(_scrollRect.normalizedPosition);
OnRefresh?.Invoke();
}
private IEnumerator DelayToRefresh()
{
yield return _waitEndOfFrame;
DoRefresh();
}
public override void Snap(int index, float duration)
{
if (!IsInitialized)
return;
if (index >= _dataList.Count)
return;
var rowNumber = index / _columeCount;
var height = _padding.x;
for (int i = 0; i < rowNumber; i++)
{
height += _dataList[i * _columeCount].CellSize.y + _spacing;
}
height = Mathf.Min(_scrollRect.content.rect.height - _scrollRect.viewport.rect.height, height);
if (_scrollRect.content.anchoredPosition.y != height)
{
DoSnapping(new Vector2(0, height), duration);
}
}
}
}

View File

@ -0,0 +1,123 @@
using System.Collections;
using UnityEngine;
namespace FirstVillain.ScrollView
{
public class VerticalInfiniteScrollView : InfiniteScrollView
{
[SerializeField] private bool _isAtTop = true;
[SerializeField] private bool _isAtBottom = true;
public override void Initialize()
{
base.Initialize();
_isAtTop = true;
_isAtBottom = true;
}
protected override void OnValueChanged(Vector2 normalizedPosition)
{
if (_dataList.Count == 0)
return;
float viewportInterval = _scrollRect.viewport.rect.height;
float minViewport = _scrollRect.content.anchoredPosition.y;
Vector2 viewportRange = new Vector2(minViewport - _extendVisibleRange, minViewport + viewportInterval + _extendVisibleRange);
float contentHeight = _padding.x;
for (int i = 0; i < _dataList.Count; i++)
{
var visibleRange = new Vector2(contentHeight, contentHeight + _dataList[i].CellSize.y);
if (visibleRange.y < viewportRange.x || visibleRange.x > viewportRange.y)
{
RecycleCell(i);
}
contentHeight += _dataList[i].CellSize.y + _spacing;
}
contentHeight = _padding.x;
for (int i = 0; i < _dataList.Count; i++)
{
var visibleRange = new Vector2(contentHeight, contentHeight + _dataList[i].CellSize.y);
if (visibleRange.y >= viewportRange.x && visibleRange.x <= viewportRange.y)
{
SetupCell(i, new Vector2(0, -contentHeight));
if (visibleRange.y >= viewportRange.x)
_cellList[i].transform.SetAsLastSibling();
else
_cellList[i].transform.SetAsFirstSibling();
}
contentHeight += _dataList[i].CellSize.y + _spacing;
}
if (_scrollRect.content.sizeDelta.y > viewportInterval)
{
_isAtTop = viewportRange.x + _extendVisibleRange <= 0.001f;
_isAtBottom = _scrollRect.content.sizeDelta.y - viewportRange.y + _extendVisibleRange <= 0.001f;
}
else
{
_isAtTop = true;
_isAtBottom = true;
}
}
public sealed override void Refresh()
{
if (!IsInitialized)
{
Initialize();
}
if (_scrollRect.viewport.rect.height == 0)
StartCoroutine(DelayToRefresh());
else
DoRefresh();
}
private void DoRefresh()
{
float height = _padding.x;
for (int i = 0; i < _dataList.Count; i++)
{
height += _dataList[i].CellSize.y + _spacing;
}
for (int i = 0; i < _cellList.Count; i++)
{
RecycleCell(i);
}
height += _padding.y;
_scrollRect.content.sizeDelta = new Vector2(_scrollRect.content.sizeDelta.x, height);
OnValueChanged(_scrollRect.normalizedPosition);
OnRefresh?.Invoke();
}
private IEnumerator DelayToRefresh()
{
yield return _waitEndOfFrame;
DoRefresh();
}
public override void Snap(int index, float duration)
{
if (!IsInitialized)
return;
if (index >= _dataList.Count)
return;
if (_scrollRect.content.rect.height < _scrollRect.viewport.rect.height)
return;
float height = _padding.x;
for (int i = 0; i < index; i++)
{
height += _dataList[i].CellSize.y + _spacing;
}
height = Mathf.Min(_scrollRect.content.rect.height - _scrollRect.viewport.rect.height, height);
if (_scrollRect.content.anchoredPosition.y != height)
{
DoSnapping(new Vector2(0, height), duration);
}
}
public override void Remove(int index)
{
var removeCell = _dataList[index];
base.Remove(index);
_scrollRect.content.anchoredPosition -= new Vector2(0, removeCell.CellSize.y + _spacing);
}
}
}

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<doc>
<members>
<assembly>
<name>UnityEngine.SharedInternalsModule</name>
</assembly>
<member name="A:UnityEngine.SharedInternalsModule">
<summary>
<para>SharedInternals is a module used internally to provide low-level functionality needed by other modules.</para>
</summary>
</member>
</members>
</doc>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,71 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>ExcelDataReader.DataSet</name>
</assembly>
<members>
<member name="T:ExcelDataReader.ExcelDataReaderExtensions">
<summary>
ExcelDataReader DataSet extensions
</summary>
</member>
<member name="M:ExcelDataReader.ExcelDataReaderExtensions.AsDataSet(ExcelDataReader.IExcelDataReader,ExcelDataReader.ExcelDataSetConfiguration)">
<summary>
Converts all sheets to a DataSet
</summary>
<param name="self">The IExcelDataReader instance</param>
<param name="configuration">An optional configuration object to modify the behavior of the conversion</param>
<returns>A dataset with all workbook contents</returns>
</member>
<member name="T:ExcelDataReader.ExcelDataSetConfiguration">
<summary>
Processing configuration options and callbacks for IExcelDataReader.AsDataSet().
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.UseColumnDataType">
<summary>
Gets or sets a value indicating whether to set the DataColumn.DataType property in a second pass.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.ConfigureDataTable">
<summary>
Gets or sets a callback to obtain configuration options for a DataTable.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.FilterSheet">
<summary>
Gets or sets a callback to determine whether to include the current sheet in the DataSet. Called once per sheet before ConfigureDataTable.
</summary>
</member>
<member name="T:ExcelDataReader.ExcelDataTableConfiguration">
<summary>
Processing configuration options and callbacks for AsDataTable().
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.EmptyColumnNamePrefix">
<summary>
Gets or sets a value indicating the prefix of generated column names.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.UseHeaderRow">
<summary>
Gets or sets a value indicating whether to use a row from the data as column names.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.ReadHeaderRow">
<summary>
Gets or sets a callback to determine which row is the header row. Only called when UseHeaderRow = true.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterRow">
<summary>
Gets or sets a callback to determine whether to include the current row in the DataTable.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterColumn">
<summary>
Gets or sets a callback to determine whether to include the specific column in the DataTable. Called once per column after reading the headers.
</summary>
</member>
</members>
</doc>

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<doc>
<members>
<assembly>
<name>UnityEngine.SharedInternalsModule</name>
</assembly>
<member name="A:UnityEngine.SharedInternalsModule">
<summary>
<para>SharedInternals is a module used internally to provide low-level functionality needed by other modules.</para>
</summary>
</member>
</members>
</doc>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@ -0,0 +1 @@
70aced88acdb4d58f23ba5043017e2e23ea0b467

View File

@ -0,0 +1,13 @@
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Debug\FirstVillainLibrary.csproj.AssemblyReference.cache
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Debug\FirstVillainLibrary.csproj.CoreCompileInputs.cache
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Debug\FirstVillainLibrary.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Debug\FirstVillainLibrary.pdb
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Debug\UnityEngine.CoreModule.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Debug\UnityEngine.UI.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Debug\UnityEngine.SharedInternalsModule.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Debug\UnityEngine.CoreModule.xml
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Debug\UnityEngine.UI.pdb
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Debug\UnityEngine.SharedInternalsModule.xml
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Debug\FirstVillainLibrary.csproj.CopyComplete
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Debug\FirstVillainLibrary.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Debug\FirstVillainLibrary.pdb

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@ -0,0 +1 @@
4da2777b8c33ec22ffb802ac4fa05debb14fb7b0

View File

@ -0,0 +1,21 @@
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\FirstVillainLibrary.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\FirstVillainLibrary.pdb
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\UnityEngine.CoreModule.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\UnityEngine.UI.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\UnityEngine.SharedInternalsModule.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\UnityEngine.CoreModule.xml
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\UnityEngine.UI.pdb
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\UnityEngine.SharedInternalsModule.xml
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Release\FirstVillainLibrary.csproj.CoreCompileInputs.cache
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Release\FirstVillainLibrary.csproj.CopyComplete
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Release\FirstVillainLibrary.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Release\FirstVillainLibrary.pdb
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\ExcelDataReader.DataSet.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\ExcelDataReader.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\ExcelDataReader.pdb
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\ExcelDataReader.xml
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\ExcelDataReader.DataSet.pdb
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\ExcelDataReader.DataSet.xml
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\obj\Release\FirstVillainLibrary.csproj.AssemblyReference.cache
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\Newtonsoft.Json.dll
E:\VisualStudioProjects\FirstVillainLibrary\FirstVillainLibrary\bin\Release\Newtonsoft.Json.xml

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ExcelDataReader" version="3.6.0" targetFramework="net48" />
<package id="ExcelDataReader.DataSet" version="3.6.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
</packages>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,91 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>ExcelDataReader.DataSet</name>
</assembly>
<members>
<member name="T:ExcelDataReader.ExcelDataReaderExtensions">
<summary>
ExcelDataReader DataSet extensions
</summary>
</member>
<member name="M:ExcelDataReader.ExcelDataReaderExtensions.AsDataSet(ExcelDataReader.IExcelDataReader,ExcelDataReader.ExcelDataSetConfiguration)">
<summary>
Converts all sheets to a DataSet
</summary>
<param name="self">The IExcelDataReader instance</param>
<param name="configuration">An optional configuration object to modify the behavior of the conversion</param>
<returns>A dataset with all workbook contents</returns>
</member>
<member name="T:ExcelDataReader.ExcelDataSetConfiguration">
<summary>
Processing configuration options and callbacks for IExcelDataReader.AsDataSet().
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.UseColumnDataType">
<summary>
Gets or sets a value indicating whether to set the DataColumn.DataType property in a second pass.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.ConfigureDataTable">
<summary>
Gets or sets a callback to obtain configuration options for a DataTable.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.FilterSheet">
<summary>
Gets or sets a callback to determine whether to include the current sheet in the DataSet. Called once per sheet before ConfigureDataTable.
</summary>
</member>
<member name="T:ExcelDataReader.ExcelDataTableConfiguration">
<summary>
Processing configuration options and callbacks for AsDataTable().
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.EmptyColumnNamePrefix">
<summary>
Gets or sets a value indicating the prefix of generated column names.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.UseHeaderRow">
<summary>
Gets or sets a value indicating whether to use a row from the data as column names.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.ReadHeaderRow">
<summary>
Gets or sets a callback to determine which row is the header row. Only called when UseHeaderRow = true.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterRow">
<summary>
Gets or sets a callback to determine whether to include the current row in the DataTable.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterColumn">
<summary>
Gets or sets a callback to determine whether to include the specific column in the DataTable. Called once per column after reading the headers.
</summary>
</member>
<member name="T:ExcelDataReader.Func`2">
<summary>
Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.
</summary>
<typeparam name="T1">The type of the parameter of the method that this delegate encapsulates.</typeparam>
<typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
<param name="arg1">The parameter of the method that this delegate encapsulates.</param>
<returns>The return value of the method that this delegate encapsulates.</returns>
</member>
<member name="T:ExcelDataReader.Func`3">
<summary>
Encapsulates a method that has two parameters and returns a value of the type specified by the TResult parameter.
</summary>
<typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam>
<typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam>
<typeparam name="TResult">The type of the return value of the method that this delegate encapsulates</typeparam>
<param name="arg1">The first parameter of the method that this delegate encapsulates.</param>
<param name="arg2">The second parameter of the method that this delegate encapsulates.</param>
<returns>The return value of the method that this delegate encapsulates.</returns>
</member>
</members>
</doc>

View File

@ -0,0 +1,71 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>ExcelDataReader.DataSet</name>
</assembly>
<members>
<member name="T:ExcelDataReader.ExcelDataReaderExtensions">
<summary>
ExcelDataReader DataSet extensions
</summary>
</member>
<member name="M:ExcelDataReader.ExcelDataReaderExtensions.AsDataSet(ExcelDataReader.IExcelDataReader,ExcelDataReader.ExcelDataSetConfiguration)">
<summary>
Converts all sheets to a DataSet
</summary>
<param name="self">The IExcelDataReader instance</param>
<param name="configuration">An optional configuration object to modify the behavior of the conversion</param>
<returns>A dataset with all workbook contents</returns>
</member>
<member name="T:ExcelDataReader.ExcelDataSetConfiguration">
<summary>
Processing configuration options and callbacks for IExcelDataReader.AsDataSet().
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.UseColumnDataType">
<summary>
Gets or sets a value indicating whether to set the DataColumn.DataType property in a second pass.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.ConfigureDataTable">
<summary>
Gets or sets a callback to obtain configuration options for a DataTable.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.FilterSheet">
<summary>
Gets or sets a callback to determine whether to include the current sheet in the DataSet. Called once per sheet before ConfigureDataTable.
</summary>
</member>
<member name="T:ExcelDataReader.ExcelDataTableConfiguration">
<summary>
Processing configuration options and callbacks for AsDataTable().
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.EmptyColumnNamePrefix">
<summary>
Gets or sets a value indicating the prefix of generated column names.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.UseHeaderRow">
<summary>
Gets or sets a value indicating whether to use a row from the data as column names.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.ReadHeaderRow">
<summary>
Gets or sets a callback to determine which row is the header row. Only called when UseHeaderRow = true.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterRow">
<summary>
Gets or sets a callback to determine whether to include the current row in the DataTable.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterColumn">
<summary>
Gets or sets a callback to determine whether to include the specific column in the DataTable. Called once per column after reading the headers.
</summary>
</member>
</members>
</doc>

View File

@ -0,0 +1,71 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>ExcelDataReader.DataSet</name>
</assembly>
<members>
<member name="T:ExcelDataReader.ExcelDataReaderExtensions">
<summary>
ExcelDataReader DataSet extensions
</summary>
</member>
<member name="M:ExcelDataReader.ExcelDataReaderExtensions.AsDataSet(ExcelDataReader.IExcelDataReader,ExcelDataReader.ExcelDataSetConfiguration)">
<summary>
Converts all sheets to a DataSet
</summary>
<param name="self">The IExcelDataReader instance</param>
<param name="configuration">An optional configuration object to modify the behavior of the conversion</param>
<returns>A dataset with all workbook contents</returns>
</member>
<member name="T:ExcelDataReader.ExcelDataSetConfiguration">
<summary>
Processing configuration options and callbacks for IExcelDataReader.AsDataSet().
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.UseColumnDataType">
<summary>
Gets or sets a value indicating whether to set the DataColumn.DataType property in a second pass.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.ConfigureDataTable">
<summary>
Gets or sets a callback to obtain configuration options for a DataTable.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.FilterSheet">
<summary>
Gets or sets a callback to determine whether to include the current sheet in the DataSet. Called once per sheet before ConfigureDataTable.
</summary>
</member>
<member name="T:ExcelDataReader.ExcelDataTableConfiguration">
<summary>
Processing configuration options and callbacks for AsDataTable().
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.EmptyColumnNamePrefix">
<summary>
Gets or sets a value indicating the prefix of generated column names.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.UseHeaderRow">
<summary>
Gets or sets a value indicating whether to use a row from the data as column names.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.ReadHeaderRow">
<summary>
Gets or sets a callback to determine which row is the header row. Only called when UseHeaderRow = true.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterRow">
<summary>
Gets or sets a callback to determine whether to include the current row in the DataTable.
</summary>
</member>
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterColumn">
<summary>
Gets or sets a callback to determine whether to include the specific column in the DataTable. Called once per column after reading the headers.
</summary>
</member>
</members>
</doc>

Binary file not shown.

View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2007 James Newton-King
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Binary file not shown.

View File

@ -0,0 +1,71 @@
# ![Logo](https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/Doc/icons/logo.jpg) Json.NET
[![NuGet version (Newtonsoft.Json)](https://img.shields.io/nuget/v/Newtonsoft.Json.svg?style=flat-square)](https://www.nuget.org/packages/Newtonsoft.Json/)
[![Build status](https://dev.azure.com/jamesnk/Public/_apis/build/status/JamesNK.Newtonsoft.Json?branchName=master)](https://dev.azure.com/jamesnk/Public/_build/latest?definitionId=8)
Json.NET is a popular high-performance JSON framework for .NET
## Serialize JSON
```csharp
Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Sizes = new string[] { "Small" };
string json = JsonConvert.SerializeObject(product);
// {
// "Name": "Apple",
// "Expiry": "2008-12-28T00:00:00",
// "Sizes": [
// "Small"
// ]
// }
```
## Deserialize JSON
```csharp
string json = @"{
'Name': 'Bad Boys',
'ReleaseDate': '1995-4-7T00:00:00',
'Genres': [
'Action',
'Comedy'
]
}";
Movie m = JsonConvert.DeserializeObject<Movie>(json);
string name = m.Name;
// Bad Boys
```
## LINQ to JSON
```csharp
JArray array = new JArray();
array.Add("Manual text");
array.Add(new DateTime(2000, 5, 23));
JObject o = new JObject();
o["MyArray"] = array;
string json = o.ToString();
// {
// "MyArray": [
// "Manual text",
// "2000-05-23T00:00:00"
// ]
// }
```
## Links
- [Homepage](https://www.newtonsoft.com/json)
- [Documentation](https://www.newtonsoft.com/json/help)
- [NuGet Package](https://www.nuget.org/packages/Newtonsoft.Json)
- [Release Notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Contributing Guidelines](https://github.com/JamesNK/Newtonsoft.Json/blob/master/CONTRIBUTING.md)
- [License](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/json.net)

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More