public void Select(string tablename, string fieldName, string alias)
 {
     if (string.IsNullOrEmpty(alias) || fieldName == alias)
     {
         Select(tablename, fieldName);
     }
     else
     {
         SelectionList.Add($"{ Adapter.Field(tablename, fieldName) } { Adapter.Alias(alias) }");
     }
 }
 public void SelectConcatSql(string tableName, string fieldName, string alias, IEnumerable <string> values)
 {
     if (string.IsNullOrEmpty(alias) || fieldName == alias)
     {
         SelectionList.Add($"{ Adapter.Concat() }({ Adapter.Field(tableName, fieldName) }, { string.Join(", ", values) }) { Adapter.Alias(fieldName) }");
     }
     else
     {
         SelectionList.Add($"{ Adapter.Concat() }({ Adapter.Field(tableName, fieldName) }, { string.Join(", ", values) }) { Adapter.Alias(alias) }");
     }
 }
 public void SelectIsNull(string tableName, string fieldName, string alias, object nullValue)
 {
     if (string.IsNullOrEmpty(alias) || fieldName == alias)
     {
         SelectionList.Add($"{ Adapter.IsNull() }({ Adapter.Field(tableName, fieldName) }, { nullValue.SafeValue(Adapter.CurrentDate()) }) { Adapter.Alias(fieldName) }");
     }
     else
     {
         SelectionList.Add($"{ Adapter.IsNull() }({ Adapter.Field(tableName, fieldName) }, { nullValue.SafeValue(Adapter.CurrentDate()) }) { Adapter.Alias(alias) }");
     }
 }
 public void SelectIsNull(string tableName, string fieldName, string alias, string nullValue, string nullTableName)
 {
     if (string.IsNullOrEmpty(alias) || fieldName == alias)
     {
         SelectionList.Add($"{ Adapter.IsNull() }({ Adapter.Field(tableName, fieldName) }, { Adapter.Field(nullTableName, nullValue) }) { Adapter.Alias(fieldName) }");
     }
     else
     {
         SelectionList.Add($"{ Adapter.IsNull() }({ Adapter.Field(tableName, fieldName) }, { Adapter.Field(nullTableName, nullValue) }) { Adapter.Alias(alias) }");
     }
 }
 public void SelectFormat(string tableName, string fieldName, string alias, string format)
 {
     if (string.IsNullOrEmpty(alias) || fieldName == alias)
     {
         SelectionList.Add($"{ Adapter.Format() }({ Adapter.Field(tableName, fieldName) }, '{ format }') { Adapter.Alias(fieldName) }");
     }
     else
     {
         SelectionList.Add($"{ Adapter.Format() }({ Adapter.Field(tableName, fieldName) }, '{ format }') { Adapter.Alias(alias) }");
     }
 }
 public void Select(string tableName, string fieldName, string alias, SelectFunction selectFunction)
 {
     if (string.IsNullOrEmpty(alias) || fieldName == alias)
     {
         Select(tableName, fieldName, selectFunction);
     }
     else
     {
         var selectionString = $"{selectFunction}({Adapter.Field(tableName, fieldName)}) {Adapter.Alias(alias)}";
         SelectionList.Add(selectionString);
     }
 }
示例#7
0
 /// <summary>
 ///     Selecciona una sola primitiva pero antes se fija si ya no estaba en la lista de seleccion.
 ///     Si ya estaba, entonces la quita de la lista de seleccion
 /// </summary>
 private void selectOrRemovePrimitiveIfPresent(EditPolyPrimitive p)
 {
     //Ya existe, quitar
     if (SelectionList.Contains(p))
     {
         p.Selected = false;
         SelectionList.Remove(p);
     }
     //No existe, agregar
     else
     {
         p.Selected = true;
         SelectionList.Add(p);
     }
 }
 void AddToSelectionList(Type ty, DeviceInformationCollection collection)
 {
     if (SelectionList == null)
     {
         SelectionList = new ObservableCollection <SelectDeviceClass>();
     }
     if (collection != null)
     {
         foreach (DeviceInformation di in collection)
         {
             SelectDeviceClass sdc = new SelectDeviceClass();
             sdc.DeviceClass = ty;
             sdc.DeviceName  = di.Name;
             sdc.DeviceId    = di.Id;
             SelectionList.Add(sdc);
         }
     }
 }
示例#9
0
        public void FocusOn(EventFrame frame, EventNode node)
        {
            Group = frame.Group;
            SelectionList.Clear();
            SelectionList.Add(new Selection()
            {
                Frame = frame, Node = node
            });

            Interval interval = scroll.TimeToUnit(node != null ? (IDurable)node.Entry : (IDurable)frame);

            if (!scroll.ViewUnit.Intersect(interval))
            {
                scroll.ViewUnit.Width = interval.Width * DefaultFrameZoom;
                scroll.ViewUnit.Left  = interval.Left - (scroll.ViewUnit.Width - interval.Width) * 0.5;
                scroll.ViewUnit.Normalize();
                UpdateBar();
            }

            UpdateSurface();
        }
 public void Select(string tableName, string fieldName)
 {
     SelectionList.Add(Adapter.Field(tableName, fieldName));
 }
        public void Select(string tableName)
        {
            var selectionString = $"{Adapter.Table(tableName)}.*";

            SelectionList.Add(selectionString);
        }
        public void Select(SelectFunction selectFunction)
        {
            var selectionString = $"{selectFunction}(*)";

            SelectionList.Add(selectionString);
        }
        public void Select(string tableName, string fieldName, SelectFunction selectFunction)
        {
            var selectionString = $"{selectFunction}({Adapter.Field(tableName, fieldName)})";

            SelectionList.Add(selectionString);
        }
        public SelectionList ConvertToObject(string tradedVolumeData)
        {
            if (tradedVolumeData == null)
            {
                return(null);
            }
            //Step 1 - Create the response object
            var runnerList = new SelectionList();

            //Step 2 - Split the runners out
            var runnerStringArray = tradedVolumeData.Split(":".ToCharArray());

            //Step 3 - Loop through each runner
            for (var x = 0; x < runnerStringArray.Length; x++)
            {
                //Check that the array is not empty
                if (runnerStringArray[x].Length > 0)
                {
                    //Create the runner object
                    var runner = new Selection();

                    //Step 4 - Split out the runner object items
                    var tradedVolumeStringArray = runnerStringArray[x].Split("|".ToCharArray());

                    //Step 5 - Check that the array is equal or greater than 1
                    if (tradedVolumeStringArray.Length > 1)
                    {
                        //Step 6 - Populate the runner data
                        var runnerInfoStringArray = tradedVolumeStringArray[0].Split(("~").ToCharArray());

                        runner.selectionId   = Convert.ToInt32(runnerInfoStringArray[0]);
                        runner.asianLineId   = Convert.ToInt32(runnerInfoStringArray[1]);
                        runner.actualSPPrice = Convert.ToDouble(runnerInfoStringArray[2]);
                        //runner.totalBSPBackMatchedAmount = runnerInfoStringArray[3];
                        //runner.totalBSPLiabilityMatchedAmount = runnerInfoStringArray[4];

                        //Step 7 - Get all the traded increments
                        for (var count = 1; count < tradedVolumeStringArray.Length; count++)
                        {
                            if (!tradedVolumeStringArray[count].Contains("~"))
                            {
                                continue;
                            }
                            var traded = new TradedVolume();
                            var runnerPricesStringArray =
                                tradedVolumeStringArray[count].Split(("~").ToCharArray());

                            traded.odds = Convert.ToDouble(runnerPricesStringArray[0]);
                            traded.totalMatchedAmount = Convert.ToDouble(runnerPricesStringArray[1]);
                            runner.tradedVolume.Add(traded);
                        }

                        //Step 8 - Sort the list items
                        runner.tradedVolume.Sort(new TradedVolumeDepthComparer());
                    }

                    runnerList.Add(runner);
                }
            }

            //Step 9 - Done
            return(runnerList);
        }
示例#15
0
 /// <summary>
 ///     Seleccionar una sola primitiva
 /// </summary>
 private void selectPrimitive(EditPolyPrimitive p)
 {
     p.Selected = true;
     SelectionList.Add(p);
 }