예제 #1
0
        public void Swap(NumberItem item)
        {
            var val = this.Value;

            this.Value = item.Value;
            item.Value = val;
        }
예제 #2
0
        private static void CacheItem(
            int numberingInstanceId,
            ParagraphStateCache cache,
            List <int> vector,
            NumberItem item)
        {
            var targetedIdentationLevel = item.IndentationLevel;
            var currentIndentationLevel = vector.Count - 1;

            if (targetedIdentationLevel <= currentIndentationLevel)
            {
                vector[targetedIdentationLevel]++;
                if (targetedIdentationLevel < currentIndentationLevel)
                {
                    vector.RemoveRange(targetedIdentationLevel + 1, vector.Count - targetedIdentationLevel - 1);
                }
            }
            else
            {
                while (vector.Count <= item.IndentationLevel)
                {
                    vector.Add(0);
                }
            }

            var itemVector = new int[vector.Count];

            vector.CopyTo(itemVector);

            cache.Add(item.Paragraph, new ParagraphState
            {
                Indentations        = itemVector,
                NumberingInstanceId = numberingInstanceId
            });
        }
예제 #3
0
    void OnClickNum(GameObject go)
    {
        NumberItem goItem = go.GetComponent <NumberItem>();

        AudioController.Instance.SoundPlay("active_item");
        OnNumTapped(goItem);
    }
예제 #4
0
 public void ClearSelection()//清除选择状态
 {
     for (int i = 0; i < NumberObjs.Count; ++i)
     {
         NumberItem tempItem = NumberObjs[i].GetComponent <NumberItem>();
         tempItem.SelectedSprite.SetActive(false);
         SelectedNums.Remove(tempItem.Number.ToString());
     }
 }
        public override DataItem LoadFromString(string data, UndoRedoManager undoRedo)
        {
            var item = new NumberItem(this, undoRedo);

            float val = Default;

            float.TryParse(data, out val);
            item.Value = val;

            return(item);
        }
예제 #6
0
        private void _addNumberByOne(string file)
        {
            var numbers  = LocalHelper.GetNumber(file);
            var comparer = new NumberItemComparer();

            foreach (var number in numbers)
            {
                var item = new NumberItem(number);
                //if (NumberList.ToList().Contains<NumberItem>(item, comparer)) continue;
                NumberList.Add(item);
            }
            Message = $"从{file}成功添加{numbers.Count}条号码!";
        }
예제 #7
0
 public void RemoveSelection(string str)
 {
     for (int i = 0; i < NumberObjs.Count; ++i)
     {
         NumberItem tempItem = NumberObjs[i].GetComponent <NumberItem>();
         if (str == tempItem.Number.ToString())
         {
             tempItem.SelectedSprite.SetActive(false);
             SelectedNums.Remove(tempItem.Number.ToString());
             break;
         }
     }
 }
예제 #8
0
 override protected void propertyChanged(Property property)
 {
     base.propertyChanged(property);
     if (property.DeviceName == deviceName)
     {
         if (property.Name == "WHEEL_SLOT")
         {
             NumberItem slot = (NumberItem)property.GetItem("SLOT");
             if (slot != null)
             {
                 if (property.State == Property.States.Busy)
                 {
                     position = -1;
                     Log("Wheel is moving");
                 }
                 else
                 {
                     int count = (int)slot.Max;
                     if (names.Length != count)
                     {
                         Log("Wheel position count " + count);
                         names   = new string[count];
                         offsets = new int[count];
                         for (int i = 0; i < count; i++)
                         {
                             names[i]   = "NAME #" + i;
                             offsets[i] = 0;
                         }
                     }
                     position = (short)(slot.Value - 1);
                     Log("Wheel position is " + position);
                 }
             }
         }
         else if (property.Name == "WHEEL_SLOT_NAME")
         {
             if (property.State == Property.States.Idle || property.State == Property.States.Ok)
             {
                 for (int i = 0; i < names.Length; i++)
                 {
                     TextItem slotName = (TextItem)property.GetItem("SLOT_NAME_" + (i + 1));
                     if (slotName != null)
                     {
                         names[i] = slotName.Value;
                         Log("Wheel slot name " + i + ": " + slotName.Value);
                     }
                 }
             }
         }
     }
 }
        public override DataItem CreateData(UndoRedoManager undoRedo)
        {
            var item = new NumberItem(this, undoRedo);

            item.Value = Default;

            foreach (var att in Attributes)
            {
                var attItem = att.CreateData(undoRedo);
                item.Attributes.Add(attItem);
            }

            return(item);
        }
예제 #10
0
 override protected void PropertyAdded(Property property)
 {
     if (property.DeviceName == deviceName)
     {
         if (property.Name == "CCD_ABORT_EXPOSURE")
         {
             canAbort = true;
         }
         else if (property.Name == "CCD_EXPOSURE")
         {
             NumberItem item = ((NumberItem)property.GetItem("EXPOSURE"));
             minExposure = item.Min;
             maxExposure = item.Max;
         }
         else if (property.Name == "CCD_GAIN")
         {
             NumberItem item = ((NumberItem)property.GetItem("GAIN"));
             hasGain = true;
             minGain = (short)item.Min;
             maxGain = (short)item.Max;
             gain    = (short)item.Value;
         }
         else if (property.Name == "CCD_COOLER")
         {
             hasCooler = true;
             coolerOn  = ((SwitchItem)property.GetItem("ON")).Value;
         }
         else if (property.Name == "CCD_TEMPERATURE")
         {
             canSetTemperature = property.Permission != Property.Permissions.ReadOnly;
             NumberItem item = ((NumberItem)property.GetItem("TEMPERATURE"));
             temperature       = item.Value;
             targetTemperature = item.Target;
         }
         else if (property.Name == "CCD_COOLER_POWER")
         {
             hasCoolerPower = true;
             coolerPower    = ((NumberItem)property.GetItem("POWER")).Value;
         }
         else
         {
             base.PropertyAdded(property);
         }
     }
 }
예제 #11
0
    void FillNumber(GameObject go, int num, int lInx, bool twoNum)
    {
        NumberItem goItem = go.GetComponent <NumberItem>();

        goItem.SelectedSprite.SetActive(false);
        goItem.Number    = num;
        goItem.LineIndex = lInx;
        if (twoNum)
        {
            if (num < 10)
            {
                goItem.numberLabel.text = "0" + num.ToString();
            }
        }
        else
        {
            goItem.numberLabel.text = num.ToString();
        }
    }
예제 #12
0
    public void Clear()
    {
        var transform1 = NumGrid.transform;

        if (transform1.childCount > 1)
        {
            for (int i = 1; i < transform1.childCount; i++)
            {
                Destroy(transform1.GetChild(i).gameObject);
            }
            NumberObj = transform1.GetChild(0).gameObject;
        }
        NumberObjs.Clear();

        NumberItem item = NumberObj.GetComponent <NumberItem>();

        item.bgSprite.spriteName = "selqiuno";
        item.SelectedSprite.GetComponent <UISprite>().spriteName = "selqiu";

        NumGrid.cellWidth = 80;
    }
        // Generates content of pivotTableCacheDefinitionPart1.
        private void GeneratePivotTableCacheDefinitionPart1Content(PivotTableCacheDefinitionPart pivotTableCacheDefinitionPart1)
        {
            PivotCacheDefinition pivotCacheDefinition1 = new PivotCacheDefinition() { Id = "rId1", RefreshedBy = "Author", RefreshedDate = 40905.65532824074D, CreatedVersion = 4, RefreshedVersion = 4, MinRefreshableVersion = 3, RecordCount = (UInt32Value)3U };

            CacheSource cacheSource1 = new CacheSource() { Type = SourceValues.Worksheet };
            WorksheetSource worksheetSource1 = new WorksheetSource() { Reference = "A1:B4", Sheet = "Sheet2" };

            cacheSource1.Append(worksheetSource1);

            CacheFields cacheFields1 = new CacheFields() { Count = (UInt32Value)2U };

            CacheField cacheField1 = new CacheField() { Name = "id", NumberFormatId = (UInt32Value)0U };

            SharedItems sharedItems1 = new SharedItems() { ContainsSemiMixedTypes = false, ContainsString = false, ContainsNumber = true, ContainsInteger = true, MinValue = 1D, MaxValue = 3D, Count = (UInt32Value)3U };
            NumberItem numberItem1 = new NumberItem() { Val = 1D };
            NumberItem numberItem2 = new NumberItem() { Val = 2D };
            NumberItem numberItem3 = new NumberItem() { Val = 3D };

            sharedItems1.Append(numberItem1);
            sharedItems1.Append(numberItem2);
            sharedItems1.Append(numberItem3);

            cacheField1.Append(sharedItems1);

            CacheField cacheField2 = new CacheField() { Name = "score", NumberFormatId = (UInt32Value)0U };
            SharedItems sharedItems2 = new SharedItems() { ContainsSemiMixedTypes = false, ContainsString = false, ContainsNumber = true, ContainsInteger = true, MinValue = 100D, MaxValue = 132D };

            cacheField2.Append(sharedItems2);

            cacheFields1.Append(cacheField1);
            cacheFields1.Append(cacheField2);

            PivotCacheDefinitionExtensionList pivotCacheDefinitionExtensionList1 = new PivotCacheDefinitionExtensionList();

            pivotCacheDefinition1.Append(cacheSource1);
            pivotCacheDefinition1.Append(cacheFields1);
            pivotCacheDefinition1.Append(pivotCacheDefinitionExtensionList1);

            pivotTableCacheDefinitionPart1.PivotCacheDefinition = pivotCacheDefinition1;
        }
        public override DataItem LoadData(XElement element, UndoRedoManager undoRedo)
        {
            var item = new NumberItem(this, undoRedo);

            float val = Default;

            float.TryParse(element.Value, out val);
            item.Value = val;

            if (item.Value < MinValue)
            {
                item.Value = MinValue;
            }
            if (item.Value > MaxValue)
            {
                item.Value = MaxValue;
            }

            foreach (var att in Attributes)
            {
                var      el      = element.Attribute(att.Name);
                DataItem attItem = null;

                if (el != null)
                {
                    attItem = att.LoadData(new XElement(el.Name, el.Value.ToString()), undoRedo);
                }
                else
                {
                    attItem = att.CreateData(undoRedo);
                }
                item.Attributes.Add(attItem);
            }

            return(item);
        }
예제 #15
0
        override protected void PropertyChanged(Property property)
        {
            base.PropertyChanged(property);
            if (property.DeviceName == deviceName)
            {
                if (property.Name == "CCD_INFO")
                {
                    foreach (Item item in property.Items)
                    {
                        NumberItem numberItem = (NumberItem)item;
                        switch (numberItem.Name)
                        {
                        case "WIDTH":
                            ccdWidth   = (int)numberItem.Value;
                            frameLeft  = 0;
                            frameWidth = ccdWidth;
                            break;

                        case "HEIGHT":
                            ccdHeight   = (int)numberItem.Value;
                            frameTop    = 0;
                            frameHeight = ccdHeight;
                            break;

                        case "MAX_HORIZONTAL_BIN":
                            maxHorizontalBin = (short)numberItem.Value;
                            break;

                        case "MAX_VERTICAL_BIN":
                            maxVerticalBin = (short)numberItem.Value;
                            break;

                        case "PIXEL_WIDTH":
                            pixelWidth = numberItem.Value;
                            break;

                        case "PIXEL_HEIGHT":
                            pixelHeight = numberItem.Value;
                            break;

                        case "BITS_PER_PIXEL":
                            bitsPerPixel = (int)numberItem.Value;
                            break;
                        }
                    }
                }
                else if (property.Name == "CCD_BIN")
                {
                    foreach (Item item in property.Items)
                    {
                        NumberItem numberItem = (NumberItem)item;
                        switch (numberItem.Name)
                        {
                        case "HORIZONTAL":
                            horizontalBin = (short)numberItem.Value;
                            break;

                        case "VERTICAL":
                            verticalBin = (short)numberItem.Value;
                            break;
                        }
                    }
                }
                else if (property.Name == "CCD_GAIN")
                {
                    gain = (short)((NumberItem)property.GetItem("GAIN")).Value;
                }
                else if (property.Name == "CCD_COOLER")
                {
                    coolerOn = ((SwitchItem)property.GetItem("ON")).Value;
                }
                else if (property.Name == "CCD_COOLER_POWER")
                {
                    coolerPower = ((NumberItem)property.GetItem("POWER")).Value;
                }
                else if (property.Name == "CCD_TEMPERATURE")
                {
                    NumberItem item = ((NumberItem)property.GetItem("TEMPERATURE"));
                    temperature       = item.Value;
                    targetTemperature = item.Target;
                }
            }
        }
        internal NumberItem ToNumberItem()
        {
            var ni = new NumberItem();

            ni.Val = Val;
            if (Unused != null)
            {
                ni.Unused = Unused.Value;
            }
            if (Calculated != null)
            {
                ni.Calculated = Calculated.Value;
            }
            if ((Caption != null) && (Caption.Length > 0))
            {
                ni.Caption = Caption;
            }
            if (PropertyCount != null)
            {
                ni.PropertyCount = PropertyCount.Value;
            }
            if (FormatIndex != null)
            {
                ni.FormatIndex = FormatIndex.Value;
            }
            if ((BackgroundColor != null) && (BackgroundColor.Length > 0))
            {
                ni.BackgroundColor = new HexBinaryValue(BackgroundColor);
            }
            if ((ForegroundColor != null) && (ForegroundColor.Length > 0))
            {
                ni.ForegroundColor = new HexBinaryValue(ForegroundColor);
            }
            if (Italic)
            {
                ni.Italic = Italic;
            }
            if (Underline)
            {
                ni.Underline = Underline;
            }
            if (Strikethrough)
            {
                ni.Strikethrough = Strikethrough;
            }
            if (Bold)
            {
                ni.Bold = Bold;
            }

            foreach (var tt in Tuples)
            {
                ni.Append(tt.ToTuples());
            }

            foreach (var i in MemberPropertyIndexes)
            {
                if (i != 0)
                {
                    ni.Append(new MemberPropertyIndex {
                        Val = i
                    });
                }
                else
                {
                    ni.Append(new MemberPropertyIndex());
                }
            }

            return(ni);
        }
예제 #17
0
        internal void FromNumberItem(NumberItem ni)
        {
            this.SetAllNull();

            if (ni.Val != null)
            {
                this.Val = ni.Val.Value;
            }
            if (ni.Unused != null)
            {
                this.Unused = ni.Unused.Value;
            }
            if (ni.Calculated != null)
            {
                this.Calculated = ni.Calculated.Value;
            }
            if (ni.Caption != null)
            {
                this.Caption = ni.Caption.Value;
            }
            if (ni.PropertyCount != null)
            {
                this.PropertyCount = ni.PropertyCount.Value;
            }
            if (ni.FormatIndex != null)
            {
                this.FormatIndex = ni.FormatIndex.Value;
            }
            if (ni.BackgroundColor != null)
            {
                this.BackgroundColor = ni.BackgroundColor.Value;
            }
            if (ni.ForegroundColor != null)
            {
                this.ForegroundColor = ni.ForegroundColor.Value;
            }
            if (ni.Italic != null)
            {
                this.Italic = ni.Italic.Value;
            }
            if (ni.Underline != null)
            {
                this.Underline = ni.Underline.Value;
            }
            if (ni.Strikethrough != null)
            {
                this.Strikethrough = ni.Strikethrough.Value;
            }
            if (ni.Bold != null)
            {
                this.Bold = ni.Bold.Value;
            }

            SLTuplesType        tt;
            MemberPropertyIndex mpi;

            using (OpenXmlReader oxr = OpenXmlReader.Create(ni))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Tuples))
                    {
                        tt = new SLTuplesType();
                        tt.FromTuples((Tuples)oxr.LoadCurrentElement());
                        this.Tuples.Add(tt);
                    }
                    else if (oxr.ElementType == typeof(MemberPropertyIndex))
                    {
                        // 0 is the default value.
                        mpi = (MemberPropertyIndex)oxr.LoadCurrentElement();
                        if (mpi.Val != null)
                        {
                            this.MemberPropertyIndexes.Add(mpi.Val.Value);
                        }
                        else
                        {
                            this.MemberPropertyIndexes.Add(0);
                        }
                    }
                }
            }
        }
예제 #18
0
 override protected void PropertyUpdated(Property property)
 {
     base.PropertyUpdated(property);
     if (property.DeviceName == deviceName)
     {
         if (property.Name == "CCD_IMAGE" && property.State == Property.States.Ok)
         {
             BLOBItem blobItem = ((BLOBItem)property.GetItem("IMAGE"));
             if (blobItem != null)
             {
                 Server server = property.Device.Server;
                 String url    = "http://" + server.Host + ":" + server.Port + blobItem.Value;
                 Log("Request" + url);
                 WebRequest  request  = WebRequest.Create(url);
                 WebResponse response = request.GetResponse();
                 Log("Response ContentLength " + response.ContentLength);
                 BinaryReader reader    = new BinaryReader(response.GetResponseStream());
                 int          signature = reader.ReadInt32();
                 frameWidth  = reader.ReadInt32();
                 frameHeight = reader.ReadInt32();
                 if (signature == 0x31574152) // MONO8
                 {
                     bitsPerPixel   = 8;
                     monoImageArray = new int[frameWidth, frameHeight];
                     for (int y = 0; y < frameHeight; y++)
                     {
                         for (int x = 0; x < frameWidth; x++)
                         {
                             monoImageArray[x, y] = reader.ReadByte();
                         }
                     }
                 }
                 else if (signature == 0x32574152) // MONO16
                 {
                     bitsPerPixel   = 16;
                     monoImageArray = new int[frameWidth, frameHeight];
                     for (int y = 0; y < frameHeight; y++)
                     {
                         for (int x = 0; x < frameWidth; x++)
                         {
                             monoImageArray[x, y] = reader.ReadUInt16();
                         }
                     }
                 }
                 else if (signature == 0x33574152) // RGB24
                 {
                     bitsPerPixel  = 24;
                     rgbImageArray = new int[frameWidth, frameHeight, 3];
                     for (int y = 0; y < frameHeight; y++)
                     {
                         for (int x = 0; x < frameWidth; x++)
                         {
                             rgbImageArray[x, y, 0] = reader.ReadByte();
                             rgbImageArray[x, y, 1] = reader.ReadByte();
                             rgbImageArray[x, y, 2] = reader.ReadByte();
                         }
                     }
                 }
                 reader.Close();
                 percentCompleted = 100;
                 cameraImageReady = true;
                 cameraState      = CameraStates.cameraIdle;
             }
         }
         else if (property.Name == "CCD_EXPOSURE")
         {
             NumberItem item = ((NumberItem)property.GetItem("EXPOSURE"));
             if (property.State == Property.States.Ok)
             {
             }
             else if (property.State == Property.States.Busy)
             {
                 cameraState      = CameraStates.cameraExposing;
                 percentCompleted = (short)(100 - 100 * item.Value / item.Target);
             }
             else
             {
                 cameraState      = CameraStates.cameraError;
                 percentCompleted = 0;
             }
         }
     }
 }
예제 #19
0
    void OnNumTapped(NumberItem goItem)
    {
        if (ltySubCfg.type == "longhu") // 龙虎不能复选
        {
            if (goItem.SelectedSprite.activeSelf)
            {
                goItem.SelectedSprite.SetActive(false);
                SelectedNums.Remove(goItem.Numtext);
            }
            else
            {
                for (int i = 0; i < NumberObjs.Count; ++i)
                {
                    NumberItem tempItem = NumberObjs[i].GetComponent <NumberItem>();
                    tempItem.SelectedSprite.SetActive(false);
                    SelectedNums.Remove(tempItem.Numtext);
                }
                goItem.SelectedSprite.SetActive(true);
                SelectedNums.Add(goItem.Numtext);
            }
        }
        else if (ltySubCfg.type == "reXuanDanTuo")
        {
            if (goItem.SelectedSprite.activeSelf)
            {
                goItem.SelectedSprite.SetActive(false);
                SelectedNums.Remove(goItem.Number.ToString());
                dantuolist.Remove(goItem);
            }
            else
            {
                goItem.SelectedSprite.SetActive(true);
                SelectedNums.Add(goItem.Number.ToString());
                dantuolist.Add(goItem);
                if (dantuolist.Count > ltySubCfg.mincnt - 1 && goItem.LineIndex == 0)
                {
                    NumberItem removeitem = dantuolist[0];
                    dantuolist.Remove(removeitem);
                    removeitem.SelectedSprite.SetActive(false);
                    SelectedNums.Remove(removeitem.Number.ToString());
                }
            }
        }
        else
        {
            if (goItem.SelectedSprite.activeSelf)
            {
                goItem.SelectedSprite.SetActive(false);
                SelectedNums.Remove(goItem.Number.ToString());
            }
            else
            {
                goItem.SelectedSprite.SetActive(true);
                SelectedNums.Add(goItem.Number.ToString());
            }
        }

        SelectedNums.Sort();

        if (OnNumClick != null)
        {
            OnNumClick();
        }
        if (ltySubCfg.type == "reXuanDanTuo")
        {
            danTuoClk(goItem.LineIndex, goItem.Number.ToString());
        }
    }
예제 #20
0
        internal NumberItem ToNumberItem()
        {
            NumberItem ni = new NumberItem();

            ni.Val = this.Val;
            if (this.Unused != null)
            {
                ni.Unused = this.Unused.Value;
            }
            if (this.Calculated != null)
            {
                ni.Calculated = this.Calculated.Value;
            }
            if (this.Caption != null && this.Caption.Length > 0)
            {
                ni.Caption = this.Caption;
            }
            if (this.PropertyCount != null)
            {
                ni.PropertyCount = this.PropertyCount.Value;
            }
            if (this.FormatIndex != null)
            {
                ni.FormatIndex = this.FormatIndex.Value;
            }
            if (this.BackgroundColor != null && this.BackgroundColor.Length > 0)
            {
                ni.BackgroundColor = new HexBinaryValue(this.BackgroundColor);
            }
            if (this.ForegroundColor != null && this.ForegroundColor.Length > 0)
            {
                ni.ForegroundColor = new HexBinaryValue(this.ForegroundColor);
            }
            if (this.Italic != false)
            {
                ni.Italic = this.Italic;
            }
            if (this.Underline != false)
            {
                ni.Underline = this.Underline;
            }
            if (this.Strikethrough != false)
            {
                ni.Strikethrough = this.Strikethrough;
            }
            if (this.Bold != false)
            {
                ni.Bold = this.Bold;
            }

            foreach (SLTuplesType tt in this.Tuples)
            {
                ni.Append(tt.ToTuples());
            }

            foreach (int i in this.MemberPropertyIndexes)
            {
                if (i != 0)
                {
                    ni.Append(new MemberPropertyIndex()
                    {
                        Val = i
                    });
                }
                else
                {
                    ni.Append(new MemberPropertyIndex());
                }
            }

            return(ni);
        }
예제 #21
0
 public void Combin(NumberItem item)
 {
     Value += item.Value;
     item.Reset();
 }
예제 #22
0
    void OnFunction(GameObject go)
    {
        AudioController.Instance.SoundPlay("active_item");
        //先清了再选
        for (int i = 0; i < NumberObjs.Count; ++i)
        {
            GameObject NumberObj = NumberObjs[i];
            NumberItem goItem    = NumberObj.GetComponent <NumberItem>();
            {
                goItem.SelectedSprite.SetActive(false);
                SelectedNums.Remove(goItem.Number.ToString());
            }
        }
        int first = NumberObjs[0].GetComponent <NumberItem>().Number;

        switch (go.name)
        {
        case "da":
            for (int i = 0; i < NumberObjs.Count; ++i)
            {
                GameObject NumberObj = NumberObjs[i];
                NumberItem goItem    = NumberObj.GetComponent <NumberItem>();
                if (goItem.Number >= 5 + first)
                {
                    OnNumTapped(goItem);
                }
            }
            break;

        case "xiao":
            for (int i = 0; i < NumberObjs.Count; ++i)
            {
                GameObject NumberObj = NumberObjs[i];
                NumberItem goItem    = NumberObj.GetComponent <NumberItem>();
                if (goItem.Number < 5 + first)
                {
                    OnNumTapped(goItem);
                }
            }
            break;

        case "quan":
            for (int i = 0; i < NumberObjs.Count; ++i)
            {
                GameObject NumberObj = NumberObjs[i];
                NumberItem goItem    = NumberObj.GetComponent <NumberItem>();
                OnNumTapped(goItem);
            }
            break;

        case "dan":
            for (int i = 0; i < NumberObjs.Count; ++i)
            {
                GameObject NumberObj = NumberObjs[i];
                NumberItem goItem    = NumberObj.GetComponent <NumberItem>();
                if (goItem.Number % 2 == 1)
                {
                    OnNumTapped(goItem);
                }
            }
            break;

        case "shuang":
            for (int i = 0; i < NumberObjs.Count; ++i)
            {
                GameObject NumberObj = NumberObjs[i];
                NumberItem goItem    = NumberObj.GetComponent <NumberItem>();
                if (goItem.Number % 2 == 0)
                {
                    OnNumTapped(goItem);
                }
            }
            break;

        case "qing":

            break;
        }
        if (OnNumClick != null)
        {
            OnNumClick();
        }
    }
예제 #23
0
        // Generates content of pivotTableCacheRecordsPart1.
        private void GeneratePivotTableCacheRecordsPart1Content(PivotTableCacheRecordsPart pivotTableCacheRecordsPart1)
        {
            PivotCacheRecords pivotCacheRecords1 = new PivotCacheRecords(){ Count = (UInt32Value)4U };
            pivotCacheRecords1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");

            PivotCacheRecord pivotCacheRecord1 = new PivotCacheRecord();
            FieldItem fieldItem12 = new FieldItem(){ Val = (UInt32Value)0U };
            FieldItem fieldItem13 = new FieldItem(){ Val = (UInt32Value)0U };
            NumberItem numberItem1 = new NumberItem(){ Val = 19D };
            NumberItem numberItem2 = new NumberItem(){ Val = 2375D };
            FieldItem fieldItem14 = new FieldItem(){ Val = (UInt32Value)0U };
            StringItem stringItem30 = new StringItem(){ Val = "sales staff G" };

            pivotCacheRecord1.Append(fieldItem12);
            pivotCacheRecord1.Append(fieldItem13);
            pivotCacheRecord1.Append(numberItem1);
            pivotCacheRecord1.Append(numberItem2);
            pivotCacheRecord1.Append(fieldItem14);
            pivotCacheRecord1.Append(stringItem30);

            PivotCacheRecord pivotCacheRecord2 = new PivotCacheRecord();
            FieldItem fieldItem15 = new FieldItem(){ Val = (UInt32Value)1U };
            FieldItem fieldItem16 = new FieldItem(){ Val = (UInt32Value)1U };
            NumberItem numberItem3 = new NumberItem(){ Val = 13D };
            NumberItem numberItem4 = new NumberItem(){ Val = 15990D };
            FieldItem fieldItem17 = new FieldItem(){ Val = (UInt32Value)1U };
            StringItem stringItem31 = new StringItem(){ Val = "sales staff B" };

            pivotCacheRecord2.Append(fieldItem15);
            pivotCacheRecord2.Append(fieldItem16);
            pivotCacheRecord2.Append(numberItem3);
            pivotCacheRecord2.Append(numberItem4);
            pivotCacheRecord2.Append(fieldItem17);
            pivotCacheRecord2.Append(stringItem31);

            PivotCacheRecord pivotCacheRecord3 = new PivotCacheRecord();
            FieldItem fieldItem18 = new FieldItem(){ Val = (UInt32Value)2U };
            FieldItem fieldItem19 = new FieldItem(){ Val = (UInt32Value)2U };
            NumberItem numberItem5 = new NumberItem(){ Val = 4D };
            NumberItem numberItem6 = new NumberItem(){ Val = 312D };
            FieldItem fieldItem20 = new FieldItem(){ Val = (UInt32Value)2U };
            StringItem stringItem32 = new StringItem(){ Val = "sales staff E" };

            pivotCacheRecord3.Append(fieldItem18);
            pivotCacheRecord3.Append(fieldItem19);
            pivotCacheRecord3.Append(numberItem5);
            pivotCacheRecord3.Append(numberItem6);
            pivotCacheRecord3.Append(fieldItem20);
            pivotCacheRecord3.Append(stringItem32);

            PivotCacheRecord pivotCacheRecord4 = new PivotCacheRecord();
            FieldItem fieldItem21 = new FieldItem(){ Val = (UInt32Value)3U };
            FieldItem fieldItem22 = new FieldItem(){ Val = (UInt32Value)2U };
            NumberItem numberItem7 = new NumberItem(){ Val = 29D };
            NumberItem numberItem8 = new NumberItem(){ Val = 2262D };
            FieldItem fieldItem23 = new FieldItem(){ Val = (UInt32Value)3U };
            StringItem stringItem33 = new StringItem(){ Val = "sales staff E" };

            pivotCacheRecord4.Append(fieldItem21);
            pivotCacheRecord4.Append(fieldItem22);
            pivotCacheRecord4.Append(numberItem7);
            pivotCacheRecord4.Append(numberItem8);
            pivotCacheRecord4.Append(fieldItem23);
            pivotCacheRecord4.Append(stringItem33);

            pivotCacheRecords1.Append(pivotCacheRecord1);
            pivotCacheRecords1.Append(pivotCacheRecord2);
            pivotCacheRecords1.Append(pivotCacheRecord3);
            pivotCacheRecords1.Append(pivotCacheRecord4);

            pivotTableCacheRecordsPart1.PivotCacheRecords = pivotCacheRecords1;
        }
        // Generates content of pivotTableCacheRecordsPart1.
        private void GeneratePivotTableCacheRecordsPart1Content(PivotTableCacheRecordsPart pivotTableCacheRecordsPart1)
        {
            PivotCacheRecords pivotCacheRecords1 = new PivotCacheRecords() { Count = (UInt32Value)3U };

            PivotCacheRecord pivotCacheRecord1 = new PivotCacheRecord();
            FieldItem fieldItem1 = new FieldItem() { Val = (UInt32Value)0U };
            NumberItem numberItem4 = new NumberItem() { Val = 100D };

            pivotCacheRecord1.Append(fieldItem1);
            pivotCacheRecord1.Append(numberItem4);

            PivotCacheRecord pivotCacheRecord2 = new PivotCacheRecord();
            FieldItem fieldItem2 = new FieldItem() { Val = (UInt32Value)1U };
            NumberItem numberItem5 = new NumberItem() { Val = 120D };

            pivotCacheRecord2.Append(fieldItem2);
            pivotCacheRecord2.Append(numberItem5);

            PivotCacheRecord pivotCacheRecord3 = new PivotCacheRecord();
            FieldItem fieldItem3 = new FieldItem() { Val = (UInt32Value)2U };
            NumberItem numberItem6 = new NumberItem() { Val = 132D };

            pivotCacheRecord3.Append(fieldItem3);
            pivotCacheRecord3.Append(numberItem6);

            pivotCacheRecords1.Append(pivotCacheRecord1);
            pivotCacheRecords1.Append(pivotCacheRecord2);
            pivotCacheRecords1.Append(pivotCacheRecord3);

            pivotTableCacheRecordsPart1.PivotCacheRecords = pivotCacheRecords1;
        }
예제 #25
0
	public static void Recycle(NumberItem number)
	{
		if (number != null)
		{
            PopupManager.Instance.RemoveItem(number.gameObject);
		}
		else
		{
			BaseLogger.Log("Recyle a null HPBar!");
		}
	}
예제 #26
0
        // Generates content of pivotTableCacheRecordsPart2.
        private void GeneratePivotTableCacheRecordsPart2Content(PivotTableCacheRecordsPart pivotTableCacheRecordsPart2)
        {
            PivotCacheRecords pivotCacheRecords2 = new PivotCacheRecords(){ Count = (UInt32Value)5U };
            pivotCacheRecords2.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");

            PivotCacheRecord pivotCacheRecord5 = new PivotCacheRecord();
            FieldItem fieldItem26 = new FieldItem(){ Val = (UInt32Value)0U };
            FieldItem fieldItem27 = new FieldItem(){ Val = (UInt32Value)0U };
            NumberItem numberItem9 = new NumberItem(){ Val = 13D };
            NumberItem numberItem10 = new NumberItem(){ Val = 1287D };
            DateTimeItem dateTimeItem14 = new DateTimeItem(){ Val = System.Xml.XmlConvert.ToDateTime("2000-01-02T04:31:50Z", System.Xml.XmlDateTimeSerializationMode.RoundtripKind) };
            StringItem stringItem44 = new StringItem(){ Val = "sales staff H" };

            pivotCacheRecord5.Append(fieldItem26);
            pivotCacheRecord5.Append(fieldItem27);
            pivotCacheRecord5.Append(numberItem9);
            pivotCacheRecord5.Append(numberItem10);
            pivotCacheRecord5.Append(dateTimeItem14);
            pivotCacheRecord5.Append(stringItem44);

            PivotCacheRecord pivotCacheRecord6 = new PivotCacheRecord();
            FieldItem fieldItem28 = new FieldItem(){ Val = (UInt32Value)1U };
            FieldItem fieldItem29 = new FieldItem(){ Val = (UInt32Value)1U };
            NumberItem numberItem11 = new NumberItem(){ Val = 27D };
            NumberItem numberItem12 = new NumberItem(){ Val = 11529D };
            DateTimeItem dateTimeItem15 = new DateTimeItem(){ Val = System.Xml.XmlConvert.ToDateTime("2000-01-04T03:14:24Z", System.Xml.XmlDateTimeSerializationMode.RoundtripKind) };
            StringItem stringItem45 = new StringItem(){ Val = "sales staff I" };

            pivotCacheRecord6.Append(fieldItem28);
            pivotCacheRecord6.Append(fieldItem29);
            pivotCacheRecord6.Append(numberItem11);
            pivotCacheRecord6.Append(numberItem12);
            pivotCacheRecord6.Append(dateTimeItem15);
            pivotCacheRecord6.Append(stringItem45);

            PivotCacheRecord pivotCacheRecord7 = new PivotCacheRecord();
            FieldItem fieldItem30 = new FieldItem(){ Val = (UInt32Value)2U };
            FieldItem fieldItem31 = new FieldItem(){ Val = (UInt32Value)0U };
            NumberItem numberItem13 = new NumberItem(){ Val = 19D };
            NumberItem numberItem14 = new NumberItem(){ Val = 1881D };
            DateTimeItem dateTimeItem16 = new DateTimeItem(){ Val = System.Xml.XmlConvert.ToDateTime("2000-01-03T11:10:19Z", System.Xml.XmlDateTimeSerializationMode.RoundtripKind) };
            StringItem stringItem46 = new StringItem(){ Val = "sales staff J" };

            pivotCacheRecord7.Append(fieldItem30);
            pivotCacheRecord7.Append(fieldItem31);
            pivotCacheRecord7.Append(numberItem13);
            pivotCacheRecord7.Append(numberItem14);
            pivotCacheRecord7.Append(dateTimeItem16);
            pivotCacheRecord7.Append(stringItem46);

            PivotCacheRecord pivotCacheRecord8 = new PivotCacheRecord();
            FieldItem fieldItem32 = new FieldItem(){ Val = (UInt32Value)3U };
            FieldItem fieldItem33 = new FieldItem(){ Val = (UInt32Value)2U };
            NumberItem numberItem15 = new NumberItem(){ Val = 25D };
            NumberItem numberItem16 = new NumberItem(){ Val = 1250D };
            DateTimeItem dateTimeItem17 = new DateTimeItem(){ Val = System.Xml.XmlConvert.ToDateTime("2000-01-02T06:54:09Z", System.Xml.XmlDateTimeSerializationMode.RoundtripKind) };
            StringItem stringItem47 = new StringItem(){ Val = "sales staff B" };

            pivotCacheRecord8.Append(fieldItem32);
            pivotCacheRecord8.Append(fieldItem33);
            pivotCacheRecord8.Append(numberItem15);
            pivotCacheRecord8.Append(numberItem16);
            pivotCacheRecord8.Append(dateTimeItem17);
            pivotCacheRecord8.Append(stringItem47);

            PivotCacheRecord pivotCacheRecord9 = new PivotCacheRecord();
            FieldItem fieldItem34 = new FieldItem(){ Val = (UInt32Value)4U };
            FieldItem fieldItem35 = new FieldItem(){ Val = (UInt32Value)2U };
            NumberItem numberItem17 = new NumberItem(){ Val = 16D };
            NumberItem numberItem18 = new NumberItem(){ Val = 800D };
            DateTimeItem dateTimeItem18 = new DateTimeItem(){ Val = System.Xml.XmlConvert.ToDateTime("2003-01-01T04:01:28Z", System.Xml.XmlDateTimeSerializationMode.RoundtripKind) };
            StringItem stringItem48 = new StringItem(){ Val = "sales staff F" };

            pivotCacheRecord9.Append(fieldItem34);
            pivotCacheRecord9.Append(fieldItem35);
            pivotCacheRecord9.Append(numberItem17);
            pivotCacheRecord9.Append(numberItem18);
            pivotCacheRecord9.Append(dateTimeItem18);
            pivotCacheRecord9.Append(stringItem48);

            pivotCacheRecords2.Append(pivotCacheRecord5);
            pivotCacheRecords2.Append(pivotCacheRecord6);
            pivotCacheRecords2.Append(pivotCacheRecord7);
            pivotCacheRecords2.Append(pivotCacheRecord8);
            pivotCacheRecords2.Append(pivotCacheRecord9);

            pivotTableCacheRecordsPart2.PivotCacheRecords = pivotCacheRecords2;
        }
예제 #27
0
        internal NumberItem ToNumberItem()
        {
            NumberItem ni = new NumberItem();
            ni.Val = this.Val;
            if (this.Unused != null) ni.Unused = this.Unused.Value;
            if (this.Calculated != null) ni.Calculated = this.Calculated.Value;
            if (this.Caption != null && this.Caption.Length > 0) ni.Caption = this.Caption;
            if (this.PropertyCount != null) ni.PropertyCount = this.PropertyCount.Value;
            if (this.FormatIndex != null) ni.FormatIndex = this.FormatIndex.Value;
            if (this.BackgroundColor != null && this.BackgroundColor.Length > 0) ni.BackgroundColor = new HexBinaryValue(this.BackgroundColor);
            if (this.ForegroundColor != null && this.ForegroundColor.Length > 0) ni.ForegroundColor = new HexBinaryValue(this.ForegroundColor);
            if (this.Italic != false) ni.Italic = this.Italic;
            if (this.Underline != false) ni.Underline = this.Underline;
            if (this.Strikethrough != false) ni.Strikethrough = this.Strikethrough;
            if (this.Bold != false) ni.Bold = this.Bold;

            foreach (SLTuplesType tt in this.Tuples)
            {
                ni.Append(tt.ToTuples());
            }

            foreach (int i in this.MemberPropertyIndexes)
            {
                if (i != 0) ni.Append(new MemberPropertyIndex() { Val = i });
                else ni.Append(new MemberPropertyIndex());
            }

            return ni;
        }
예제 #28
0
        internal void FromNumberItem(NumberItem ni)
        {
            this.SetAllNull();

            if (ni.Val != null) this.Val = ni.Val.Value;
            if (ni.Unused != null) this.Unused = ni.Unused.Value;
            if (ni.Calculated != null) this.Calculated = ni.Calculated.Value;
            if (ni.Caption != null) this.Caption = ni.Caption.Value;
            if (ni.PropertyCount != null) this.PropertyCount = ni.PropertyCount.Value;
            if (ni.FormatIndex != null) this.FormatIndex = ni.FormatIndex.Value;
            if (ni.BackgroundColor != null) this.BackgroundColor = ni.BackgroundColor.Value;
            if (ni.ForegroundColor != null) this.ForegroundColor = ni.ForegroundColor.Value;
            if (ni.Italic != null) this.Italic = ni.Italic.Value;
            if (ni.Underline != null) this.Underline = ni.Underline.Value;
            if (ni.Strikethrough != null) this.Strikethrough = ni.Strikethrough.Value;
            if (ni.Bold != null) this.Bold = ni.Bold.Value;

            SLTuplesType tt;
            MemberPropertyIndex mpi;
            using (OpenXmlReader oxr = OpenXmlReader.Create(ni))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Tuples))
                    {
                        tt = new SLTuplesType();
                        tt.FromTuples((Tuples)oxr.LoadCurrentElement());
                        this.Tuples.Add(tt);
                    }
                    else if (oxr.ElementType == typeof(MemberPropertyIndex))
                    {
                        // 0 is the default value.
                        mpi = (MemberPropertyIndex)oxr.LoadCurrentElement();
                        if (mpi.Val != null) this.MemberPropertyIndexes.Add(mpi.Val.Value);
                        else this.MemberPropertyIndexes.Add(0);
                    }
                }
            }
        }
예제 #29
0
 public bool Equals(BaseTestConfiguration other) =>
 StringItem.Equals(other.StringItem) &&
 NumberItem.Equals(other.NumberItem) &&
 SubConfigurationItem.Equals(other.SubConfigurationItem);