Fix compiler warnings
This commit is contained in:
		
							parent
							
								
									1473bb693f
								
							
						
					
					
						commit
						bbf7d357ef
					
				| 
						 | 
				
			
			@ -7,7 +7,6 @@ namespace Ooui
 | 
			
		|||
{
 | 
			
		||||
    public class Button : FormControl
 | 
			
		||||
    {
 | 
			
		||||
        ButtonType typ = ButtonType.Submit;
 | 
			
		||||
        public ButtonType Type {
 | 
			
		||||
            get => GetAttribute ("type", ButtonType.Submit);
 | 
			
		||||
            set => SetAttributeProperty ("type", value);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,6 @@ namespace Ooui
 | 
			
		|||
            set => SetAttributeProperty ("title", value);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        bool hidden = false;
 | 
			
		||||
        public bool IsHidden {
 | 
			
		||||
            get => GetBooleanAttribute ("hidden");
 | 
			
		||||
            set => SetBooleanAttributeProperty ("hidden", value);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,6 @@ namespace Ooui
 | 
			
		|||
{
 | 
			
		||||
    public class Form : Element
 | 
			
		||||
    {
 | 
			
		||||
        string action = "";
 | 
			
		||||
        public string Action {
 | 
			
		||||
            get => GetStringAttribute ("action", "");
 | 
			
		||||
            set => SetAttributeProperty ("action", value ?? "");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,7 +9,6 @@ namespace Ooui
 | 
			
		|||
            set => SetAttributeProperty ("name", value);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        bool isDisabled = false;
 | 
			
		||||
        public bool IsDisabled {
 | 
			
		||||
            get => GetBooleanAttribute ("disabled");
 | 
			
		||||
            set => SetBooleanAttributeProperty ("disabled", value);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,6 +9,7 @@
 | 
			
		|||
    <PackageLicenseUrl>https://github.com/praeclarum/Ooui/blob/master/LICENSE</PackageLicenseUrl>
 | 
			
		||||
    <RepositoryUrl>https://github.com/praeclarum/Ooui.git</RepositoryUrl>
 | 
			
		||||
    <TargetFrameworks>netstandard2.0</TargetFrameworks>
 | 
			
		||||
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,6 @@ namespace Ooui
 | 
			
		|||
            set => SetAttributeProperty ("rows", value);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        int cols = 20;
 | 
			
		||||
        public int Columns {
 | 
			
		||||
            get => GetAttribute ("cols", 20);
 | 
			
		||||
            set => SetAttributeProperty ("cols", value);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -115,50 +115,6 @@ namespace Ooui
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        void QueueStateMessagesLocked (EventTarget target)
 | 
			
		||||
        {
 | 
			
		||||
            if (target == null) return;
 | 
			
		||||
            var created = false;
 | 
			
		||||
            foreach (var m in target.StateMessages) {
 | 
			
		||||
                if (m.MessageType == MessageType.Create) {
 | 
			
		||||
                    createdIds.Add (m.TargetId);
 | 
			
		||||
                    created = true;
 | 
			
		||||
                }
 | 
			
		||||
                if (created) {
 | 
			
		||||
                    QueueMessageLocked (m);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        void QueueMessageLocked (Message message)
 | 
			
		||||
        {
 | 
			
		||||
            //
 | 
			
		||||
            // Make sure all the referenced objects have been created
 | 
			
		||||
            //
 | 
			
		||||
            if (!createdIds.Contains (message.TargetId)) {
 | 
			
		||||
                QueueStateMessagesLocked (element.GetElementById (message.TargetId));
 | 
			
		||||
            }
 | 
			
		||||
            if (message.Value is EventTarget ve) {
 | 
			
		||||
                if (!createdIds.Contains (ve.Id)) {
 | 
			
		||||
                    QueueStateMessagesLocked (ve);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            else if (message.Value is Array a) {
 | 
			
		||||
                for (var i = 0; i < a.Length; i++) {
 | 
			
		||||
                    // Console.WriteLine ($"A{i} = {a.GetValue(i)}");
 | 
			
		||||
                    if (a.GetValue (i) is EventTarget e && !createdIds.Contains (e.Id)) {
 | 
			
		||||
                        QueueStateMessagesLocked (e);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //
 | 
			
		||||
            // Add it to the queue
 | 
			
		||||
            //
 | 
			
		||||
            //Console.WriteLine ($"QM {message.MessageType} {message.TargetId} {message.Key} {message.Value}");
 | 
			
		||||
            queuedMessages.Add (message);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        protected override void QueueMessage (Message message)
 | 
			
		||||
        {
 | 
			
		||||
            base.QueueMessage (message);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue