//////////////////////////////////////////////////////////////////////////
        internal override void WriteXml(XmlNode RootNode)
        {
            XmlElement Node = RootNode.OwnerDocument.CreateElement("Method");

            Node.SetAttribute("Global", IsGlobal.ToString());
            Node.SetAttribute("Constructor", Constructor.ToString());

            base.WriteXml(Node);

            // headers
            foreach (string Header in Headers)
            {
                XmlNode HeaderNode = RootNode.OwnerDocument.CreateElement("Signature");
                XmlNode SigNode    = RootNode.OwnerDocument.CreateTextNode(Header);
                HeaderNode.AppendChild(SigNode);

                Node.AppendChild(HeaderNode);
            }

            // parameters
            foreach (ScriptParameter Param in Parameters)
            {
                Param.WriteXml(Node);
            }

            RootNode.AppendChild(Node);
        }
        //////////////////////////////////////////////////////////////////////////
        internal override void WriteXml(XmlNode RootNode)
        {
            XmlElement Node = RootNode.OwnerDocument.CreateElement("Attribute");

            Node.SetAttribute("Global", IsGlobal.ToString());
            Node.SetAttribute("ReadOnly", ReadOnly.ToString());

            base.WriteXml(Node);
            RootNode.AppendChild(Node);
        }
Exemple #3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Position;
         hashCode = (hashCode * 397) ^ (SearchText?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Filter.GetHashCode();
         hashCode = (hashCode * 397) ^ Highlight.GetHashCode();
         hashCode = (hashCode * 397) ^ UseRegex.GetHashCode();
         hashCode = (hashCode * 397) ^ IgnoreCase.GetHashCode();
         hashCode = (hashCode * 397) ^ (HighlightHue?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (IconKind?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ IsGlobal.GetHashCode();
         hashCode = (hashCode * 397) ^ IsExclusion.GetHashCode();
         return(hashCode);
     }
 }
Exemple #4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (OdataContext != null)
         {
             hashCode = hashCode * 59 + OdataContext.GetHashCode();
         }
         if (OdataType != null)
         {
             hashCode = hashCode * 59 + OdataType.GetHashCode();
         }
         if (ParentOptionSetName != null)
         {
             hashCode = hashCode * 59 + ParentOptionSetName.GetHashCode();
         }
         if (IsCustomOptionSet != null)
         {
             hashCode = hashCode * 59 + IsCustomOptionSet.GetHashCode();
         }
         if (IsGlobal != null)
         {
             hashCode = hashCode * 59 + IsGlobal.GetHashCode();
         }
         if (IsManaged != null)
         {
             hashCode = hashCode * 59 + IsManaged.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (ExternalTypeName != null)
         {
             hashCode = hashCode * 59 + ExternalTypeName.GetHashCode();
         }
         if (OptionSetType != null)
         {
             hashCode = hashCode * 59 + OptionSetType.GetHashCode();
         }
         if (IntroducedVersion != null)
         {
             hashCode = hashCode * 59 + IntroducedVersion.GetHashCode();
         }
         if (MetadataId != null)
         {
             hashCode = hashCode * 59 + MetadataId.GetHashCode();
         }
         if (HasChanged != null)
         {
             hashCode = hashCode * 59 + HasChanged.GetHashCode();
         }
         if (Options != null)
         {
             hashCode = hashCode * 59 + Options.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (DisplayName != null)
         {
             hashCode = hashCode * 59 + DisplayName.GetHashCode();
         }
         if (IsCustomizable != null)
         {
             hashCode = hashCode * 59 + IsCustomizable.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #5
0
        /// <summary>
        /// Returns true if InlineResponseDefault7 instances are equal
        /// </summary>
        /// <param name="other">Instance of InlineResponseDefault7 to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InlineResponseDefault7 other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     OdataContext == other.OdataContext ||
                     OdataContext != null &&
                     OdataContext.Equals(other.OdataContext)
                     ) &&
                 (
                     OdataType == other.OdataType ||
                     OdataType != null &&
                     OdataType.Equals(other.OdataType)
                 ) &&
                 (
                     ParentOptionSetName == other.ParentOptionSetName ||
                     ParentOptionSetName != null &&
                     ParentOptionSetName.Equals(other.ParentOptionSetName)
                 ) &&
                 (
                     IsCustomOptionSet == other.IsCustomOptionSet ||
                     IsCustomOptionSet != null &&
                     IsCustomOptionSet.Equals(other.IsCustomOptionSet)
                 ) &&
                 (
                     IsGlobal == other.IsGlobal ||
                     IsGlobal != null &&
                     IsGlobal.Equals(other.IsGlobal)
                 ) &&
                 (
                     IsManaged == other.IsManaged ||
                     IsManaged != null &&
                     IsManaged.Equals(other.IsManaged)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     ExternalTypeName == other.ExternalTypeName ||
                     ExternalTypeName != null &&
                     ExternalTypeName.Equals(other.ExternalTypeName)
                 ) &&
                 (
                     OptionSetType == other.OptionSetType ||
                     OptionSetType != null &&
                     OptionSetType.Equals(other.OptionSetType)
                 ) &&
                 (
                     IntroducedVersion == other.IntroducedVersion ||
                     IntroducedVersion != null &&
                     IntroducedVersion.Equals(other.IntroducedVersion)
                 ) &&
                 (
                     MetadataId == other.MetadataId ||
                     MetadataId != null &&
                     MetadataId.Equals(other.MetadataId)
                 ) &&
                 (
                     HasChanged == other.HasChanged ||
                     HasChanged != null &&
                     HasChanged.Equals(other.HasChanged)
                 ) &&
                 (
                     Options == other.Options ||
                     Options != null &&
                     Options.SequenceEqual(other.Options)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     DisplayName == other.DisplayName ||
                     DisplayName != null &&
                     DisplayName.Equals(other.DisplayName)
                 ) &&
                 (
                     IsCustomizable == other.IsCustomizable ||
                     IsCustomizable != null &&
                     IsCustomizable.Equals(other.IsCustomizable)
                 ));
        }
Exemple #6
0
        public void WriteInfoToFile(string fullPath)
        {
            XmlDocument doc = new XmlDocument();

            doc.AppendChild(doc.CreateXmlDeclaration("1.0", "utf-8", null));
            XmlElement root = doc.CreateElement("scriptinfo");

            XmlElement settings = doc.CreateElement("settings");

            settings.SetAttribute("global", IsGlobal.ToString());
            settings.SetAttribute("successfully", (SF.ReadingState != ReadingState.Error).ToString());
            settings.SetAttribute("compiled", IsCompiled.ToString());

            XmlElement name = doc.CreateElement("name");

            name.InnerText = Name;
            settings.AppendChild(name);

            root.AppendChild(settings);

            XmlElement content = doc.CreateElement("content");

            if (SF.ReadingState != ReadingState.Error)
            {
                foreach (IncludeInfo inc in Includes)
                {
                    XmlElement include = doc.CreateElement("include");
                    include.InnerText = inc.SFPath;
                    content.AppendChild(include);
                }

                foreach (UsingInfo curUsing in Usings)
                {
                    XmlElement usingElem = doc.CreateElement("using");
                    usingElem.SetAttribute("name", curUsing.Name);
                    usingElem.SetAttribute("access", curUsing.Access.ToString());

                    XmlElement sfPath = doc.CreateElement("sfPath");
                    sfPath.InnerText = curUsing.SFPath;
                    usingElem.AppendChild(sfPath);

                    content.AppendChild(usingElem);
                }

                foreach (ConstInfo constant in Constants)
                {
                    XmlElement constElem = doc.CreateElement("const");
                    constElem.SetAttribute("name", constant.Name);
                    constElem.SetAttribute("access", constant.Access.ToString());
                    constElem.SetAttribute("sealed", constant.Sealed.ToString());

                    XmlElement summary = doc.CreateElement("summary");
                    summary.InnerText = constant.Summary;
                    constElem.AppendChild(summary);

                    XmlElement value = doc.CreateElement("value");
                    value = constant.Value.ToXML(doc, value, this);
                    constElem.AppendChild(value);

                    content.AppendChild(constElem);
                }

                foreach (FuncInfo func in Functions)
                {
                    XmlElement funcElem = doc.CreateElement("func");
                    funcElem.SetAttribute("name", func.Name);
                    funcElem.SetAttribute("access", func.Access.ToString());

                    XmlElement self = doc.CreateElement("self");
                    self.InnerText = func.Self;
                    funcElem.AppendChild(self);

                    XmlElement summary = doc.CreateElement("summary");
                    summary.InnerText = func.Summary;
                    funcElem.AppendChild(summary);

                    XmlElement returns = doc.CreateElement("returns");
                    returns.InnerText = func.Returns;
                    funcElem.AppendChild(returns);

                    XmlElement example = doc.CreateElement("example");
                    example.InnerText = func.Example;
                    funcElem.AppendChild(example);

                    foreach (FuncParamInfo param in func.Parameters)
                    {
                        XmlElement paramElem = doc.CreateElement("param");
                        paramElem.SetAttribute("name", param.Name);

                        if (param.IsOpt)
                        {
                            paramElem.SetAttribute("opt", param.IsOpt.ToString());
                        }

                        paramElem.InnerText = param.Summary;
                        funcElem.AppendChild(paramElem);
                    }

                    content.AppendChild(funcElem);
                }

                foreach (IReferenceInfo refInfo in References)
                {
                    content.AppendChild(refInfo.ToXML(doc));
                }
            }

            foreach (Error error in SF.Errors)
            {
                content.AppendChild(error.ToXML(doc));
            }

            root.AppendChild(content);

            doc.AppendChild(root);
            Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
            doc.Save(fullPath);
        }