(string key);
16 |
17 | bool Remove(string key);
18 |
19 | void FlushAll();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Examples/NHibernate/Test.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Examples.NHibernate.Test" %>
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Examples/RequestTest.aspx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.UI;
6 | using System.Web.UI.WebControls;
7 |
8 | namespace Examples
9 | {
10 | public partial class RequestTest : System.Web.UI.Page
11 | {
12 | protected void Page_Load(object sender, EventArgs e)
13 | {
14 | Response.Write(Request.Headers["X-IridescentAjax-Method"]);
15 | Response.Write(Environment.NewLine);
16 | Response.Write(Request.Params["abc"]);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/Iridescent.JobService/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/packages/Castle.Core.3.1.0/readme.txt:
--------------------------------------------------------------------------------
1 | Thanks for downloading this Castle package.
2 | You can find full list of changes in changes.txt
3 |
4 | Documentation (work in progress, contributions appreciated):
5 | Dictionary Adapter - http://docs.castleproject.org/Tools.Castle-DictionaryAdapter.ashx
6 | DynamicProxy - http://docs.castleproject.org/Tools.DynamicProxy.ashx
7 | Discusssion group: - http://groups.google.com/group/castle-project-users
8 | StackOverflow tags: - castle-dynamicproxy, castle-dictionaryadapter, castle
9 |
10 | Issue tracker: - http://issues.castleproject.org/dashboard
--------------------------------------------------------------------------------
/Data.Hibernate/SessionHelper.cs:
--------------------------------------------------------------------------------
1 | using NHibernate;
2 | using NHibernate.Cfg;
3 |
4 | namespace Iridescent.Data.Hibernate
5 | {
6 | public class SessionHelper
7 | {
8 | private static Configuration cfg;
9 | private static ISessionFactory sessionFactory;
10 |
11 | static SessionHelper()
12 | {
13 | cfg = new Configuration();
14 | cfg.Configure();
15 | sessionFactory = cfg.BuildSessionFactory();
16 | }
17 |
18 | public static ISession GetNewSession()
19 | {
20 | return sessionFactory.OpenSession();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Iridescent.DependencyResolution/ContainerFactory.cs:
--------------------------------------------------------------------------------
1 | using Iridescent.DependencyResolution.Impl;
2 |
3 | namespace Iridescent.DependencyResolution
4 | {
5 | public class ContainerFactory
6 | {
7 | private static IObjectContainer _objectContainer;
8 |
9 | public static IObjectContainer Singleton
10 | {
11 | get
12 | {
13 | if(_objectContainer==null)
14 | _objectContainer=new StructureMapContainer();
15 |
16 | return _objectContainer;
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Iridescent.Redis/Config/Pools.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 |
3 | namespace Iridescent.Redis.Config
4 | {
5 | ///
6 | /// 功能:Redis配置结点组
7 | /// 作者:娄晨
8 | /// 日期:2014-5-20
9 | ///
10 | public class Pools : ConfigurationElementCollection
11 | {
12 | protected override ConfigurationElement CreateNewElement()
13 | {
14 | return new PoolConfig();
15 | }
16 |
17 | protected override object GetElementKey(ConfigurationElement element)
18 | {
19 | return (element as PoolConfig).Name;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Examples/AOP/Test.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Examples.AOP.Test" %>
2 | <%@ Import Namespace="Examples.IService" %>
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Iridescent.JobService/quartz_jobs.config:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Utils/FluentEmail/IHideObjectMembers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 |
4 | namespace Iridescent.Utils.FluentEmail
5 | {
6 | [EditorBrowsable(EditorBrowsableState.Never)]
7 | public interface IHideObjectMembers
8 | {
9 | [EditorBrowsable(EditorBrowsableState.Never)]
10 | Type GetType();
11 |
12 | [EditorBrowsable(EditorBrowsableState.Never)]
13 | int GetHashCode();
14 |
15 | [EditorBrowsable(EditorBrowsableState.Never)]
16 | string ToString();
17 |
18 | [EditorBrowsable(EditorBrowsableState.Never)]
19 | bool Equals(object obj);
20 | }
21 | }
--------------------------------------------------------------------------------
/Ajax/AjaxMethodAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Iridescent.Ajax
7 | {
8 | [AttributeUsage(AttributeTargets.Method,AllowMultiple = false)]
9 | public class AjaxMethodAttribute:Attribute
10 | {
11 | public HttpSessionState SessionState { get; private set; }
12 |
13 | public AjaxMethodAttribute():this(HttpSessionState.ReadWrite)
14 | {
15 |
16 | }
17 |
18 | public AjaxMethodAttribute(HttpSessionState sessionState)
19 | {
20 | SessionState = sessionState;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Iridescent.CacheHandler/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Iridescent.CacheHandler/CacchingAopConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using Castle.DynamicProxy;
4 | using Snap.StructureMap;
5 | using StructureMap;
6 | using Snap;
7 |
8 | namespace Iridescent.CacheHandler
9 | {
10 |
11 | public static class CacchingAopConfig
12 | {
13 | public static void Config(string includeNamespace)
14 | {
15 | SnapConfiguration.For(c =>
16 | {
17 | c.IncludeNamespace(includeNamespace);
18 | c.Bind().To();
19 | });
20 | }
21 |
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/Utils/Http/UrlUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Web;
2 |
3 | namespace Iridescent.Utils.Http
4 | {
5 | public static class UrlUtils
6 | {
7 | public static string UpperCaseUrlEncode(string s)
8 | {
9 | char[] temp = HttpUtility.UrlEncode(s).ToCharArray();
10 | for (int i = 0; i < temp.Length - 2; i++)
11 | {
12 | if (temp[i] == '%')
13 | {
14 | temp[i + 1] = char.ToUpper(temp[i + 1]);
15 | temp[i + 2] = char.ToUpper(temp[i + 2]);
16 | }
17 | }
18 | return new string(temp);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/EnyimMemcached.2.12/EnyimMemcached.2.12.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | EnyimMemcached
5 | 2.12
6 | Attila Kiskó
7 | Attila Kiskó
8 | http://www.apache.org/licenses/LICENSE-2.0
9 | https://github.com/enyim/EnyimMemcached
10 | false
11 | Memcached client library for .NET based languages.
12 | memcached enyim cache caching
13 |
14 |
--------------------------------------------------------------------------------
/packages/Castle.Core.3.1.0/License.txt:
--------------------------------------------------------------------------------
1 | Copyright 2004-2012 Castle Project - http://www.castleproject.org/
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
15 |
--------------------------------------------------------------------------------
/Examples/Default.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | // <自动生成>
3 | // 此代码由工具生成。
4 | //
5 | // 对此文件的更改可能会导致不正确的行为,并且如果
6 | // 重新生成代码,这些更改将会丢失。
7 | // 自动生成>
8 | //------------------------------------------------------------------------------
9 |
10 | namespace Examples {
11 |
12 |
13 | public partial class _Default {
14 |
15 | ///
16 | /// form1 控件。
17 | ///
18 | ///
19 | /// 自动生成的字段。
20 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Examples/Cache/Test.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | // <自动生成>
3 | // 此代码由工具生成。
4 | //
5 | // 对此文件的更改可能会导致不正确的行为,并且如果
6 | // 重新生成代码,这些更改将会丢失。
7 | // 自动生成>
8 | //------------------------------------------------------------------------------
9 |
10 | namespace Examples.Cache {
11 |
12 |
13 | public partial class Test {
14 |
15 | ///
16 | /// form1 控件。
17 | ///
18 | ///
19 | /// 自动生成的字段。
20 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Examples/NHibernate/Test.aspx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.UI;
6 | using System.Web.UI.WebControls;
7 | using Iridescent.Data;
8 |
9 | namespace Examples.NHibernate
10 | {
11 | public partial class Test : System.Web.UI.Page
12 | {
13 | protected void Page_Load(object sender, EventArgs e)
14 | {
15 | IDataProviderFactory dataProviderFactory = new DataAccessProviderFactory();
16 | IDataContext dataContext = dataProviderFactory.GetDataContext();
17 |
18 | grdView.DataSource = dataContext.GetAll();
19 | grdView.DataBind();
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/Examples/AOP/Test.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | // <自动生成>
3 | // 此代码由工具生成。
4 | //
5 | // 对此文件的更改可能会导致不正确的行为,并且如果
6 | // 重新生成代码,这些更改将会丢失。
7 | // 自动生成>
8 | //------------------------------------------------------------------------------
9 |
10 | namespace Examples.AOP {
11 |
12 |
13 | public partial class Test {
14 |
15 | ///
16 | /// form1 控件。
17 | ///
18 | ///
19 | /// 自动生成的字段。
20 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Utils/Misc/CellMemberAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Iridescent.Utils.Misc
4 | {
5 | ///
6 | /// 列成员属性
7 | ///
8 | public class CellMemberAttribute:Attribute
9 | {
10 | ///
11 | /// Row轴索引
12 | ///
13 | public int Index { get; set; }
14 |
15 | ///
16 | /// Column轴标题
17 | ///
18 | public string Caption { get; set; }
19 |
20 | public CellMemberAttribute(int index)
21 | {
22 | Index = index;
23 | }
24 |
25 | public CellMemberAttribute(string caption)
26 | {
27 | Caption = caption;
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/OrmUtils/ISqlExpressCommandGenerator.cs:
--------------------------------------------------------------------------------
1 | using Iridescent.Data.QueryModel;
2 |
3 | namespace Iridescent.OrmExpress
4 | {
5 | public interface ISqlExpressCommandGenerator
6 | {
7 |
8 | SqlExpressCommand GenerateSelectCommand(Query query = null,bool getCount=false);
9 |
10 | SqlExpressCommand GenerateGetPagingListCommand(int pageIndex, int pageSize,Query query=null);
11 |
12 | SqlExpressCommand GenerateDeleteCommand(Query query = null);
13 |
14 | SqlExpressCommand GenerateDeleteCommand(TEntity entity);
15 |
16 | SqlExpressCommand GenerateUpdateCommand(TEntity entity);
17 |
18 | SqlExpressCommand GenerateInsertCommand(TEntity entity);
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/UnitTest/Utils/IDCardVerifyTest.cs:
--------------------------------------------------------------------------------
1 | using Iridescent.Utils.Verify;
2 | using NUnit.Framework;
3 |
4 | namespace UnitTest.Utils
5 | {
6 |
7 |
8 | ///
9 | ///这是 IDCardVerifyTest 的测试类,旨在
10 | ///包含所有 IDCardVerifyTest 单元测试
11 | ///
12 | [TestFixture]
13 | public class IDCardVerifyTest
14 | {
15 |
16 | ///
17 | ///CheckIDCard 的测试
18 | ///
19 | [Test]
20 | public void CheckIDCardTest()
21 | {
22 | string Id = "112502190000201234";
23 | bool expected = false;
24 | bool actual;
25 | actual = IDCardVerify.CheckIDCard(Id);
26 | Assert.AreEqual(expected, actual);
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Iridescent.CacheHandler/CachingAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Snap;
6 |
7 | namespace Iridescent.CacheHandler
8 | {
9 | public class CachingAttribute : MethodInterceptAttribute
10 | {
11 | public TimeSpan CacheTimeSpan { get; private set; }
12 |
13 | public string Group { get; private set; }
14 |
15 | public CachingAttribute(int minutes = 30, string group = "")
16 | : this(TimeSpan.FromMinutes(minutes), group)
17 | {
18 | }
19 |
20 | public CachingAttribute(TimeSpan timeSpan, string group = "")
21 | {
22 | CacheTimeSpan = timeSpan;
23 | Group = group;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Iridescent.JobService/QuartzService.cs:
--------------------------------------------------------------------------------
1 | using log4net;
2 | using Quartz;
3 | using Quartz.Impl;
4 |
5 | namespace Iridescent.JobService
6 | {
7 | class QuartzService
8 | {
9 | private readonly ILog _log = LogManager.GetLogger(typeof(QuartzService));
10 |
11 | private IScheduler scheduler = null;
12 |
13 | public void Start()
14 | {
15 | _log.Info("统计服务正在启动");
16 |
17 | scheduler = StdSchedulerFactory.GetDefaultScheduler();
18 | scheduler.Start();
19 | }
20 |
21 | public void Stop()
22 | {
23 | if (scheduler != null && !scheduler.IsShutdown)
24 | scheduler.Shutdown();
25 |
26 | _log.Info("统计服务已停止");
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Utils/Http/BadRequestException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Iridescent.Utils.Http
4 | {
5 | ///
6 | /// 请求得到错误结果时引发的异常
7 | ///
8 | public class BadRequestException:ApplicationException
9 | {
10 | public string Response { get; private set; }
11 |
12 | public BadRequestException(string response)
13 | {
14 | Response = response;
15 | }
16 |
17 | public BadRequestException(string message,string response):base(message)
18 | {
19 | Response = response;
20 | }
21 |
22 | public BadRequestException(string message,string response,Exception innerException):base(message,innerException)
23 | {
24 | Response = response;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Entities/DomainObject.cs:
--------------------------------------------------------------------------------
1 | namespace Iridescent.Entities
2 | {
3 | public class DomainObject
4 | {
5 | //public virtual bool IsValid
6 | //{
7 | // get
8 | // {
9 | // try
10 | // {
11 | // return this.Validate().IsValid;
12 | // }
13 | // catch
14 | // {
15 | // return false;
16 | // }
17 | // }
18 | //}
19 |
20 | //public virtual ValidationResults Validate()
21 | //{
22 | // Validator validator = ValidationFactory.CreateValidator(this.GetType());
23 | // ValidationResults results = new ValidationResults();
24 | // validator.Validate(this, results);
25 | // return results;
26 | //}
27 | }
28 | }
--------------------------------------------------------------------------------
/Data.Hibernate/MappingFiles/Category.hbm.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/UnitTest/Redis/RedisTest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Iridescent.Redis;
6 | using NUnit.Framework;
7 |
8 | namespace UnitTest.Redis
9 | {
10 | [TestFixture]
11 | class RedisTest
12 | {
13 | [Test]
14 | public void EnsureRedisWork()
15 | {
16 | RedisCache cache = new RedisCache();
17 | string key = "now";
18 | DateTime dt = cache.Get(key);
19 | if (dt == DateTime.MinValue)
20 | {
21 | dt = DateTime.Now;
22 | cache.Set(key, dt, TimeSpan.FromMinutes(10));
23 | }
24 | DateTime dt1 = cache.Get(key);
25 | Console.WriteLine(dt);
26 | Console.WriteLine(dt1);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Utils/Setting/AppSetting.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Configuration;
3 |
4 | namespace Iridescent.Utils.Setting
5 | {
6 | ///
7 | /// AppConfig中的AppSettings中的配置
8 | ///
9 | public static class AppSetting
10 | {
11 |
12 | ///
13 | /// 通过setting键名获取配置,未获取到时返回默认值
14 | ///
15 | ///
16 | ///
17 | ///
18 | private static T GetSetting(string settingKey, T defaultValue=default(T)) where T : IConvertible
19 | {
20 | string value = ConfigurationManager.AppSettings[settingKey];
21 |
22 | return !string.IsNullOrEmpty(value) ? Common.ValueConverter.Parse(value, defaultValue) : defaultValue;
23 | }
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Utils/Common/UrlUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace Iridescent.Utils.Common
5 | {
6 | public static class UrlUtils
7 | {
8 | ///
9 | /// 是否是域名
10 | ///
11 | ///
12 | ///
13 | public static bool IsDomain(string siteUrl)
14 | {
15 | try
16 | {
17 | if (!siteUrl.StartsWith("http://") && !siteUrl.StartsWith("https://"))
18 | {
19 | siteUrl = "http://" + siteUrl;
20 | }
21 | Uri uri = new Uri(siteUrl);
22 | return uri.PathAndQuery=="/";
23 | }
24 | catch
25 | {
26 | return false;
27 | }
28 | }
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Iridescent.Redis/Config/PoolConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 |
3 | namespace Iridescent.Redis.Config
4 | {
5 | ///
6 | /// 功能:Redis连接池配置结点
7 | /// 作者:娄晨
8 | /// 日期:2014-5-20
9 | ///
10 | public class PoolConfig:ConfigurationElement
11 | {
12 | [ConfigurationProperty("name", IsRequired = true)]
13 | public string Name
14 | {
15 | get { return this["name"].ToString(); }
16 | }
17 |
18 | [ConfigurationProperty("weight", IsRequired = true)]
19 | public int Weight
20 | {
21 | get { return int.Parse(this["weight"].ToString()); }
22 | }
23 |
24 | [ConfigurationProperty("hosts", IsRequired = true)]
25 | public string Hosts
26 | {
27 | get { return this["hosts"].ToString(); }
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Etc/T-SQL/JoinIdToTable.sql:
--------------------------------------------------------------------------------
1 |
2 | SET ANSI_NULLS ON
3 | GO
4 | SET QUOTED_IDENTIFIER ON
5 | GO
6 |
7 | -- =============================================
8 | ALTER FUNCTION dbo.JoinIdToTable
9 | (
10 | @JoinId VARCHAR(1000)
11 | )
12 | RETURNS @IdList TABLE (
13 | Id INT,
14 | RowNumber INT
15 | )
16 | AS
17 | BEGIN
18 |
19 | DECLARE @Pos INT;
20 | DECLARE @StrId varchar(20);
21 | SET @Pos=1;
22 | DECLARE @RowNumber INT;
23 | SET @RowNumber=1;
24 |
25 | WHILE(@Pos<>0)
26 | BEGIN
27 |
28 | SET @Pos=CHARINDEX(',',@JoinId);
29 | IF @Pos=0
30 | SET @StrId=@JoinId;
31 | ELSE
32 | SET @StrId=SUBSTRING(@JoinId,1,@Pos-1);
33 |
34 | SET @JoinId=STUFF(@JoinId,1,@Pos,'');
35 | IF(ISNUMERIC(@StrId)=1)
36 | BEGIN
37 | INSERT INTO @IdList VALUES(CAST(@StrId AS INT),@RowNumber)
38 | SET @RowNumber=@RowNumber+1;
39 | END
40 |
41 | END
42 |
43 | RETURN
44 |
45 | END
46 |
47 | GO
48 |
--------------------------------------------------------------------------------
/Utils/Common/ValueConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Iridescent.Utils.Common
4 | {
5 | public static class ValueConverter
6 | {
7 | public static T Parse(string s, T failedValue = default(T), bool rethrow = false) where T : IConvertible
8 | {
9 | T result = failedValue;
10 | if(string.IsNullOrWhiteSpace(s) && !rethrow)
11 | return result;
12 |
13 | try
14 | {
15 | var convertible = (IConvertible)s;
16 | object typeObj = convertible.ToType(typeof(T), System.Globalization.CultureInfo.InvariantCulture);
17 | result = (T)typeObj;
18 | }
19 | catch
20 | {
21 | if (rethrow)
22 | {
23 | throw;
24 | }
25 | }
26 | return result;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Etc/QueuePrototype/QueuePrototype.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueuePrototype", "QueuePrototype\QueuePrototype.csproj", "{11335624-C82C-4E0F-9C04-EB14752DF33F}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|x86 = Debug|x86
9 | Release|x86 = Release|x86
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {11335624-C82C-4E0F-9C04-EB14752DF33F}.Debug|x86.ActiveCfg = Debug|x86
13 | {11335624-C82C-4E0F-9C04-EB14752DF33F}.Debug|x86.Build.0 = Debug|x86
14 | {11335624-C82C-4E0F-9C04-EB14752DF33F}.Release|x86.ActiveCfg = Release|x86
15 | {11335624-C82C-4E0F-9C04-EB14752DF33F}.Release|x86.Build.0 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/Examples/Default.aspx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.UI;
6 | using System.Web.UI.WebControls;
7 |
8 | namespace Examples
9 | {
10 | public partial class _Default : System.Web.UI.Page
11 | {
12 | protected void Page_Load(object sender, EventArgs e)
13 | {
14 | Session["abc"] = "sessionValue";
15 | Iridescent.Ajax.Utility.RegisterType(typeof(_Default));
16 | Iridescent.Ajax.Utility.RegisterType(typeof(Ajax));
17 | }
18 |
19 | [Iridescent.Ajax.AjaxMethod]
20 | public string GetServerTime(string test)
21 | {
22 | return DateTime.Now.ToString()+", "+test;
23 | }
24 |
25 | [Iridescent.Ajax.AjaxMethod(Iridescent.Ajax.HttpSessionState.ReadOnly)]
26 | public string GetSessionValue()
27 | {
28 | return Session["abc"].ToString();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/Iridescent.JobService/Common/EmailUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 | using Iridescent.Utils.FluentEmail;
3 |
4 | namespace Iridescent.JobService.Common
5 | {
6 | internal static class EmailUtils
7 | {
8 | ///
9 | /// 发送通知给服务维护人员
10 | ///
11 | ///
12 | ///
13 | ///
14 | public static void SendToMaintainer(string subject,string body,bool isHtml=true)
15 | {
16 | string maintainer = ConfigurationManager.AppSettings["mailReceiver"];
17 | if(!string.IsNullOrEmpty(maintainer))
18 | {
19 | Email.FromDefaultSetting()
20 | .To(maintainer)
21 | .Subject(subject)
22 | .Body(body, isHtml)
23 | .Send();
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Data.Hibernate/MappingFiles/Brand.hbm.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Examples/NHibernate/Test.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | // <自动生成>
3 | // 此代码由工具生成。
4 | //
5 | // 对此文件的更改可能会导致不正确的行为,并且如果
6 | // 重新生成代码,这些更改将会丢失。
7 | // 自动生成>
8 | //------------------------------------------------------------------------------
9 |
10 | namespace Examples.NHibernate {
11 |
12 |
13 | public partial class Test {
14 |
15 | ///
16 | /// form1 控件。
17 | ///
18 | ///
19 | /// 自动生成的字段。
20 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 |
24 | ///
25 | /// grdView 控件。
26 | ///
27 | ///
28 | /// 自动生成的字段。
29 | /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
30 | ///
31 | protected global::System.Web.UI.WebControls.GridView grdView;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Utils/Common/XmlSerializerUtils.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Xml.Serialization;
3 |
4 | namespace Iridescent.Utils.Common
5 | {
6 | public static class XmlSerializerUtils
7 | {
8 | public static T Deserialize(string filePath) where T:class
9 | {
10 | XmlSerializer serializer = new XmlSerializer(typeof(T));
11 | using (Stream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
12 | {
13 | T result = serializer.Deserialize(stream) as T;
14 | return result;
15 | }
16 | }
17 |
18 | public static void Serializer(string filePath,object obj)
19 | {
20 | XmlSerializer serializer = new XmlSerializer(obj.GetType());
21 | using (FileStream file = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write))
22 | {
23 | serializer.Serialize(file, obj);
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/OrmUtils/SqlServerOrmQuery.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 | using System.Data.Common;
4 | using System.Data.SqlClient;
5 | using Iridescent.Data.QueryModel;
6 | using System.Linq;
7 |
8 | namespace Iridescent.OrmExpress
9 | {
10 | internal class SqlServerOrmQuery:OrmQuery
11 | {
12 | public SqlServerOrmQuery(string connectionString) : base(connectionString)
13 | {
14 | }
15 |
16 | protected override IDataReader ExecuteReader(SqlExpressCommand command)
17 | {
18 | if(command.DbParameters==null)
19 | {
20 | return SqlHelper.ExecuteReader(ConnectionString, command.CommandType, command.StatementString);
21 | }
22 | SqlParameter[] sqlParameters = command.DbParameters.Cast().ToArray();
23 | return SqlHelper.ExecuteReader(ConnectionString, command.CommandType, command.StatementString,
24 | sqlParameters);
25 | }
26 |
27 | }
28 | }
--------------------------------------------------------------------------------
/Etc/QueuePrototype/QueuePrototype/OrderProducer.cs:
--------------------------------------------------------------------------------
1 | // Producer 类(使用一个辅助线程)
2 |
3 | // 将项异步添加到队列中,共添加 20 个项。
4 |
5 | using System;
6 | using System.Collections;
7 | using System.Collections.Generic;
8 |
9 | namespace QueuePrototype
10 | {
11 | public class OrderProducer
12 | {
13 | public int ProduceCount { get; private set; }
14 |
15 | public OrderProducer(Queue q, SyncEvents e)
16 | {
17 |
18 | _queue = q;
19 |
20 | _syncEvents = e;
21 |
22 | }
23 |
24 | public void EnqueueOrder(Order order)
25 | {
26 | lock (((ICollection)_queue).SyncRoot)
27 | {
28 | _queue.Enqueue(order);
29 | }
30 | ProduceCount++;
31 | Console.WriteLine(string.Format("Producer Thread:enqueue order of {0} user,create date: {1}", order.UserName, order.CreateDate));
32 |
33 | _syncEvents.NewItemEvent.Set();
34 | }
35 |
36 | private Queue _queue;
37 |
38 | private SyncEvents _syncEvents;
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/UnitTest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过下列特性集
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("UnitTest")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("UnitTest")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的某个类型,
19 | // 则将该类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("0c194422-65de-4ced-90db-0991a50159b5")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Examples/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下特性集
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Examples")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("Examples")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("72c5558f-793b-48d4-8dce-9e248aa41b47")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 您可以指定所有这些值,也可以使用“修订号”和“内部版本号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Data/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Data")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("Data")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("f759a954-e859-43f1-a0c2-63c283575aea")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Examples/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/Utils/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Utils")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("Utils")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("1365c2b8-f728-418b-b2b4-f1233ea2d632")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Ajax/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Ajax")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("坎普利特")]
12 | [assembly: AssemblyProduct("Iridescent.Ajax")]
13 | [assembly: AssemblyCopyright("Copyright © 坎普利特 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("9d4f8401-abdf-440d-bb1b-d959a9d69c04")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Entities/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Entities")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("Entities")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("2808ff4e-a3fa-44b5-84e9-4dc198dc3cf3")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/OrmUtils/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("OrmUtils")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("OrmUtils")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("2fada6e8-afa7-439c-84df-60bfee6032dc")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/WebControls/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("WebControls")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("WebControls")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("4bb46ed0-ebdb-4638-8d69-1be47b4c184d")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Data.Hibernate/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Data.Hibernate")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("Data.Hibernate")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2011")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("47f36eee-68b4-408a-bc69-5221fc58f0b8")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Iridescent.Cache/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Iridescent.Cache")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("Iridescent.Cache")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("e21060e2-79bc-46c3-9178-21bbec259e20")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Data/DataAccessProviderFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 | using System.Reflection;
3 |
4 | namespace Iridescent.Data
5 | {
6 | ///
7 | /// Summary description for DataAccessProviderFactory.
8 | ///
9 | public class DataAccessProviderFactory : IDataProviderFactory
10 | {
11 | private static Assembly activeProvider = null;
12 | private static IDataProviderFactory activeDataProviderFactory = null;
13 |
14 | static DataAccessProviderFactory()
15 | {
16 | string providerName = ConfigurationManager.AppSettings["DataProvider"];
17 | string providerFactoryName = ConfigurationManager.AppSettings["DataProviderFactory"];
18 | activeProvider = Assembly.Load(providerName);
19 | activeDataProviderFactory = (IDataProviderFactory) activeProvider.CreateInstance(providerFactoryName);
20 | }
21 |
22 | public IDataContext GetDataContext()
23 | {
24 | return activeDataProviderFactory.GetDataContext();
25 | }
26 |
27 | public static IDataContext CreateDataContext()
28 | {
29 | return activeDataProviderFactory.GetDataContext();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Utils/Common/DateTimeUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Iridescent.Utils.Common
4 | {
5 | public static class DateTimeUtils
6 | {
7 | ///
8 | /// 计算两个时间相差的年份,结果为周年
9 | ///
10 | ///
11 | ///
12 | ///
13 | public static int DiffYearWithFloor(DateTime dateTime1, DateTime dateTime2)
14 | {
15 | int year = Math.Abs(dateTime1.Year - dateTime2.Year);
16 | if (year != 0 && (dateTime1.Month != dateTime2.Month || dateTime1.Day != dateTime2.Day))
17 | {
18 | bool isTime1HasLaterDay = dateTime1.Month > dateTime2.Month ||
19 | (dateTime1.Month == dateTime2.Month && dateTime1.Day > dateTime2.Day);
20 | if (isTime1HasLaterDay)
21 | year += dateTime1.Year > dateTime2.Year ? 0 : -1;
22 | else
23 | year += dateTime1.Year > dateTime2.Year ? -1 : 0;
24 | }
25 |
26 | return year;
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Etc/QueuePrototype/QueuePrototype/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("QueuePrototype")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("微软中国")]
12 | [assembly: AssemblyProduct("QueuePrototype")]
13 | [assembly: AssemblyCopyright("Copyright © 微软中国 2012")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("5ca4be61-b014-4c89-8387-46b51921a197")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Iridescent.DependencyResolution/IObjectContainer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using StructureMap.Configuration.DSL;
4 | using StructureMap.Graph;
5 |
6 | namespace Iridescent.DependencyResolution
7 | {
8 | public interface IObjectContainer
9 | {
10 | T Resolve();
11 | object Resolve(Type modelType);
12 | IList