public static RepresentedConfiguration ExtractFromBroker(Broker b) { ConfigurationBroker c = new ConfigurationBroker(); c.Connections = (from cc in b.MessageChannels.Connections select new cConnection() { Name = cc.Key, queueTypeName = cc.Value.QueueTypeName, QueueParameters = cc.Value.specParams.GetHolder() }).ToArray(); c.Channels = (from cc in b.MessageChannels.MChannelsList select new cChannel() { connectionName = cc.ConnectionName, Name = cc.UniqueName }).ToArray(); c.Tasks = (from tt in b.Tasks select new cTask() { intervalType = tt.intervalType, Description = tt.NameAndDescription, ChannelName = tt.ChannelName, intervalValue = tt.intervalValue, ModuleName = tt.Module.UniqueName, parameters = tt.Parameters == null ? null : tt.Parameters, Auto = tt.Temp }).ToArray(); return c; }
public static bool ValidateMain(ref string json, out string errors, out ConfigurationBroker bc) { bc = null; try { bc = ConfigurationBroker.DeSerialiseJson(json); json = bc.SerialiseJsonString(); } catch (Exception e) { errors = "Configuration broken: " + e.Message; return false; } errors = "ok"; return true; }
/// <summary> /// 从配置文件中读取配置的最大Json尺寸 /// </summary> /// <returns></returns> public static int GetMaxJsonLength() { int result = -1; ScriptingJsonSerializationSection scriptSection = (ScriptingJsonSerializationSection)ConfigurationBroker.GetSection("jsonSerialization"); if (scriptSection == null) { scriptSection = (ScriptingJsonSerializationSection)ConfigurationBroker.GetSection("scriptJsonSerialization"); } if (scriptSection != null) { result = scriptSection.MaxJsonLength; } if (result < 0) { result = int.MaxValue; } return(result); }
public static DropdownPropertyDataSourceSettings GetConfig() { DropdownPropertyDataSourceSettings settings = (DropdownPropertyDataSourceSettings)ConfigurationBroker.GetSection("dropdownPropertyDataSourceSettings"); if (settings == null) { settings = new DropdownPropertyDataSourceSettings(); } return(settings); }
public static ScriptingJsonSerializationSection GetJsonSerializationSection() { //原来的配置节的名称为jsonSerialization,现在更换为scriptJsonSerialization ScriptingJsonSerializationSection section = (ScriptingJsonSerializationSection)ConfigurationBroker.GetSection("deluxe.web/scriptJsonSerialization"); if (section == null) { section = new ScriptingJsonSerializationSection(); } return(section); }
public static void Apply(this ConfigurationBroker con, Broker broker) { logger.Debug("Trying to apply ---main configuration---\r\n with datetime stamp: {0} {1}", con.CreationDate.ToLongDateString(), con.CreationDate.ToLongTimeString()); for (int i = 0; i < con.Connections.Length; i++) { cConnection connection = con.Connections[i]; if (connection.Auto) { logger.Warning("Skipping connection parameters for [{0}]:{1}", i, connection.Name); } else if (connection.queueTypeName == null) { logger.Error("Connection has not auto specific property, ignored: {0}", i); } else if (connection.QueueParameters == null) { logger.Error("Connection parameters for queue: {0} is absent, this queue will be ignored", connection.Name); } else { var qinterface = broker.QueueInterfaces.GetQueue(connection.queueTypeName); QueueSpecificParameters parameters = qinterface.GetParametersModel(); parameters.SetHolder(connection.QueueParameters); broker.RegisterConnection(connection.Name, qinterface, parameters, false); } } foreach (var channel in con.Channels) { try { if (channel.Auto) { logger.Warning("Skipping channel for {0}", channel.Name); } else { broker.RegisterChannel(channel.connectionName, channel.Name, false); } } catch (Exception e) { logger.Exception(e, "Channels configuration applying, ignored"); } } for (int i = 0; i < con.Tasks.Length; i++) { var task = con.Tasks[i]; if (task == null) { logger.Error("Task has not auto specific property, ignored: {0}", i); } else if (!task.Auto) { try { broker.RegisterTask(task.ChannelName, task.ModuleName, task.intervalType, task.intervalValue, task.parameters, task.Description); } catch (Exception e) { logger.Exception(e, "Tasks configuration applying, ignored"); } } } }
/// <summary> /// 获取Section实例 /// </summary> /// <returns></returns> public static ApplicationErrorLogSection GetSection() { return((ApplicationErrorLogSection)ConfigurationBroker.GetSection("appicationErrorLog")); }
/// <summary> /// 得到配置信息 /// </summary> /// <returns></returns> public static PermissionCenterToADSynchronizeSettings GetConfig() { PermissionCenterToADSynchronizeSettings result = (PermissionCenterToADSynchronizeSettings)ConfigurationBroker.GetSection("permissionCenterToADSynchronizeSettings"); if (result == null) { result = new PermissionCenterToADSynchronizeSettings(); } return(result); }
public static LogCategoryConfigSection GetConfig() { LogCategoryConfigSection settings = (LogCategoryConfigSection)ConfigurationBroker.GetSection("schemaLogCategorySettings"); return(settings); }
public static PropertyEditorConfigurationSection GetConfig() { PropertyEditorConfigurationSection result = (PropertyEditorConfigurationSection)ConfigurationBroker.GetSection("propertyEditorConfig"); if (result == null) { result = new PropertyEditorConfigurationSection(); } return(result); }
public static MossServerInfoConfigurationSettings GetConfig() { MossServerInfoConfigurationSettings result = (MossServerInfoConfigurationSettings)ConfigurationBroker.GetSection("mossServerInfoConfigSettings"); ConfigurationExceptionHelper.CheckSectionNotNull(result, "mossServerInfoConfigSettings"); return(result); }
public static CutomerServiceExecutiveSetting GetConfig() { CutomerServiceExecutiveSetting settings = (CutomerServiceExecutiveSetting)ConfigurationBroker.GetSection("cutomerServiceExecutiveSetting"); if (settings == null) { settings = new CutomerServiceExecutiveSetting(); } return(settings); }
/// <summary> /// 获取WebControlsSection /// </summary> /// <returns>WebControlsSection</returns> /// <remarks>获取WebControlsSection</remarks> public static Framework.Web.Config.WebControlsSection GetWebControlsSection() { Framework.Web.Config.WebControlsSection section = (Framework.Web.Config.WebControlsSection)ConfigurationBroker.GetSection("Framework.web/webcontrols"); if (section == null) { section = new Framework.Web.Config.WebControlsSection(); } return(section); }
/// <summary> /// 获取Cache的配置信息 /// </summary> /// <returns>Cache的配置信息</returns> public static SendInvalidNotificationSettingsSection GetConfig() { SendInvalidNotificationSettingsSection result = (SendInvalidNotificationSettingsSection)ConfigurationBroker.GetSection("sendInvalidNotificationSettings"); if (result == null) { result = new SendInvalidNotificationSettingsSection(); } return(result); }
public static JsonConverterRegisterSettings GetConfig() { JsonConverterRegisterSettings result = (JsonConverterRegisterSettings)ConfigurationBroker.GetSection("jsonConverterRegisterSettings"); return(result ?? new JsonConverterRegisterSettings()); }
public void Test() { IObjectBuilder builder = ConfigurationBroker.GetConfigurationObject <IObjectBuilder>(); Assert.IsNotNull(builder); }
public static ObjectValueToPropertyValueSettings GetConfig() { ObjectValueToPropertyValueSettings settings = (ObjectValueToPropertyValueSettings)ConfigurationBroker.GetSection("objectValueToPropertyValueSettings"); if (settings == null) { settings = new ObjectValueToPropertyValueSettings(); } return(settings); }
/// <summary> /// 获取配置信息。如果不存在,则返回null /// </summary> /// <returns></returns> public static SNTPSettings GetConfig() { return((SNTPSettings)ConfigurationBroker.GetSection("sntpSettings")); }
private static readonly ConfigurationProperty _StandardManageDimensionality = new ConfigurationProperty("smdId", typeof(string), "", ConfigurationPropertyOptions.IsRequired); // 标准管理维度 public static PermissionBackwardCompatibilityConfigSection GetConfig() { PermissionBackwardCompatibilityConfigSection settings = (PermissionBackwardCompatibilityConfigSection)ConfigurationBroker.GetSection("pcBCConfig"); if (settings == null) { settings = new PermissionBackwardCompatibilityConfigSection(); } return(settings); }
/// <summary> /// 得到配置信息 /// </summary> /// <returns></returns> public static WfControlOperationPlugInsSettings GetConfig() { WfControlOperationPlugInsSettings settings = (WfControlOperationPlugInsSettings)ConfigurationBroker.GetSection("wfControlOperationPlugInsSettings"); if (settings == null) { settings = new WfControlOperationPlugInsSettings(); } return(settings); }
public static ComponentHelperWrapperSettings GetConfig() { ComponentHelperWrapperSettings settings = (ComponentHelperWrapperSettings)ConfigurationBroker.GetSection("componentHelperWrapperSettings"); if (settings == null) { settings = new ComponentHelperWrapperSettings(); } return(settings); }
public void Load() { Type type = System.Type.GetType(ObjectBuilder.TypeName); ConfigurationBroker.Add(typeof(IObjectBuilder), Activator.CreateInstance(type)); }
public static UserRecentDataConfigurationSection GetConfig() { UserRecentDataConfigurationSection settings = (UserRecentDataConfigurationSection)ConfigurationBroker.GetSection("userRecentDataSettings"); if (settings == null) { settings = new UserRecentDataConfigurationSection(); } return(settings); }
public static WorkflowSettings GetConfig() { return((WorkflowSettings)ConfigurationBroker.GetSection("workflowSettings", true)); }
/// <summary> /// 获取WebControlsSection /// </summary> /// <returns>WebControlsSection</returns> /// <remarks>获取WebControlsSection</remarks> public static Lib.Web.Config.WebControlsSection GetWebControlsSection() { Lib.Web.Config.WebControlsSection section = (Lib.Web.Config.WebControlsSection)ConfigurationBroker.GetSection("lib.web/webcontrols"); if (section == null) { section = new Lib.Web.Config.WebControlsSection(); } return(section); }
public static ActivateWfProcessServiceSettings GetConfig() { ActivateWfProcessServiceSettings result = (ActivateWfProcessServiceSettings)ConfigurationBroker.GetSection("activateWfProcessConfig"); if (result == null) { result = new ActivateWfProcessServiceSettings(); } return(result); }
/// <summary> /// 获取JsonSerializationSection /// </summary> /// <returns>JsonSerializationSection</returns> /// <remarks>获取JsonSerializationSection</remarks> public static ScriptingJsonSerializationSection GetJsonSerializationSection() { ScriptingJsonSerializationSection section = (ScriptingJsonSerializationSection)ConfigurationBroker.GetSection("lib.web/jsonConverter"); if (section == null) { section = new ScriptingJsonSerializationSection(); } return(section); }
public void ExceedMaxJsonLengthSerializationLengthTest() { ScriptingJsonSerializationSection scriptSection = (ScriptingJsonSerializationSection)ConfigurationBroker.GetSection("jsonSerialization"); Console.WriteLine(scriptSection.MaxJsonLength); string data = PrepateTestStringByLength(15000); string json = JSONSerializerExecute.Serialize(data); }
/// <summary> /// 获取JsonSerializationSection /// </summary> /// <returns>JsonSerializationSection</returns> /// <remarks>获取JsonSerializationSection</remarks> private static ScriptingJsonSerializationSection GetJsonSerializationSection() { ScriptingJsonSerializationSection section = (ScriptingJsonSerializationSection)ConfigurationBroker.GetSection("scriptJsonSerialization"); if (section == null) { section = new ScriptingJsonSerializationSection(); } return(section); }