Exemplo n.º 1
0
        internal string ConstructFileName(OrderData order)
        {
            StylePathData pathData = ((config.paths[order.itemCode].mirrorStyle == "") ?
                                      config.paths[order.itemCode] : config.paths[config.paths[order.itemCode].mirrorStyle]);
            string fileName = "";

            for (int i = 0; i != pathData.wordOrder.Length; ++i)
            {
                if (pathData.wordOrder[i] > 0)
                {
                    switch (pathData.wordOrder[i])
                    {
                    case 1:
                        fileName += order.word1 + '-';
                        break;

                    case 2:
                        fileName += order.word2 + '-';
                        break;

                    case 3:
                        fileName += order.word3 + '-';
                        break;

                    case 4:
                        fileName += order.word4 + '-';
                        break;
                    }
                }
            }

            fileName = fileName.TrimEnd('-');
            return(fileName != "" ? fileName.ToUpper() : order.name.ToUpper());
        }
Exemplo n.º 2
0
        internal void InsertPath(StylePathData path)
        {
            path.style = path.style.Replace(" ", String.Empty);

            if (paths.ContainsKey(path.style))
            {
                ErrorHandler.HandleError(ErrorType.Log, $"Config already contains stylePath.  path: {path.style}");
                return;
            }

            path.wordOrder   = path.wordOrder != null ? path.wordOrder : new int[] { 1, 2, 3, 4 };
            path.mirrorStyle = path.mirrorStyle.Replace(" ", String.Empty);

            paths.Add(path.style, path);
        }