public virtual void Start(Report Report)
        {
            InitializeRazor();

            _report = Report;

            _filePath = Report.FilePath;
            _displayOrder = Report.DisplayOrder;
            _networkMode = Report.NetworkMode;

            Thread.CurrentThread.CurrentUICulture = Report.Culture;

            bool replaceExisting = Report.ReplaceExisting;

            if (!File.Exists(_filePath))
            {
                replaceExisting = true;
            }

            if (replaceExisting)
            {
                _extentSource = Extent.Source;
            }
            else
            {
                _extentSource = File.ReadAllText(_filePath);
            }

            _extentSource = _extentSource.Replace("<!--%SuiteStartedTime%-->", _report.StartTime.ToString());
        }
        /// <summary>
        /// Initializes the reporting by setting the file-path and test DisplayOrder
        /// </summary>
        /// <param name="FilePath">Path of the file, in .htm or .html format</param>
        /// <param name="ReplaceExisting">Setting to overwrite (true) the existing file or append (false) to it</param>
        /// <param name="DisplayOrder">Determines the order in which your tests will be displayed</param>
        public ExtentReports(string FilePath, bool ReplaceExisting, DisplayOrder DisplayOrder = DisplayOrder.OldestFirst)
        {
            reportInstance = new ReportInstance();
            reportInstance.Initialize(FilePath, ReplaceExisting, DisplayOrder);

            systemInfo = new SystemInfo();
        }
        public ExtentReports(string FilePath, DisplayOrder Order = DisplayOrder.OldestFirst)
        {
            this.FilePath = FilePath;
            this.DisplayOrder = DisplayOrder;

            Attach(new HTMLReporter());
        }
        public ExtentReports(string FilePath, bool ReplaceExisting = true, DisplayOrder Order = DisplayOrder.OldestFirst, NetworkMode NetworkMode = NetworkMode.Online)
        {
            this.FilePath = FilePath;
            this.ReplaceExisting = ReplaceExisting;
            this.DisplayOrder = DisplayOrder;
            this.NetworkMode = NetworkMode;

            Attach(new HTMLReporter());
        }
Exemple #5
0
        /// <summary>
        /// Initializes Extent HTML report
        /// </summary>
        /// 
        /// <param name="FilePath">Path of the file, in .htm or .html format</param>
        /// <param name="Order">
        /// Determines the order in which your tests will be displayed
        /// <list type="bullet">
        ///     <item>
        ///         <description>OldestFirst (default) - oldest test at the top, newest at the end</description>
        ///     </item>
        ///     <item>
        ///         <description>NewestFirst - newest test at the top, oldest at the end</description>
        ///     </item>
        /// </list>
        /// </param>
        public ExtentReports(string FilePath, DisplayOrder Order = DisplayOrder.OldestFirst)
        {
            this.FilePath = FilePath;
            this.DisplayOrder = DisplayOrder;

            var xdoc = XDocument.Parse(Properties.Resources.extent_config);
            LoadConfig(new Configuration(xdoc));

            Attach(new HTMLReporter());
        }
Exemple #6
0
 public int CompareTo(PluginDescriptor other)
 {
     if (DisplayOrder != other.DisplayOrder)
     {
         return(DisplayOrder.CompareTo(other.DisplayOrder));
     }
     else if (FriendlyName != null)
     {
         return(FriendlyName.CompareTo(other.FriendlyName));
     }
     return(0);
 }
 public void DisplayOrderDiscountAdded(DisplayOrder order, DisplayDiscount discount)
 {
     if (websocket != null)
     {
         DisplayOrderDiscountAddedRequestMessage message = new DisplayOrderDiscountAddedRequestMessage();
         DisplayOrderDiscountAdded payload = new DisplayOrderDiscountAdded();
         payload.DisplayDiscount = discount;
         payload.DisplayOrder    = order;
         message.payload         = payload;
         websocket.Send(JsonUtils.serialize(message));
     }
 }
 /// <summary>
 /// Lines the item removed from display order.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="lineItem">The line item.</param>
 public void LineItemRemovedFromDisplayOrder(DisplayOrder order, DisplayLineItem lineItem)
 {
     if (websocket != null)
     {
         LineItemRemovedFromDisplayOrderRequestMessage message = new LineItemRemovedFromDisplayOrderRequestMessage();
         LineItemRemovedFromDisplayOrder payload = new LineItemRemovedFromDisplayOrder();
         payload.DisplayLineItem = lineItem;
         payload.DisplayOrder    = order;
         message.payload         = payload;
         websocket.Send(JsonUtils.serialize(message));
     }
 }
 public void DisplayOrderDelete(DisplayOrder order)
 {
     /*
      * if (websocket != null)
      * {
      *  DisplayOrderDeleteRequestMessage message = new DisplayOrderDeleteRequestMessage();
      *  message.payload = order;
      *  websocket.Send(JsonUtils.serialize(message));
      *  return 0;
      * }
      * return -1;
      */
 }
Exemple #10
0
        public override int CompareTo(object dictionary)
        {
            if (dictionary == null)
            {
                return(1);
            }

            if ((dictionary as Dictionary).ParentID == ParentID)
            {
                return(DisplayOrder.CompareTo((dictionary as Dictionary).DisplayOrder));
            }

            return(ParentID.CompareTo((dictionary as Dictionary).ParentID));
        }
Exemple #11
0
        public override int CompareTo(object module)
        {
            if (module == null)
            {
                return(1);
            }

            if ((module as Module).PriorModule == PriorModule)
            {
                return(DisplayOrder.CompareTo((module as Module).DisplayOrder));
            }

            return(PriorModule.CompareTo((module as Module).PriorModule));
        }
Exemple #12
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 (AlwaysShow != null)
         {
             hashCode = hashCode * 59 + AlwaysShow.GetHashCode();
         }
         if (DisplayOrder != null)
         {
             hashCode = hashCode * 59 + DisplayOrder.GetHashCode();
         }
         if (FormElement != null)
         {
             hashCode = hashCode * 59 + FormElement.GetHashCode();
         }
         if (Label != null)
         {
             hashCode = hashCode * 59 + Label.GetHashCode();
         }
         if (Link != null)
         {
             hashCode = hashCode * 59 + Link.GetHashCode();
         }
         if (Mask != null)
         {
             hashCode = hashCode * 59 + Mask.GetHashCode();
         }
         if (Obfuscate != null)
         {
             hashCode = hashCode * 59 + Obfuscate.GetHashCode();
         }
         if (PlaceholderLabel != null)
         {
             hashCode = hashCode * 59 + PlaceholderLabel.GetHashCode();
         }
         if (PreferredInputType != null)
         {
             hashCode = hashCode * 59 + PreferredInputType.GetHashCode();
         }
         if (Tooltip != null)
         {
             hashCode = hashCode * 59 + Tooltip.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #13
0
 public override string ToString()
 {
     return(String.Format("[{0}] {1} {12} [{2}] {3}-{4} {5}-{6} [{7},{8},{9},{10} {11}] ",
                          Id.ToString().PadLeft(3, ' '), Name, Duration.ToString().PadLeft(3, ' '),
                          EarlyStartDate.ToShortDateString(),
                          EarlyFinishDate.ToShortDateString(),
                          LatestStartDate.ToShortDateString(),
                          LatestFinishDate.ToShortDateString(),
                          EarlyStart.ToString().PadLeft(3, ' '),
                          EarlyFinish.ToString().PadLeft(3, ' '),
                          LatestStart.ToString().PadLeft(3, ' '),
                          LatestFinish.ToString().PadLeft(3, ' '),
                          Slack.ToString().PadLeft(3, ' '),
                          DisplayOrder.ToString().PadLeft(4, ' ')
                          ));
 }
        /// <summary>
        /// Determines whether the specified Object is equal to the current Object.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }


            var other = (VLQuestionColumn)obj;

            //reference types
            if (!Object.Equals(ColumnText, other.ColumnText))
            {
                return(false);
            }
            //value types
            if (!Survey.Equals(other.Survey))
            {
                return(false);
            }
            if (!Question.Equals(other.Question))
            {
                return(false);
            }
            if (!ColumnId.Equals(other.ColumnId))
            {
                return(false);
            }
            if (!DisplayOrder.Equals(other.DisplayOrder))
            {
                return(false);
            }
            if (!AttributeFlags.Equals(other.AttributeFlags))
            {
                return(false);
            }

            return(true);
        }
Exemple #15
0
        public async Task <Response> AddMenuItem(Role clientSideId, string label, DisplayOrder displayOrder)
        {
            try
            {
                var result   = _appDbContext.MenuItemsReponse.FromSql("SQL_SCRIPT").ToList();
                var MenuItem = new MenuItem(0, clientSideId, label, displayOrder);
                await Add(MenuItem);

                return(new Response(Guid.NewGuid().ToString(), true, null));
            }
            catch (Exception ex)
            {
                List <Error> errors = new List <Error>();
                var          error  = new Error("500", ex.Message);
                errors.Add(error);
                return(new Response(Guid.NewGuid().ToString(), true, errors.Select(e => new Error(e.Code, e.Description))));
            }
        }
        /// <summary>
        /// Initializes Extent HTML report
        /// </summary>
        /// 
        /// <param name="FilePath">Path of the file, in .htm or .html format</param>
        /// <param name="Culture">Culture for the report, used as CultureInfo.GetCultureInfo("es-ES")</param>
        /// <param name="Order">
        /// Determines the order in which your tests will be displayed
        /// <list type="bullet">
        ///     <item>
        ///         <description>OldestFirst (default) - oldest test at the top, newest at the end</description>
        ///     </item>
        ///     <item>
        ///         <description>NewestFirst - newest test at the top, oldest at the end</description>
        ///     </item>
        /// </list>
        /// </param>
        public ExtentReports(string FilePath, CultureInfo Culture, bool ReplaceExisting = true, DisplayOrder Order = DisplayOrder.OldestFirst)
        {
            this.FilePath = FilePath;
            this.ReplaceExisting = ReplaceExisting;
            this.DisplayOrder = DisplayOrder;
            this.Culture = Culture == null 
                ? CultureInfo.GetCultureInfo("en") 
                : Culture;

            var xdoc = XDocument.Parse(Properties.Resources.extent_config);
            LoadConfig(new Configuration(xdoc));

            Attach(new HTMLReporter());

            if (!ReplaceExisting && File.Exists(FilePath))
            {
                new TestConverter(this, FilePath).Convert();
            }
        }
Exemple #17
0
 public int CompareTo(Achievement other)
 {
     if (other.DateEarned.HasValue)
     {
         if (DateEarned.HasValue)
         {
             if (DateEarned.Value == other.DateEarned.Value)
             {
                 return(DisplayOrder.CompareTo(other.DisplayOrder));
             }
             return(DateEarned.Value < other.DateEarned.Value ? -1 : 1);
         }
         return(-1);
     }
     else if (DateEarned.HasValue)
     {
         return(1);
     }
     return(DisplayOrder.CompareTo(other.DisplayOrder));
 }
Exemple #18
0
        //Experimenting on displaying orders
        //NOT READY YET
        public static void StartOrder(ICloverConnector cloverConnector)
        {
            cloverConnector.ResetDevice();
            DisplayOrder    o = new DisplayOrder();
            DisplayLineItem l = new DisplayLineItem();
            DisplayPayment  p = new DisplayPayment();

            l.name  = "hello";
            l.price = "1234";
            o.addDisplayLineItem(l);

            o.subtotal = l.price;
            //o.tax = "0";
            o.total    = o.subtotal + o.tax;
            o.currency = "USD";
            o.title    = "My Order";

            p.amount = o.total;
            cloverConnector.ShowDisplayOrder(o);
        }
Exemple #19
0
        private void NewOrder()
        {
            Store.CreateOrder();
            StoreItems.BringToFront();
            StoreDiscounts.BringToFront();

            DisplayOrder       = DisplayFactory.createDisplayOrder();
            DisplayOrder.title = Guid.NewGuid().ToString();
            posLineItemToDisplayLineItem.Clear();

            cloverConnector.ShowWelcomeScreen();
            //cloverConnector.DisplayOrder(DisplayOrder); // want the welcome screen until something is added to the order

            PayButton.Enabled  = true;
            StoreItems.Enabled = true;
            TabControl.Enabled = true;

            RegisterTabs.SelectedIndex = 0;

            UpdateUI();
        }
Exemple #20
0
        internal void Initialize(string FilePath, bool ReplaceExisting, DisplayOrder DisplayOrder)
        {
            this.displayOrder = DisplayOrder;
            this.filePath     = FilePath;

            if (!File.Exists(FilePath))
            {
                ReplaceExisting = true;
            }

            if (extentSource != null)
            {
                return;
            }

            if (ReplaceExisting)
            {
                lock (sourcelock)
                {
                    extentSource = Standard.GetSource();
                }
            }
            else
            {
                lock (sourcelock)
                {
                    extentSource = File.ReadAllText(FilePath);
                }
            }

            runInfo             = new RunInfo();
            runInfo.StartedTime = DateTime.Now;

            categoryList = new AttributeList();
            mediaList    = new MediaList();
        }
        internal void Initialize(string FilePath, bool ReplaceExisting, DisplayOrder DisplayOrder)
        {
            this.displayOrder = DisplayOrder;
            this.filePath = FilePath;

            if (!File.Exists(FilePath))
            {
                ReplaceExisting = true;
            }

            if (extentSource != null)
            {
                return;
            }

            if (ReplaceExisting)
            {
                lock (sourcelock)
                {
                    extentSource = Standard.GetSource();
                }
            }
            else
            {
                lock (sourcelock)
                {
                    extentSource = File.ReadAllText(FilePath);
                }
            }

            runInfo = new RunInfo();
            runInfo.StartedTime = DateTime.Now;

            categoryList = new AttributeList();
            mediaList = new MediaList();
        }
Exemple #22
0
        public async Task <Response> UpdateMenuItem(int id, Role clientSideId, string label, DisplayOrder displayOrder)
        {
            try
            {
                var MenuItem = new MenuItem(id, clientSideId, label, displayOrder);
                await Update(MenuItem);

                return(new Response(Guid.NewGuid().ToString(), true, null));
            }
            catch (Exception ex)
            {
                List <Error> errors = new List <Error>();
                var          error  = new Error("500", ex.Message);
                errors.Add(error);
                return(new Response(Guid.NewGuid().ToString(), true, errors.Select(e => new Error(e.Code, e.Description))));
            }
        }
Exemple #23
0
        /// <summary>
        /// Writes log events to <see cref="T:ExcelDna.Logging.LogDisplay" />.
        /// </summary>
        /// <param name="sinkConfiguration">Logger sink configuration.</param>
        /// <param name="formatter">Controls the rendering of log events into text, for example to log JSON. To
        /// control plain text formatting, use the overload that accepts an output template.</param>
        /// <param name="restrictedToMinimumLevel">The minimum level for
        /// events passed through the sink. Ignored when <paramref name="levelSwitch" /> is specified.</param>
        /// <param name="levelSwitch">A switch allowing the pass-through minimum level
        /// to be changed at runtime.</param>
        /// <param name="displayOrder">The order in which messages are displayed in the log viewer.
        /// The default is <see cref="F:ExcelDna.Logging.NewestLast" />.</param>
        /// <param name="clearLogOnDispose">Calls <see cref="LogDisplay.Clear()" /> when the sink is disposed.
        /// The default is <see langword="false" />.</param>
        /// <returns>Configuration object allowing method chaining.</returns>
        public static LoggerConfiguration ExcelDnaLogDisplay(this LoggerSinkConfiguration sinkConfiguration,
                                                             ITextFormatter formatter, LogEventLevel restrictedToMinimumLevel = LogEventLevel.Verbose,
                                                             LoggingLevelSwitch levelSwitch = null, DisplayOrder displayOrder = DisplayOrder.NewestLast, bool clearLogOnDispose = false)
        {
            if (sinkConfiguration == null)
            {
                throw new ArgumentNullException(nameof(sinkConfiguration));
            }
            if (formatter == null)
            {
                throw new ArgumentNullException(nameof(formatter));
            }

            if (!Enum.IsDefined(typeof(LogEventLevel), restrictedToMinimumLevel))
            {
                throw new InvalidEnumArgumentException(nameof(restrictedToMinimumLevel), (int)restrictedToMinimumLevel,
                                                       typeof(LogEventLevel));
            }

            if (!Enum.IsDefined(typeof(DisplayOrder), displayOrder))
            {
                throw new InvalidEnumArgumentException(nameof(displayOrder), (int)displayOrder, typeof(DisplayOrder));
            }

            return(sinkConfiguration.Sink(new ExcelDnaLogDisplaySink(formatter, displayOrder, clearLogOnDispose), restrictedToMinimumLevel, levelSwitch));
        }
 public void ShowDisplayOrder(DisplayOrder order)
 {
     if (websocket != null)
     {
         DisplayOrderRequestMessage message = new DisplayOrderRequestMessage();
         message.payload = order;
         websocket.Send(JsonUtils.serialize(message));
     }
 }
Exemple #25
0
 public abstract void doOrderUpdate(DisplayOrder order, DisplayOperation operation);
 /// <summary>
 /// Initializes Extent HTML report
 /// </summary>
 /// 
 /// <param name="FilePath">Path of the file, in .htm or .html format</param>
 /// <param name="ReplaceExisting">Setting to overwrite (TRUE) the existing file or append (FALSE) to it</param>
 /// <param name="Order">
 /// Determines the order in which your tests will be displayed
 /// <list type="bullet">
 ///     <item>
 ///         <description>OldestFirst (default) - oldest test at the top, newest at the end</description>
 ///     </item>
 ///     <item>
 ///         <description>NewestFirst - newest test at the top, oldest at the end</description>
 ///     </item>
 /// </list>
 /// </param>
 public ExtentReports(string FilePath, bool ReplaceExisting = true, DisplayOrder Order = DisplayOrder.OldestFirst) 
     : this(FilePath, null, ReplaceExisting, Order) 
 { }
 public void DiscountRemovedFromDisplayOrder(DisplayOrder order, DisplayDiscount discount)
 {
     DiscountRemovedFromDisplayOrder doda = new DiscountRemovedFromDisplayOrder();
     doda.DisplayOrder = order;
     doda.DisplayDiscount = discount;
     Send("/DiscountRemovedFromDisplayOrder", doda);
 }
 public OrderUpdateMessage(DisplayOrder displayOrder)
     : base(Methods.SHOW_ORDER_SCREEN)
 {
     order = JsonUtils.serialize(displayOrder);
 }
 public abstract void doOrderUpdate(DisplayOrder order, DisplayOperation operation);
 public void ShowDisplayOrder(DisplayOrder order)
 {
     Send("/DisplayOrder", order);
 }
 public void RemoveDisplayOrder(DisplayOrder displayOrder)
 {
     ShowWelcomeScreen();
 }
 public void LineItemRemovedFromDisplayOrder(DisplayOrder order, DisplayLineItem lineItem)
 {
     LineItemRemovedFromDisplayOrder dolia = new LineItemRemovedFromDisplayOrder();
     dolia.DisplayOrder = order;
     dolia.DisplayLineItem = lineItem;
     Send("/LineItemRemovedFromDisplayOrder", dolia);
 }
 public void LineItemAddedToDisplayOrder(DisplayOrder order, DisplayLineItem lineItem)
 {
     LineItemAddedToDisplayOrder dolia = new LineItemAddedToDisplayOrder();
     dolia.DisplayOrder = order;
     dolia.DisplayLineItem = lineItem;
     Send("/LineItemAddedToDisplayOrder", dolia);
 }
Exemple #34
0
 public void ShowDisplayOrder(DisplayOrder order)
 {
     Send("/DisplayOrder", order);
 }
 public OrderDTO(DisplayOrder cart, Passenger passenger)
 {
     OrderLines  = cart.OrderLines.Select(ol => new OrderLineDTO(ol)).ToList();
     Passenger   = new PassengerDTO(passenger);
     OrderStatus = cart.OrderStatus;
 }
        /// <summary>
        /// Determines whether the specified Object is equal to the current Object.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }


            var other = (VLQuestionOption)obj;

            //reference types
            if (!Object.Equals(OptionText, other.OptionText))
            {
                return(false);
            }
            if (!Object.Equals(CustomId, other.CustomId))
            {
                return(false);
            }
            if (!Object.Equals(SkipToWebUrl, other.SkipToWebUrl))
            {
                return(false);
            }
            //value types
            if (!Survey.Equals(other.Survey))
            {
                return(false);
            }
            if (!Question.Equals(other.Question))
            {
                return(false);
            }
            if (!OptionId.Equals(other.OptionId))
            {
                return(false);
            }
            if (!OptionType.Equals(other.OptionType))
            {
                return(false);
            }
            if (!DisplayOrder.Equals(other.DisplayOrder))
            {
                return(false);
            }
            if (!OptionValue.Equals(other.OptionValue))
            {
                return(false);
            }
            if (!AttributeFlags.Equals(other.AttributeFlags))
            {
                return(false);
            }
            if (!SkipTo.Equals(other.SkipTo))
            {
                return(false);
            }
            if (!SkipToPage.Equals(other.SkipToPage))
            {
                return(false);
            }
            if (!SkipToQuestion.Equals(other.SkipToQuestion))
            {
                return(false);
            }

            return(true);
        }
 /// <summary>
 /// Initializes Extent HTML report
 /// </summary>
 /// 
 /// <param name="FilePath">Path of the file, in .htm or .html format</param>
 /// <param name="Order">
 /// Determines the order in which your tests will be displayed
 /// <list type="bullet">
 ///     <item>
 ///         <description>OldestFirst (default) - oldest test at the top, newest at the end</description>
 ///     </item>
 ///     <item>
 ///         <description>NewestFirst - newest test at the top, oldest at the end</description>
 ///     </item>
 /// </list>
 /// </param>
 public ExtentReports(string FilePath, DisplayOrder Order)
     : this(FilePath, null, true, Order)
 { }
 public OrderUpdateMessage(DisplayOrder displayOrder)
     : base(Methods.SHOW_ORDER_SCREEN)
 {
     this.order = JsonUtils.serialize(displayOrder);
     //System.Console.WriteLine("Serialized Order:" + this.order );
 }
 public void DiscountAddedToDisplayOrder(DisplayOrder order, DisplayDiscount discount)
 {
     DiscountAddedToDisplayOrder doda = new DiscountAddedToDisplayOrder();
     doda.DisplayOrder = order;
     doda.DisplayDiscount = discount;
     Send("/DiscountAddedToDisplayOrder", doda);
 }
Exemple #40
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ASecondViewModel"/> class.
 /// </summary>
 public ASecondViewModel()
 {
     DisplayName = DisplayOrder.ToString();
 }
        private void NewOrder()
        {
            foreach (POSOrder order in Store.Orders) //any pending orders will be removed when creating a new one
            {
                if (order.Status == POSOrder.OrderStatus.PENDING)
                {
                    UnsubscribeToOrderChanges(order);
                }
            }
            Store.CreateOrder();
            SubscribeToOrderChanges(Store.CurrentOrder);
            StoreItems.BringToFront();
            StoreDiscounts.BringToFront();

            DisplayOrder = DisplayFactory.createDisplayOrder();
            DisplayOrder.title = Guid.NewGuid().ToString();
            posLineItemToDisplayLineItem.Clear();

            StoreItems.Enabled = true;
            TabControl.Enabled = true;

            RegisterTabs.SelectedIndex = 0;
            TabControl.SelectedIndex = 0;
            if (Connected)
            {
                cloverConnector.ShowWelcomeScreen(); //This will make sure that the customer sees a
            }                                        //Welcome screen anytime a new order is initiated.
        }
Exemple #42
0
        public CollectionInputGraphicViewModel(string name)
        {
            _magicDatabase          = MagicDatabaseManager.ReadAndWriteCardInCollection;
            _magicDatabaseForOption = MagicDatabaseManager.ReadAndWriteOption;

            IOption option = _magicDatabaseForOption.GetOption(TypeOfOption.Input, "Language");

            if (option != null)
            {
                int id;
                if (int.TryParse(option.Value, out id))
                {
                    _inputLanguage = _magicDatabase.GetLanguage(id);
                }
            }
            option = _magicDatabaseForOption.GetOption(TypeOfOption.Input, "Order");
            if (option != null)
            {
                if (Enum.TryParse(option.Value, out DisplayOrder order))
                {
                    _displayOrder = order;
                }
            }
            option = _magicDatabaseForOption.GetOption(TypeOfOption.Input, "ImageSize");
            if (option != null)
            {
                int size;
                if (int.TryParse(option.Value, out size))
                {
                    _size = size;
                }
            }

            Display.Title              = "Input cards";
            Display.OkCommandLabel     = "Add";
            Display.CancelCommandLabel = "Close";

            _allCardInfos = _magicDatabase.GetAllInfos().ToArray();
            _allLanguages = _magicDatabase.GetAllLanguages().ToArray();

            Editions     = _magicDatabase.GetAllEditionsOrdered();
            _cards       = new RangeObservableCollection <CardCollectionInputGraphicViewModel>();
            Cards        = CollectionViewSource.GetDefaultView(_cards);
            Cards.Filter = ToDisplay;

            Colors        = (ShardColor[])Enum.GetValues(typeof(ShardColor));
            DisplayOrders = (DisplayOrder[])Enum.GetValues(typeof(DisplayOrder));
            Types         = ((CardType[])Enum.GetValues(typeof(CardType))).Where(t => t != CardType.Token).ToArray();

            ObservableCollection <ShardColor> colorsSelected = new ObservableCollection <ShardColor>();

            colorsSelected.CollectionChanged += CollectionChanged;
            ColorsSelected = colorsSelected;
            ObservableCollection <CardType> typesSelected = new ObservableCollection <CardType>();

            typesSelected.CollectionChanged += CollectionChanged;
            TypesSelected = typesSelected;
            ChangeInputLanguageCommand = new RelayCommand(ChangeInputLanguageCommandExecute);
            ResetCommand   = new RelayCommand(ResetCommandExecute);
            CardCollection = _magicDatabase.GetAllCollections().First(cc => cc.Name == name);
            AddLinkedProperty(nameof(InputLanguage), nameof(InputLanguageName));

            RebuildOrder();
        }
 //////////////// Order methods /////////////
 private void OpenOrder_Button_Click(object sender, EventArgs e)
 {
     ListViewItem lvi = OrdersListView.SelectedItems[0];
     if (lvi != null)
     {
         POSOrder selOrder = (POSOrder)lvi.Tag;
         DisplayOrder = DisplayFactory.createDisplayOrder();
         DisplayOrder.title = Guid.NewGuid().ToString();
         posLineItemToDisplayLineItem.Clear();
         Store.CurrentOrder = selOrder;
         uiThread.Send(delegate (object state)
         {
             RegisterTabs.SelectedIndex = 0;
             TabControl.SelectedIndex = 0;
             RebuildOrderOnDevice();
             UpdateOrderUI();
         }, null);
     }
 }
Exemple #44
0
 /// <summary>
 /// Compares the ability to <paramref name="other"/>
 /// </summary>
 /// <param name="other">The other ability</param>
 /// <returns>An integer used for determining sort order</returns>
 public int CompareTo(AbilityBase other)
 {
     return(DisplayOrder.CompareTo(other.DisplayOrder));
 }
        private void NewOrder()
        {
            Store.CreateOrder();
            StoreItems.BringToFront();
            StoreDiscounts.BringToFront();

            DisplayOrder = DisplayFactory.createDisplayOrder();
            DisplayOrder.title = Guid.NewGuid().ToString();
            posLineItemToDisplayLineItem.Clear();

            cloverConnector.ShowWelcomeScreen();
            //cloverConnector.DisplayOrder(DisplayOrder); // want the welcome screen until something is added to the order

            PayButton.Enabled = true;
            StoreItems.Enabled = true;
            TabControl.Enabled = true;

            RegisterTabs.SelectedIndex = 0;

            UpdateUI();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AThirdViewModel"/> class.
 /// </summary>
 public AThirdViewModel()
 {
     DisplayName = DisplayOrder.ToString();
 }
Exemple #47
0
 /// <summary>
 /// Initializes Extent HTML report
 /// </summary>
 ///
 /// <param name="FilePath">Path of the file, in .htm or .html format</param>
 /// <param name="Order">
 /// Determines the order in which your tests will be displayed
 /// <list type="bullet">
 ///     <item>
 ///         <description>OldestFirst (default) - oldest test at the top, newest at the end</description>
 ///     </item>
 ///     <item>
 ///         <description>NewestFirst - newest test at the top, oldest at the end</description>
 ///     </item>
 /// </list>
 /// </param>
 public ExtentReports(string FilePath, DisplayOrder Order)
     : this(FilePath, null, true, Order)
 {
 }
 public void LineItemRemovedFromDisplayOrder(DisplayOrder order, DisplayLineItem lineItem)
 {
     if (websocket != null)
     {
         LineItemRemovedFromDisplayOrderRequestMessage message = new LineItemRemovedFromDisplayOrderRequestMessage();
         LineItemRemovedFromDisplayOrder payload = new LineItemRemovedFromDisplayOrder();
         payload.DisplayLineItem = lineItem;
         payload.DisplayOrder = order;
         message.payload = payload;
         websocket.Send(JsonUtils.serialize(message));
     }
 }
Exemple #49
0
        /// <summary>
        /// Initializes Extent HTML report
        /// </summary>
        ///
        /// <param name="FilePath">Path of the file, in .htm or .html format</param>
        /// <param name="Culture">Culture for the report, used as CultureInfo.GetCultureInfo("es-ES")</param>
        /// <param name="Order">
        /// Determines the order in which your tests will be displayed
        /// <list type="bullet">
        ///     <item>
        ///         <description>OldestFirst (default) - oldest test at the top, newest at the end</description>
        ///     </item>
        ///     <item>
        ///         <description>NewestFirst - newest test at the top, oldest at the end</description>
        ///     </item>
        /// </list>
        /// </param>
        public ExtentReports(string FilePath, CultureInfo Culture, bool ReplaceExisting = true, DisplayOrder Order = DisplayOrder.OldestFirst)
        {
            this.FilePath        = FilePath;
            this.ReplaceExisting = ReplaceExisting;
            this.DisplayOrder    = DisplayOrder;
            this.Culture         = Culture == null
                ? CultureInfo.GetCultureInfo("en")
                : Culture;

            var xdoc = XDocument.Parse(Properties.Resources.extent_config);

            LoadConfig(new Configuration(xdoc));

            Attach(new HTMLReporter());

            if (!ReplaceExisting && File.Exists(FilePath))
            {
                new TestConverter(this, FilePath).Convert();
            }
        }
 public void DiscountRemovedFromDisplayOrder(DisplayOrder order, DisplayDiscount discount)
 {
     if (websocket != null)
     {
         DiscountRemovedFromDisplayOrderRequestMessage message = new DiscountRemovedFromDisplayOrderRequestMessage();
         DiscountRemovedFromDisplayOrder payload = new DiscountRemovedFromDisplayOrder();
         payload.DisplayDiscount = discount;
         payload.DisplayOrder = order;
         message.payload = payload;
         websocket.Send(JsonUtils.serialize(message));
     }
 }
Exemple #51
0
 /// <summary>
 /// Initializes Extent HTML report
 /// </summary>
 ///
 /// <param name="FilePath">Path of the file, in .htm or .html format</param>
 /// <param name="ReplaceExisting">Setting to overwrite (TRUE) the existing file or append (FALSE) to it</param>
 /// <param name="Order">
 /// Determines the order in which your tests will be displayed
 /// <list type="bullet">
 ///     <item>
 ///         <description>OldestFirst (default) - oldest test at the top, newest at the end</description>
 ///     </item>
 ///     <item>
 ///         <description>NewestFirst - newest test at the top, oldest at the end</description>
 ///     </item>
 /// </list>
 /// </param>
 public ExtentReports(string FilePath, bool ReplaceExisting = true, DisplayOrder Order = DisplayOrder.OldestFirst)
     : this(FilePath, null, ReplaceExisting, Order)
 {
 }
        public override void doOrderUpdate(DisplayOrder order, DisplayOperation operation)
        {
            OrderUpdateMessage updateMessage = new OrderUpdateMessage(order);
            updateMessage.setOperation(operation);

            sendObjectMessage(updateMessage);
        }
 public override void doOrderUpdate(DisplayOrder order, DisplayOperation operation)
 {
     // this is blind to the client
 }
Exemple #54
0
 public void RemoveDisplayOrder(DisplayOrder displayOrder)
 {
     ShowWelcomeScreen();
 }
Exemple #55
0
 /// <summary>
 /// Compares this instance with a specified PluginDescriptor object
 /// </summary>
 /// <param name="other">The PluginDescriptor to compare with this instance</param>
 /// <returns>An integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified parameter</returns>
 public int CompareTo(PluginDescriptor other)
 {
     return(DisplayOrder != other.DisplayOrder ? DisplayOrder.CompareTo(other.DisplayOrder) : String.Compare(FriendlyName, other.FriendlyName, StringComparison.Ordinal));
 }