Exemple #1
0
 public override void OnValidateConfig(MessageInfo Errors)
 {
     // Add more validations here
     if (APIKey == "")
     {
         Errors.Add(this, "APIKey", "API Key is blank.");
     }
     if (APISecret == "")
     {
         Errors.Add(this, "APISecret", "API Secret is blank.");
     }
     base.OnValidateConfig(Errors);
 }
Exemple #2
0
        protected override void OnPeforming()
        {
            base.OnPeforming();

            AppointmentInfo appointment = new AppointmentInfo();

            Scheduler.Add(appointment);

            MessageInfo item  = new MessageInfo();
            ShapeLabel  label = new ShapeLabel();

            ShapeLayer layer = new ShapeLayer(label);

            layer.EmphasisEffect.StartTime = 0;
            layer.EmphasisEffect.EndTime   = 8;

            item.Add(layer);
            item.Length = 8;

            appointment.Target   = item;
            appointment.AllDay   = true;
            appointment.Subject  = item.Name;
            appointment.StatusId = 0;
            double length = Convert.ToDouble(item.Length) / 3600;

            appointment.Duration    = TimeSpan.FromHours(length);
            appointment.End         = appointment.Start.AddSeconds(item.Length);
            appointment.Description = item.Type.ToString();
        }
Exemple #3
0
        private void InitializeSendCommand()
        {
            Assembly assembly = typeof(DataTemplateSelector).GetTypeInfo().Assembly;

#if COMMONSB
            SendIcon = ImageSource.FromResource("SampleBrowser.Icons.DataTemplateSelector.SendIcon.png", assembly);
#else
            SendIcon = ImageSource.FromResource("SendIcon.png", assembly);
#endif
            NewText     = "";
            SendCommand = new Command(() =>
            {
                if (!string.IsNullOrWhiteSpace(NewText))
                {
                    MessageInfo.Add(new MessageInfo
                    {
#if COMMONSB
                        OutgoingMessageIndicator = ImageSource.FromResource("SampleBrowser.Icons.DataTemplateSelector.OutgoingIndicatorImage.png", assembly),
#else
                        OutgoingMessageIndicator = ImageSource.FromResource("SampleBrowser.SfListView.Icons.DataTemplateSelector.OutgoingIndicatorImage.png", assembly),
#endif
                        Text         = NewText,
                        TemplateType = TemplateType.OutGoingText,
                        DateTime     = string.Format("{0:HH:mm}", DateTime.Now)
                    });
                    (ListView.LayoutManager as LinearLayout).ScrollToRowIndex(MessageInfo.Count - 1, Syncfusion.ListView.XForms.ScrollToPosition.Start);
                }
                NewText = null;
            });
        }
Exemple #4
0
 public override void OnValidateConfig(MessageInfo Errors)
 {
     if (GroupId == "")
     {
         Errors.Add(this, "GroupId", "GroupId is blank.");
     }
     base.OnValidateConfig(Errors);
 }
Exemple #5
0
 public override void OnValidateConfig(MessageInfo Errors)
 {
     // Do not check template against properties
     if (!IsTemplate())
     {
         if (DeviceId == 0)
         {
             Errors.Add(this, "DeviceId", "Device Id must not be zero.");
         }
         if (SiteId == 0)
         {
             Errors.Add(this, "SiteId", "Site Id must not be zero.");
         }
         if (ChannelId.Id <= 0)
         {
             Errors.Add(this, "ChannelId", "Logger must be linked to a channel.");
         }
     }
     base.OnValidateConfig(Errors);
 }
Exemple #6
0
 public override void OnValidateConfig(MessageInfo Errors)
 {
     // Don't validate templated nodes/devices
     if (!IsTemplate())
     {
         // ToDo - e.g. check ENodeId and DeviceId do not contain /, + or #
         if (ENodeId == "")
         {
             Errors.Add(this, "ENodeId", "Edge Node name must not be blank.");
         }
     }
     base.OnValidateConfig(Errors);
 }