Example #1
0
 public override IEnumerable <StateVariable> GetState()
 {
     return(new[] {
         new StateVariable
         {
             Name = nameof(Key),
             Value = Key,
             Type = StateVariable.StateType.Input
         },
         new StateVariable
         {
             Name = nameof(Result),
             Value = Result,
             Type = StateVariable.StateType.Output
         }
         ,
         new StateVariable
         {
             Name = nameof(Response),
             Value = Response,
             Type = StateVariable.StateType.Output
         },
         new StateVariable
         {
             Name = nameof(SourceId),
             Value = SourceId.ToString(),
             Type = StateVariable.StateType.Input
         }
     });
 }
Example #2
0
 void IXmlSerializable.WriteXml(System.Xml.XmlWriter a)
 {
     a.WriteElementString("DefaultValueGroupId", DefaultValueGroupId.ToString());
     a.WriteElementString("FullName", FullName);
     a.WriteElementString("GroupRoleId", GroupRoleId.ToString());
     a.WriteStartElement("IsAnonymous");
     a.WriteValue(IsAnonymous);
     a.WriteEndElement();
     a.WriteElementString("SearchMode", SearchMode.ToString());
     a.WriteDateTimeOffset(LastActivityDate, "LastActivityDate");
     a.WriteDateTimeOffset(LastUpdatedDate, "LastUpdatedDate");
     a.WriteElementString("ProfileId", ProfileId.ToString());
     a.WriteStartElement("Properties");
     if (Properties != null)
     {
         var b = new XmlSerializer(typeof(ProfileProperty), new XmlRootAttribute("ProfileProperty"));
         foreach (IXmlSerializable i in Properties)
         {
             b.Serialize(a, i);
         }
     }
     a.WriteEndElement();
     a.WriteStartElement("RoleSet");
     if (RoleSet != null)
     {
         ((IXmlSerializable)RoleSet).WriteXml(a);
     }
     a.WriteEndElement();
     a.WriteStartElement("Source");
     if (Source != null)
     {
         ((IXmlSerializable)Source).WriteXml(a);
     }
     a.WriteEndElement();
     a.WriteElementString("SourceId", SourceId.ToString());
     a.WriteElementString("UserId", UserId.ToString());
     a.WriteElementString("UserName", UserName);
     a.WriteStartElement("MarkGroupId");
     if (MarkGroupId.HasValue)
     {
         a.WriteValue(MarkGroupId.Value);
     }
     a.WriteEndElement();
     a.WriteStartElement("SellerTreeId");
     if (SellerTreeId.HasValue)
     {
         a.WriteValue(SellerTreeId.Value);
     }
     a.WriteEndElement();
     a.WriteStartElement("IntermediateId");
     if (IntermediateId.HasValue)
     {
         a.WriteValue(IntermediateId.Value);
     }
     a.WriteEndElement();
 }
Example #3
0
 public object ToScriptSource(int executionContextId, object executionContextAuxData)
 {
     return(new {
         scriptId = SourceId.ToString(),
         url = Url,
         executionContextId,
         executionContextAuxData,
         //hash = "abcdee" + id,
         dotNetUrl = DotNetUrl,
     });
 }
 public object ToScriptSource(int executionContextId, object executionContextAuxData)
 {
     return(new {
         scriptId = SourceId.ToString(),
         url = Url,
         executionContextId,
         executionContextAuxData,
         //hash:  should be the v8 hash algo, managed implementation is pending
         dotNetUrl = DotNetUrl,
     });
 }
        /// <summary>
        /// Writes the class fields.
        /// </summary>
        /// <param name="writer">The writer to which to write</param>
        public void Write(IDataWriter writer)
        {
            writer.WriteString(SourceId.ToString());
            writer.WriteString(DestId.ToString());
            writer.WriteInt32(Data.Count);
            writer.WriteString(Data[0].GetType().AssemblyQualifiedName);

            foreach (var data in Data)
            {
                data.Write(writer);
            }
        }
        /// <summary>
        /// Writes the class fields.
        /// </summary>
        /// <param name="writer">The writer to which to write</param>
        /// <param name="token">The cancellation token</param>
        public async Task WriteAsync(IDataWriter writer, CancellationToken token)
        {
            await writer.WriteStringAsync(SourceId.ToString(), token);

            await writer.WriteStringAsync(DestId.ToString(), token);

            await writer.WriteInt32Async(Data.Count, token);

            await writer.WriteStringAsync(Data[0].GetType().AssemblyQualifiedName, token);

            foreach (var data in Data)
            {
                data.Write(writer);
            }
        }
Example #7
0
        public bool Equals(DsfOracleDatabaseActivity other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(base.Equals(other) &&
                   string.Equals(SourceId.ToString(), other.SourceId.ToString()) &&
                   string.Equals(ProcedureName, other.ProcedureName));
        }
        public bool Equals(DsfSqlServerDatabaseActivity other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(base.Equals(other) &&
                   string.Equals(SourceId.ToString(), other.SourceId.ToString()) &&
                   string.Equals(ProcedureName, other.ProcedureName) &&
                   string.Equals(ExecuteActionString, other.ExecuteActionString));
        }
Example #9
0
        public XmlNode GetNode(string strLanguage)
        {
            if (_objCachedMyXmlNode != null && strLanguage == _strCachedXmlNodeLanguage && !GlobalOptions.LiveCustomData)
            {
                return(_objCachedMyXmlNode);
            }
            XmlDocument xmlDocument = XmlManager.Load(_eSource == Improvement.ImprovementSource.Bioware
                ? "bioware.xml"
                : _eSource == Improvement.ImprovementSource.Drug
                    ? "drugcomponents.xml"
                    : "cyberware.xml", strLanguage);

            _objCachedMyXmlNode = SourceId == Guid.Empty
                ? xmlDocument.SelectSingleNode("/chummer/grades/grade[name = \"" + Name + "\"]")
                : xmlDocument.SelectSingleNode("/chummer/grades/grade[id = \"" + SourceId.ToString("D", GlobalOptions.InvariantCultureInfo) + "\"]");

            _strCachedXmlNodeLanguage = strLanguage;
            return(_objCachedMyXmlNode);
        }
        public bool Equals(DsfSqlServerDatabaseActivity other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            var eq = base.Equals(other);

            eq &= string.Equals(SourceId.ToString(), other.SourceId.ToString());
            eq &= string.Equals(ProcedureName, other.ProcedureName);
            eq &= CommandTimeout == other.CommandTimeout;
            eq &= string.Equals(ExecuteActionString, other.ExecuteActionString);
            return(eq);
        }
Example #11
0
 public override IEnumerable <StateVariable> GetState()
 {
     return(new[] {
         new StateVariable
         {
             Name = "Key",
             Value = Key,
             Type = StateVariable.StateType.Input
         },
         new StateVariable
         {
             Name = "TTL",
             Value = TTL.ToString(),
             Type = StateVariable.StateType.Input
         },
         new StateVariable
         {
             Name = "Result",
             Value = Result,
             Type = StateVariable.StateType.Output
         }
         ,
         new StateVariable
         {
             Name = "Response",
             Value = Response,
             Type = StateVariable.StateType.Output
         },
         new StateVariable
         {
             Name = "SourceId",
             Value = SourceId.ToString(),
             Type = StateVariable.StateType.Input
         }
     });
 }
Example #12
0
 public XmlNode GetNode(string strLanguage)
 {
     if (_objCachedMyXmlNode == null || strLanguage != _strCachedXmlNodeLanguage || GlobalOptions.LiveCustomData)
     {
         _objCachedMyXmlNode       = XmlManager.Load(_eSource == Improvement.ImprovementSource.Bioware ? "bioware.xml" : "cyberware.xml", strLanguage).SelectSingleNode("/chummer/grades/grade[id = \"" + SourceId.ToString("D") + "\"]");
         _strCachedXmlNodeLanguage = strLanguage;
     }
     return(_objCachedMyXmlNode);
 }