Beispiel #1
0
        /// <summary>Initializes a new instance of the TreeNode class.</summary>
        protected TreeNode(
            System.UInt32 identity,
            System.String caption,
            System.String filePath,
            System.Boolean visible,
            System.Collections.Immutable.ImmutableHashSet <System.String> attributes,
            System.Collections.Immutable.ImmutableList <TreeNode> children,
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <TreeNode, System.UInt32> > > lookupTable = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <TreeNode, System.UInt32> > >),
            ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
        {
            this.identity   = identity;
            this.caption    = caption;
            this.filePath   = filePath;
            this.visible    = visible;
            this.attributes = attributes;
            this.children   = children;
            if (!skipValidation.Value)
            {
                this.Validate();
            }
            var lookupTableInitResult = RecursiveTypeExtensions.LookupTable <TreeNode, TreeNode> .Initialize(this, lookupTable);

            this.lookupTable      = lookupTableInitResult.LookupTable;
            this.inefficiencyLoad = lookupTableInitResult.InefficiencyLoad;
        }
Beispiel #2
0
        /// <summary>Returns a new instance with the To property set to the specified value.</summary>
        public Message WithTo(System.Collections.Immutable.ImmutableList <Contact> value)
        {
            if (value == this.To)
            {
                return(this);
            }

            return(this.With(to: value));
        }
        /// <summary>Returns a new instance with the Children property set to the specified value.</summary>
        public XmlElement WithChildren(System.Collections.Immutable.ImmutableList <XmlNode> value)
        {
            if (value == this.Children)
            {
                return(this);
            }

            return(this.With(children: value));
        }
Beispiel #4
0
        /// <summary>Returns a new instance with the Bcc property set to the specified value.</summary>
        public Message WithBcc(System.Collections.Immutable.ImmutableList <Contact> value)
        {
            if (value == this.Bcc)
            {
                return(this);
            }

            return(this.With(bcc: value));
        }
Beispiel #5
0
        /// <summary>Returns a new instance with the Cc property set to the specified value.</summary>
        public Message WithCc(System.Collections.Immutable.ImmutableList <Contact> value)
        {
            if (value == this.Cc)
            {
                return(this);
            }

            return(this.With(cc: Optional.For(value)));
        }
Beispiel #6
0
        /// <summary>Returns a new instance with the Children property set to the specified value.</summary>
        public TreeNode WithChildren(System.Collections.Immutable.ImmutableList <TreeNode> value)
        {
            if (value == this.Children)
            {
                return(this);
            }

            return(this.With(children: value));
        }
 /// <summary>Initializes a new instance of the XmlElement class.</summary>
 protected XmlElement(
     System.String localName,
     System.String namespaceName,
     System.Collections.Immutable.ImmutableList <XmlNode> children)
     : base(
         localName: localName)
 {
     this.namespaceName = namespaceName;
     this.children      = children;
     this.Validate();
 }
 /// <summary>Initializes a new instance of the XmlElementWithContent class.</summary>
 protected XmlElementWithContent(
     System.String localName,
     System.String namespaceName,
     System.Collections.Immutable.ImmutableList <XmlNode> children,
     System.String content)
     : base(
         localName: localName,
         namespaceName: namespaceName,
         children: children)
 {
     this.content = content;
     this.Validate();
 }
Beispiel #9
0
 /// <summary>Initializes a new instance of the ContainerOfNonRecursiveCollection class.</summary>
 protected ContainerOfNonRecursiveCollection(
     System.UInt32 identity,
     System.Collections.Immutable.ImmutableList <NonRecursiveElement> metadata,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity)
 {
     this.metadata = metadata;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
Beispiel #10
0
        /// <summary>Initializes a new instance of the RecursiveContainer class.</summary>
        protected RecursiveContainer(
            System.UInt32 identity,
            System.Collections.Immutable.ImmutableList <RootRecursive> children,
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <RootRecursive, System.UInt32> > > lookupTable = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <RootRecursive, System.UInt32> > >),
            ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
            : base(
                identity: identity)
        {
            this.children = children;
            var lookupTableInitResult = RecursiveTypeExtensions.LookupTable <RootRecursive, RecursiveContainer> .Initialize(this, lookupTable);

            this.lookupTable      = lookupTableInitResult.LookupTable;
            this.inefficiencyLoad = lookupTableInitResult.InefficiencyLoad;
        }
Beispiel #11
0
 /// <summary>Initializes a new instance of the TreeNode class.</summary>
 protected TreeNode(
     System.String caption,
     System.String filePath,
     System.Boolean visible,
     System.Collections.Immutable.ImmutableHashSet <System.String> attributes,
     System.Collections.Immutable.ImmutableList <TreeNode> children)
     : base()
 {
     this.caption    = caption;
     this.filePath   = filePath;
     this.visible    = visible;
     this.attributes = attributes;
     this.children   = children;
     this.Validate();
 }
        protected override void Write(System.Collections.Immutable.ImmutableList <Parser.Packet> packets)
        {
            Writable = false;
            foreach (var packet in packets)
            {
                Parser.Parser.EncodePacket(packet, new WriteEncodeCallback(this));
            }

            // fake drain
            // defer to next tick to allow Socket to clear writeBuffer
            //EasyTimer.SetTimeout(() =>
            //{
            Writable = true;
            Emit(EVENT_DRAIN);
            //}, 1);
        }
Beispiel #13
0
        /// <exception cref="UserCodeContainsErrors"></exception>
        public Project Parse(System.Collections.Immutable.ImmutableList <UxFileContents> documents, IMarkupErrorLog reporter)
        {
            const string restartSuggestion = "Restarting Fuse might be required for changes in Uno code to take effect";

            try
            {
                var ghostCompiler = _ghostCompilerFactory.CreateGhostCompiler(documents);
                var docs          = Parse(documents, ghostCompiler, reporter);
                return(docs);
            }
            catch (InvalidMarkup e)
            {
                reporter.ReportError(e.File, e.Position.HasValue ? e.Position.Value.Line : 1, e.Message);
                throw;
            }
            catch (CyclicClassHierarchy)
            {
                reporter.ReportError("UX class hierarchy contains cycles");
                throw;
            }
            catch (TypeNotFound e)
            {
                reporter.ReportError(e.File, 1, "Type " + e.TypeName + " not found (" + restartSuggestion + ")");
                throw;
            }
            catch (UnknownBaseClass e)
            {
                reporter.ReportError(e.DeclaringFile, 1, "Unknown base class " + e.BaseClassName + " for class " + e.DeclaredClassName + " (" + restartSuggestion + ")");
                throw;
            }
            catch (UnknownMemberType e)
            {
                reporter.ReportError(e.DeclaringFile, 1, "Unknown type `" + e.TypeName + "` for member `" + e.MemberName + "` in " + e.DeclaringClassName + ".");
                throw;
            }
            catch (TypeNameCollision e)
            {
                reporter.ReportError("Multiple definitions of type `" + e.TypeName + "` in project");
                throw;
            }
            catch (UnknownError e)
            {
                // TODO: this reports an unavidable already reported NRE.. should get rid of that somehow
                reporter.ReportError(e.Message);
                throw;
            }
        }
Beispiel #14
0
 /// <summary>Initializes a new instance of the Message class.</summary>
 protected Message(
     Contact author,
     System.Collections.Immutable.ImmutableList <Contact> to,
     System.Collections.Immutable.ImmutableList <Contact> cc,
     System.Collections.Immutable.ImmutableList <Contact> bcc,
     System.String subject,
     System.String body)
     : base()
 {
     this.author  = author;
     this.to      = to;
     this.cc      = cc;
     this.bcc     = bcc;
     this.subject = subject;
     this.body    = body;
     this.Validate();
 }
Beispiel #15
0
 /// <summary>Initializes a new instance of the Message class.</summary>
 protected Message(
     System.UInt32 identity,
     Contact author,
     System.Collections.Immutable.ImmutableList <Contact> to,
     System.Collections.Immutable.ImmutableList <Contact> cc,
     System.Collections.Immutable.ImmutableList <Contact> bcc,
     System.String subject,
     System.String body,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.author   = author;
     this.to       = to;
     this.cc       = cc;
     this.bcc      = bcc;
     this.subject  = subject;
     this.body     = body;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
 public void SendAllMessages(System.Collections.Immutable.ImmutableList <Message> messages)
 {
     throw new NotImplementedException();
 }
        /// <summary>Initializes a new instance of the Message class.</summary>
        protected Message(
			System.UInt32 identity,
			Contact author,
			System.Collections.Immutable.ImmutableList<Contact> to,
			System.Collections.Immutable.ImmutableList<Contact> cc,
			System.Collections.Immutable.ImmutableList<Contact> bcc,
			System.String subject,
			System.String body,
			ImmutableObjectGraph.Optional<bool> skipValidation = default(ImmutableObjectGraph.Optional<bool>))
        {
            this.identity = identity;
            this.author = author;
            this.to = to;
            this.cc = cc;
            this.bcc = bcc;
            this.subject = subject;
            this.body = body;
            if (!skipValidation.Value) {
                this.Validate();
            }
        }
Beispiel #18
0
 public static System.Collections.Immutable.ImmutableList <T> Replace <T>(System.Collections.Immutable.ImmutableList <T> list, T oldValue, T newValue)
 {
     return(list.Replace(oldValue, newValue));
 }
Beispiel #19
0
 public static System.Collections.Immutable.ImmutableList <T> RemoveRange <T>(System.Collections.Immutable.ImmutableList <T> list, System.Collections.Generic.IEnumerable <T> values)
 {
     return(list.RemoveRange(values));
 }
Beispiel #20
0
 public static System.Collections.Immutable.ImmutableList <T> ResetContents <T>(System.Collections.Immutable.ImmutableList <T> list, System.Collections.Generic.IEnumerable <T> values)
 {
     return(list.SequenceEqual(values) ? list : list.Clear().AddRange(values));
 }
 /// <summary>Returns a new instance with the Children property set to the specified value.</summary>
 public new XmlElementWithContent WithChildren(System.Collections.Immutable.ImmutableList <XmlNode> value)
 {
     return((XmlElementWithContent)base.WithChildren(value));
 }