Example #1
0
 public UdpClientChannel(IDictionary properties, IClientChannelSinkProvider provider)
 {
     ChannelName = properties.GetValue("name", UdpChannelHelper.DefaultName);
     ChannelPriority = properties.GetValue("priority", UdpChannelHelper.DefaultPriority);
     ClientSinkProvider = provider ?? UdpChannelHelper.CreateClientSinkProvider();
     SetupClientProviderChain(ClientSinkProvider, new UdpClientChannelSinkProvider());
 }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var role = new Role();

                role.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                role.Name = dictionary.GetValue<string>(RedmineKeys.NAME);

                var permissions = dictionary.GetValue<ArrayList>(RedmineKeys.PERMISSIONS);
                if (permissions != null)
                {
                    role.Permissions = new List<Permission>();
                    foreach (var permission in permissions)
                    {
                        var perms = new Permission() { Info = permission.ToString() };
                        role.Permissions.Add(perms);
                    }

                }

                return role;
            }
            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var customField = new IssueCustomField();

                customField.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                customField.Name = dictionary.GetValue<string>(RedmineKeys.NAME);
                customField.Multiple = dictionary.GetValue<bool>(RedmineKeys.MULTIPLE);

                var val = dictionary.GetValue<object>(RedmineKeys.VALUE);

                if (val != null)
                {
                    if (customField.Values == null) customField.Values = new List<CustomFieldValue>();
                    var list = val as ArrayList;
                    if (list != null)
                    {
                        foreach (string value in list)
                        {
                            customField.Values.Add(new CustomFieldValue { Info = value });
                        }
                    }
                    else
                    {
                        customField.Values.Add(new CustomFieldValue { Info = val as string });
                    }
                }
                return customField;
            }

            return null;
        }
Example #4
0
 public StyleRuleMetadata(IDictionary<string, object> metadata)
 {
     this.AfterNames = metadata.GetValue("After", DefaultNamesValue).Where(n => n != null).ToList();
     this.BeforeNames = metadata.GetValue("Before", DefaultNamesValue).Where(n => n != null).ToList();
     this.LanguageName = (string)metadata["LanguageName"];
     this.Name = (string)metadata["Name"];
 }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientRelativeLinkDescriptor relativeLink = (WfClientRelativeLinkDescriptor)base.Deserialize(dictionary, type, serializer);

            relativeLink.Category = dictionary.GetValue("category", string.Empty);
            relativeLink.Url = dictionary.GetValue("url", string.Empty);

            return relativeLink;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientDynamicResourceDescriptor conditionResourceDesp = (WfClientDynamicResourceDescriptor)base.Deserialize(dictionary, type, serializer);

            conditionResourceDesp.Name = dictionary.GetValue("name", string.Empty);
            conditionResourceDesp.Condition = JSONSerializerExecute.Deserialize<WfClientConditionDescriptor>(dictionary.GetValue("condition", (object)null));

            return conditionResourceDesp;
        }
		public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
		{
			WeChatBaseResponse data = new WeChatBaseResponse();

			data.Ret = dictionary.GetValue("ret", 0);
			data.ErrMsg = dictionary.GetValue("err_msg", string.Empty);

			return data;
		}
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            string columnName = dictionary.GetValue("columnName", string.Empty);

            SOARolePropertyValue pv = new SOARolePropertyValue(new SOARolePropertyDefinition() { Name = columnName });

            pv.Value = dictionary.GetValue("value", string.Empty);

            return pv;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var timeEntryActivity = new TimeEntryActivity { Id = dictionary.GetValue<int>("id"), Name = dictionary.GetValue<string>("name"), IsDefault = dictionary.GetValue<bool>("is_default") };
                return timeEntryActivity;
            }

            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientApplication application = new WfClientApplication();

            application.CodeName = dictionary.GetValue("codeName", string.Empty);
            application.Name = dictionary.GetValue("name", string.Empty);
            application.Sort = dictionary.GetValue("sort", 0);

            return application;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var tracker = new Tracker { Id = dictionary.GetValue<int>("id"), Name = dictionary.GetValue<string>("name") };
                return tracker;
            }

            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientTransitionDescriptor transition = (WfClientTransitionDescriptor)base.Deserialize(dictionary, type, serializer);

            transition.FromActivityKey = dictionary.GetValue("fromActivityKey", string.Empty);
            transition.ToActivityKey = dictionary.GetValue("toActivityKey", string.Empty);
            transition.Condition = JSONSerializerExecute.Deserialize<WfClientConditionDescriptor>(dictionary.GetValue("condition", (object)null));

            return transition;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var project = new Project();

                project.Id = dictionary.GetValue<int>("id");
                project.Description = dictionary.GetValue<string>("description");
                project.HomePage = dictionary.GetValue<string>("homepage");
                project.Name = dictionary.GetValue<string>("name");
                project.Identifier = dictionary.GetValue<string>("identifier");
                project.Status = dictionary.GetValue<ProjectStatus>("status");
                project.CreatedOn = dictionary.GetValue<DateTime?>("created_on");
                project.UpdatedOn = dictionary.GetValue<DateTime?>("updated_on");
                project.Trackers = dictionary.GetValueAsCollection<ProjectTracker>("trackers");
                project.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>("custom_fields");
                project.IsPublic = dictionary.GetValue<bool>("is_public");
                project.Parent = dictionary.GetValueAsIdentifiableName("parent");
                project.IssueCategories = dictionary.GetValueAsCollection<ProjectIssueCategory>("issue_categories");
                project.EnabledModules = dictionary.GetValueAsCollection<ProjectEnabledModule>("enabled_modules");
                return project;
            }

            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var project = new Project();

                project.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                project.Description = dictionary.GetValue<string>(RedmineKeys.DESCRIPTION);
                project.HomePage = dictionary.GetValue<string>(RedmineKeys.HOMEPAGE);
                project.Name = dictionary.GetValue<string>(RedmineKeys.NAME);
                project.Identifier = dictionary.GetValue<string>(RedmineKeys.IDENTIFIER);
                project.Status = dictionary.GetValue<ProjectStatus>(RedmineKeys.STATUS);
                project.CreatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.CREATED_ON);
                project.UpdatedOn = dictionary.GetValue<DateTime?>(RedmineKeys.UPDATED_ON);
                project.Trackers = dictionary.GetValueAsCollection<ProjectTracker>(RedmineKeys.TRACKERS);
                project.CustomFields = dictionary.GetValueAsCollection<IssueCustomField>(RedmineKeys.CUSTOM_FIELDS);
                project.IsPublic = dictionary.GetValue<bool>(RedmineKeys.IS_PUBLIC);
                project.Parent = dictionary.GetValueAsIdentifiableName(RedmineKeys.PARENT);
                project.IssueCategories = dictionary.GetValueAsCollection<ProjectIssueCategory>(RedmineKeys.ISSUE_CATEGORIES);
                project.EnabledModules = dictionary.GetValueAsCollection<ProjectEnabledModule>(RedmineKeys.ENABLED_MODULES);
                return project;
            }

            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientRolePropertyRow row = new WfClientRolePropertyRow();

            row.RowNumber = dictionary.GetValue("rowNumber", 0);
            row.Operator = dictionary.GetValue("operator", string.Empty);
            row.OperatorType = dictionary.GetValue("operatorType", WfClientRoleOperatorType.User);
            JSONSerializerExecute.FillDeserializedCollection(dictionary["values"], row.Values);

            return row;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientProgram program = new WfClientProgram();

            program.ApplicationCodeName = dictionary.GetValue("applicationCodeName", string.Empty);
            program.CodeName = dictionary.GetValue("codeName", string.Empty);
            program.Name = dictionary.GetValue("name", string.Empty);
            program.Sort = dictionary.GetValue("sort", 0);

            return program;
        }
 public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
 {
     if ((dictionary != null))
     {
         var projectTracker = new ProjectIssueCategory();
         projectTracker.Id = dictionary.GetValue<int>("id");
         projectTracker.Name = dictionary.GetValue<string>("name");
         return projectTracker;
     }
     return null;
 }
 public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
 {
     if ((dictionary != null))
     {
         var projectEnableModule = new ProjectEnabledModule();
         projectEnableModule.Id = dictionary.GetValue<int>("id");
         projectEnableModule.Name = dictionary.GetValue<string>("name");
         return projectEnableModule;
     }
     return null;
 }
 public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
 {
     if ((dictionary != null))
     {
         var projectTracker = new ProjectTracker();
         projectTracker.Id = dictionary.GetValue<int>(RedmineKeys.ID);
         projectTracker.Name = dictionary.GetValue<string>(RedmineKeys.NAME);
         return projectTracker;
     }
     return null;
 }
Example #20
0
 public UdpServerChannel(IDictionary properties, IServerChannelSinkProvider provider)
 {
     ChannelName = properties.GetValue("name", UdpChannelHelper.DefaultName);
     ChannelPriority = properties.GetValue("priority", UdpChannelHelper.DefaultPriority);
     MachineName = properties.GetValue("machineName", Dns.GetHostName());
     Port = properties.GetValue("port", UdpChannelHelper.DefaultPort);
     ChannelDataStore = UdpChannelHelper.CreateChannelDataStore(MachineName, Port);
     ServerSinkProvider = provider ?? UdpChannelHelper.CreateServerSinkProvider();
     SetupServerSinkChain(ServerSinkProvider);
     StartListening(null);
 }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientProcessInfo processInfo = (WfClientProcessInfo)base.Deserialize(dictionary, type, serializer);

            processInfo.CurrentActivity = JSONSerializerExecute.Deserialize<WfClientActivity>(dictionary.GetValue("currentActivity", (WfClientActivity)null));
            processInfo.PreviousActivity = JSONSerializerExecute.Deserialize<WfClientActivity>(dictionary.GetValue("previousActivity", (WfClientActivity)null));

            JSONSerializerExecute.FillDeserializedCollection(dictionary.GetValue("nextActivities", (object)null), processInfo.NextActivities);

            return processInfo;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientBranchProcessTemplateDescriptor template = (WfClientBranchProcessTemplateDescriptor)base.Deserialize(dictionary, type, serializer);

            template.Condition = JSONSerializerExecute.Deserialize<WfClientConditionDescriptor>(dictionary.GetValue("condition", (object)null));

            JSONSerializerExecute.FillDeserializedCollection<WfClientResourceDescriptor>(dictionary.GetValue("resources", (object)null), template.Resources);
            JSONSerializerExecute.FillDeserializedCollection<WfClientResourceDescriptor>(dictionary.GetValue("cancelSubProcessNotifier", (object)null), template.CancelSubProcessNotifier);
            JSONSerializerExecute.FillDeserializedCollection<WfClientRelativeLinkDescriptor>(dictionary.GetValue("relativeLinks", (object)null), template.RelativeLinks);

            return template;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var entity = new IdentifiableName();

                entity.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                entity.Name = dictionary.GetValue<string>(RedmineKeys.NAME);

                return entity;
            }
            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientTransferParams transferParams = new WfClientTransferParams();

            transferParams.NextActivityDescriptorKey = dictionary.GetValue("nextActivityDescriptorKey", string.Empty);
            transferParams.FromTransitionDescriptorKey = dictionary.GetValue("fromTransitionDescriptorKey", string.Empty);
            transferParams.Operator = JSONSerializerExecute.Deserialize<WfClientUser>(dictionary.GetValue("operator", (object)null));

            JSONSerializerExecute.FillDeserializedCollection(dictionary["branchTransferParams"], transferParams.BranchTransferParams);
            JSONSerializerExecute.FillDeserializedCollection(dictionary["assignees"], transferParams.Assignees);

            return transferParams;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var userGroup = new GroupUser();

                userGroup.Id = dictionary.GetValue<int>(RedmineKeys.ID);
                userGroup.Name = dictionary.GetValue<string>(RedmineKeys.NAME);

                return userGroup;
            }

            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var entity = new TrackerCustomField();

                entity.Id = dictionary.GetValue<int>("id");
                entity.Name = dictionary.GetValue<string>("name");

                return entity;
            }

            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var role = new Role();

                role.Id = dictionary.GetValue<int>("id");
                role.Name = dictionary.GetValue<string>("name");
                role.Permissions = dictionary.GetValueAsCollection<Permission>("permissions");

                return role;
            }
            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var watcher = new Watcher();

                watcher.Id = dictionary.GetValue<int>("id");
                watcher.Name = dictionary.GetValue<string>("name");

                return watcher;
            }

            return null;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfClientProcessDescriptor processDesp = (WfClientProcessDescriptor)base.Deserialize(dictionary, type, serializer);

            JSONSerializerExecute.FillDeserializedCollection<WfClientActivityDescriptor>(dictionary.GetValue("activities", (object)null), processDesp.Activities);

            processDesp.NormalizeAllTransitions();

            JSONSerializerExecute.FillDeserializedCollection<WfClientVariableDescriptor>(dictionary.GetValue("variables", (object)null), processDesp.Variables);
            JSONSerializerExecute.FillDeserializedCollection<WfClientRelativeLinkDescriptor>(dictionary.GetValue("relativeLinks", (object)null), processDesp.RelativeLinks);
            JSONSerializerExecute.FillDeserializedCollection<WfClientResourceDescriptor>(dictionary.GetValue("cancelEventReceivers", (object)null), processDesp.CancelEventReceivers);

            return processDesp;
        }
        public override object Deserialize(IDictionary<string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            if (dictionary != null)
            {
                var userGroup = new UserGroup();

                userGroup.Id = dictionary.GetValue<int>("id");
                userGroup.Name = dictionary.GetValue<string>("name");

                return userGroup;
            }

            return null;
        }