示例#1
0
        public Test3()
        {
            InitializeComponent();

            this.SaleDatas = Data3.CreateSaleData3s();

            List <ColumnItem> columns = new List <ColumnItem>();

            columns.Add(new ColumnItem("入库单号", "入库单号", "", "", HorizontalAlignment.Left, 100));
            columns.Add(new ColumnItem("金额", "金额", "", "", HorizontalAlignment.Left, 100));

            string moneyFormat = "{}{0:N2}";

            var col = new ColumnItem("顶级标题");

            var quarter = new ColumnItem("二级标题");

            quarter.Columns.Add(new ColumnItem("三级标题", "Quarter1", "", moneyFormat, HorizontalAlignment.Right, 90));
            quarter.Columns.Add(new ColumnItem("三级标题", "Quarter2", "", moneyFormat, HorizontalAlignment.Right, 90));

            col.Columns.Add(quarter);
            col.Columns.Add(new ColumnItem("特殊二级标题", "Total", "", moneyFormat, HorizontalAlignment.Right, 120));

            columns.Add(col);

            //将 Boolean 类型转换为中文
            columns.Add(new ColumnItem("Boolean转换测试", "CompleteState", "chineseCommonValueConverter", "", HorizontalAlignment.Center, 60));


            this.dgList.AddBindingPathTemplateColumn(columns); //添加列集合

            this.dgList.ItemsSource = this.SaleDatas;
        }
示例#2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Data1.Length != 0)
            {
                hash ^= Data1.GetHashCode();
            }
            if (Data2.Length != 0)
            {
                hash ^= Data2.GetHashCode();
            }
            if (Data3.Length != 0)
            {
                hash ^= Data3.GetHashCode();
            }
            if (myOneOfCase_ == MyOneOfOneofCase.One)
            {
                hash ^= One.GetHashCode();
            }
            if (myOneOfCase_ == MyOneOfOneofCase.Two)
            {
                hash ^= Two.GetHashCode();
            }
            if (myOneOfCase_ == MyOneOfOneofCase.Three)
            {
                hash ^= Three.GetHashCode();
            }
            hash ^= (int)myOneOfCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#3
0
        public void TestCompound()
        {
            var data3 = new Data3
            {
                data1 = new Data1 {
                    i = 890
                },
                f     = -2689789f,
                data2 = new Data2
                {
                    f = 7892f,
                    i = -25742,
                    s = "øøøøøøøøøøøø"
                }
            };
            var dataProp = containerSO.FindProperty(nameof(DataContainer.data3));

            SerializedPropertyHelper.SetValue(dataProp, data3);

            Assert.AreEqual(data3.data1.i, container.data3.data1.i);
            Assert.AreEqual(data3.f, container.data3.f);
            Assert.AreEqual(data3.data2.f, container.data3.data2.f);
            Assert.AreEqual(data3.data2.i, container.data3.data2.i);
            Assert.AreEqual(data3.data2.s, container.data3.data2.s);
        }
示例#4
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data.Add(new ByteBlockBlock());
                    Data[x].Read(reader);
                }
                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2.Add(new ByteBlockBlock());
                    Data2[x].Read(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2[x].ReadChildData(reader);
                }
                _effectName.ReadString(reader);
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3.Add(new ByteBlockBlock());
                    Data3[x].Read(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3[x].ReadChildData(reader);
                }
            }
        public MainPage()
        {
            this.InitializeComponent();
            Data MyData = new Data();

            MyData.Data_in();
            samsung.ItemsSource = MyData.myList;


            Data2 MyData2 = new Data2();

            MyData2.Data_in();
            htc.ItemsSource = MyData2.myList2;


            Data3 MyData3 = new Data3();

            MyData3.Data_in();
            nokia.ItemsSource = MyData3.myList3;

            Data4 MyData4 = new Data4();

            MyData4.Data_in();
            sony.ItemsSource = MyData4.myList4;
        }
示例#6
0
 /// <summary>
 /// Returns a hash-code based on the current value of this object.
 /// </summary>
 public override int GetHashCode()
 {
     return
         (Data1.GetHashCode() ^
          Data2.GetHashCode() ^
          Data3.GetHashCode());
 }
示例#7
0
        public static void TestPropertyInitializer()
        {
            var d2 = new Data2();

            Assert.AreEqual(0, d2.Value1);
            Assert.AreEqual(0, d2.Value2);

            var d3 = new Data3();

            Assert.AreEqual(2, d3.Value1);
            Assert.AreEqual(1, d3.Value2);
            Assert.Null(d3.Value3);
            Assert.AreEqual(2, d3.Value4);
            Assert.AreEqual(1, d3.Value5);
            Assert.Null(d3.Value6);
            Assert.AreEqual(2, d3.Value7);
            Assert.AreEqual(1, d3.Value8);
            Assert.Null(d3.Value9);

            var d4 = new Data4();

            Assert.AreEqual(2, d4.Value1);
            Assert.AreEqual(1, d4.Value2);
            Assert.AreEqual(0, d4.Value3);
            Assert.AreEqual(2, d4.Value4);
            Assert.AreEqual(1, d4.Value5);
            Assert.AreEqual(0, d4.Value6);
            Assert.AreEqual(2, d4.Value7);
            Assert.AreEqual(1, d4.Value8);
            Assert.AreEqual(0, d4.Value9);
        }
示例#8
0
 /// <summary>
 /// Checks a search string to see if any of the data objects exclude it.
 /// </summary>
 public bool DataExcludes(string search)
 {
     if (Data1.Contains(search) || Data2.Contains(search) || Data3.Contains(search) || Data4.Contains(search) || Data5.Contains(search) ||
         Data6.Contains(search) || Data7.Contains(search) || Data8.Contains(search) || Data9.Contains(search) || Data10.Contains(search))
     {
         return(false);
     }
     return(true);
 }
示例#9
0
    IEnumerator sending()
    {
        while (true)
        {
            playerpos = GameObject.FindWithTag("Player").GetComponent <Transform>();
            Data3 mydata = new Data3();
            // var idobj = GameObject.Find("connserver").GetComponent<connectserver>();

            Vector3 destination_rot = new Vector3(0, 0, yrot);

            Vector3 destination = playerpos.position + (destination_rot * 0.1f * Time.deltaTime);

            mydata.type      = "1";
            mydata.userindex = PlayerPrefs.GetString("userindex");
            mydata.id        = PlayerPrefs.GetString("id");
            mydata.nickname  = PlayerPrefs.GetString("nickname");

            string destinationpos_x = destination.x.ToString("N4");
            string destinationpos_y = destination.y.ToString("N4");
            string destinationpos_z = destination.z.ToString("N4");
            mydata.destinationpos.Add(destinationpos_x);
            mydata.destinationpos.Add(destinationpos_y);
            mydata.destinationpos.Add(destinationpos_z);

            string playerpos_x = playerpos.position.x.ToString("N4");
            string playerpos_y = playerpos.position.y.ToString("N4");
            string playerpos_z = playerpos.position.z.ToString("N4");
            mydata.playerpos.Add(playerpos_x);
            mydata.playerpos.Add(playerpos_y);
            mydata.playerpos.Add(playerpos_z);
            mydata.playerrot = yrot.ToString();

            mydata.movestate = "0";

            jsondata = JsonUtility.ToJson(mydata);
            Debug.Log("6." + jsondata);


            string toSend = jsondata;


            Debug.Log("Client send ");
            NetworkStream stream = socketConnection.GetStream();
            if (stream.CanWrite)
            {
                string clientMessage            = toSend;
                byte[] clientMessageAsByteArray = Encoding.ASCII.GetBytes(clientMessage);
                stream.Write(clientMessageAsByteArray, 0, clientMessageAsByteArray.Length);
            }


            yield return(new WaitForSeconds(0.2f));
        }
    }
示例#10
0
    public void DragEnd()
    {
        Stickback.transform.position = Stickback1; //조이스틱의 배경을 원래위치로
        Stick.position = Stick1;                   // 스틱을 원래의 위치로.
        JoyVec         = Vector3.zero;             // 방향을 0으로.
        MoveFlag       = false;                    //움직임이 없다는 표시

        playerpos = GameObject.FindWithTag("Player").GetComponent <Transform>();
        Data3 mydata = new Data3();

        mydata.type      = "1";
        mydata.userindex = PlayerPrefs.GetString("userindex");
        mydata.id        = PlayerPrefs.GetString("id");
        mydata.nickname  = PlayerPrefs.GetString("nickname");

        Vector3 destination_rot = new Vector3(0, yrot, 0);

        Vector3 destination = playerpos.position + (destination_rot * 10f * Time.deltaTime);

        string playerpos_x = playerpos.position.x.ToString("N4");
        string playerpos_y = playerpos.position.y.ToString("N4");
        string playerpos_z = playerpos.position.z.ToString("N4");

        mydata.playerpos.Add(playerpos_x);
        mydata.playerpos.Add(playerpos_y);
        mydata.playerpos.Add(playerpos_z);
        mydata.playerrot = yrot.ToString();


        mydata.destinationpos.Add(playerpos_x);
        mydata.destinationpos.Add(playerpos_y);
        mydata.destinationpos.Add(playerpos_z);


        mydata.movestate = "1";

        jsondata = JsonUtility.ToJson(mydata);
        Debug.Log("6." + jsondata);


        string toSend = jsondata;

        NetworkStream stream = socketConnection.GetStream();

        if (stream.CanWrite)
        {
            string clientMessage            = toSend;
            byte[] clientMessageAsByteArray = Encoding.ASCII.GetBytes(clientMessage);
            stream.Write(clientMessageAsByteArray, 0, clientMessageAsByteArray.Length);
        }


        Debug.Log("Client send ");
    }
            public Sir0 ToSir0()
            {
                var sir0 = new Sir0Builder(8);

                void align(int length)
                {
                    var paddingLength = length - (sir0.Length % length);

                    if (paddingLength != length)
                    {
                        sir0.WritePadding(sir0.Length, paddingLength);
                    }
                }

                var floorInfoPointer = sir0.Length;

                foreach (var floor in FloorInfos)
                {
                    sir0.Write(sir0.Length, floor.ToByteArray());
                }

                align(16);
                var wildPokemonPointer = sir0.Length;

                if (WildPokemon != null)
                {
                    sir0.Write(sir0.Length, WildPokemon.ToSir0().Data.ReadArray());
                }

                align(16);
                var data3Pointer = sir0.Length;

                if (Data3 != null)
                {
                    sir0.Write(sir0.Length, Data3.ToSir0().Data.ReadArray());
                }

                align(16);
                var data4Pointer = sir0.Length;

                if (Data4 != null)
                {
                    sir0.Write(sir0.Length, Data4.ToSir0().Data.ReadArray());
                }

                // Write the content header
                align(16);
                sir0.SubHeaderOffset = sir0.Length;
                sir0.WritePointer(sir0.Length, floorInfoPointer);
                sir0.WritePointer(sir0.Length, wildPokemonPointer);
                sir0.WritePointer(sir0.Length, data3Pointer);
                sir0.WritePointer(sir0.Length, data4Pointer);
                return(sir0.Build());
            }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)Data1;
         hashCode = (hashCode * 397) ^ Data2.GetHashCode();
         hashCode = (hashCode * 397) ^ Data3.GetHashCode();
         hashCode = (hashCode * 397) ^ Data4.GetHashCode();
         hashCode = (hashCode * 397) ^ Guid.GetHashCode();
         return(hashCode);
     }
 }
示例#13
0
        public override int GetHashCode()
        {
            int hash = 311;

            unchecked
            {
                hash = hash + 709 * Data0.GetHashCode();
                hash = hash * 443 + Data1.GetHashCode();
                hash = hash * 269 + Data2.GetHashCode();
                hash = hash * 653 + Data3.GetHashCode();
            }
            return(hash);
        }
示例#14
0
        public override int GetHashCode()
        {
            int hash = 19;

            unchecked
            {
                hash = hash * 31 + Data0.GetHashCode();
                hash = hash * 31 + Data1.GetHashCode();
                hash = hash * 31 + Data2.GetHashCode();
                hash = hash * 31 + Data3.GetHashCode();
            }
            return(hash);
        }
示例#15
0
        public override int GetHashCode()
        {
            int hash = 19;

            unchecked
            {
                hash = hash + 31 * Data0.GetHashCode();
                hash = hash * 479 + Data1.GetHashCode();
                hash = hash * 593 + Data2.GetHashCode();
                hash = hash * 347 + Data3.GetHashCode();
            }
            return(hash);
        }
示例#16
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data.Add(new ByteBlockBlock());
                    Data[x].Read(reader);
                }
                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2.Add(new ByteBlockBlock());
                    Data2[x].Read(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3.Add(new ByteBlockBlock());
                    Data3[x].Read(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data4.Count); x = (x + 1))
                {
                    Data4.Add(new ByteBlockBlock());
                    Data4[x].Read(reader);
                }
                for (x = 0; (x < _data4.Count); x = (x + 1))
                {
                    Data4[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data5.Count); x = (x + 1))
                {
                    Data5.Add(new ByteBlockBlock());
                    Data5[x].Read(reader);
                }
                for (x = 0; (x < _data5.Count); x = (x + 1))
                {
                    Data5[x].ReadChildData(reader);
                }
            }
示例#17
0
文件: DLSID.cs 项目: Kermalis/DLS2
        public override int GetHashCode()
        {
            // .NET Standard does not have this method
#if DEBUG
            return(HashCode.Combine(Data1, Data2, Data3, Data4));
#else
            int hashCode = -0x8CAC62A;
            hashCode = hashCode * -0x5AAAAAD7 + Data1.GetHashCode();
            hashCode = hashCode * -0x5AAAAAD7 + Data2.GetHashCode();
            hashCode = hashCode * -0x5AAAAAD7 + Data3.GetHashCode();
            hashCode = hashCode * -0x5AAAAAD7 + EqualityComparer <byte[]> .Default.GetHashCode(Data4);

            return(hashCode);
#endif
        }
示例#18
0
文件: DLSID.cs 项目: Kermalis/DLS2
        public override string ToString()
        {
            string str = Data1.ToString("X8") + '-' + Data2.ToString("X4") + '-' + Data3.ToString("X4") + '-';

            for (int i = 0; i < 2; i++)
            {
                str += Data4[i].ToString("X2");
            }
            str += '-';
            for (int i = 2; i < 8; i++)
            {
                str += Data4[i].ToString("X2");
            }
            return(str);
        }
示例#19
0
        private async Task DownloadAsync()
        {
            //WebClient wc = new WebClient();
            using (var wc = new HttpClient())
            {
                foreach (var url in URLS)
                {
                    byte[] image = await wc.GetByteArrayAsync(url);

                    Data3.Add(image);
                }
            }
            //string data = await ImageProcess();
            // ON UI
        }
示例#20
0
        public object Get(System.Type T)
        {
            if (Data1 == null)
            {
                return(null);
            }
            if (Data1.GetType().IsSubOrEqual(T))
            {
                return(Data1);
            }

            if (Data2 == null)
            {
                return(null);
            }
            if (Data2.GetType().IsSubOrEqual(T))
            {
                return(Data2);
            }

            if (Data3 == null)
            {
                return(null);
            }
            if (Data3.GetType().IsSubOrEqual(T))
            {
                return(Data3);
            }

            if (Data == null)
            {
                return(null);
            }
            foreach (var e in Data)
            {
                if (e.GetType().IsSubOrEqual(T))
                {
                    return(e);
                }
            }

            return(null);
        }
示例#21
0
        public MainWindowVM()
        {
            model = new SomethingModel();

            Run = new DelegateCommand(async() =>
            {
                IsBusy = true;

                Data0.Clear();
                var j0 = model.RunSin((d) =>
                {
                    Data0.AddRange(d);
                    RaisePropertyChanged(nameof(Data0));
                });
                Data1.Clear();
                var j1 = model.RunCos((d) =>
                {
                    Data1.AddRange(d);
                    RaisePropertyChanged(nameof(Data1));
                });
                Data2.Clear();
                var j2 = model.RunRect((d) =>
                {
                    Data2.AddRange(d);
                    RaisePropertyChanged(nameof(Data2));
                });
                Data3.Clear();
                var j3 = model.RunSinc((d) =>
                {
                    Data3.AddRange(d);
                    RaisePropertyChanged(nameof(Data3));
                });
                await Task.WhenAll(j0, j1, j2, j3);

                IsBusy = false;
            });

            Stop = new DelegateCommand(async() =>
            {
                await model.Cancel();
            });
        }
示例#22
0
        public void Remove(System.Type Type)
        {
            if (Data1 == null)
            {
                return;
            }
            if (Data1.GetType().IsSubOrEqual(Type))
            {
                Data1 = null;
            }

            if (Data2 == null)
            {
                return;
            }
            if (Data2.GetType().IsSubOrEqual(Type))
            {
                Data2 = null;
            }

            if (Data3 == null)
            {
                return;
            }
            if (Data3.GetType().IsSubOrEqual(Type))
            {
                Data3 = null;
            }

            if (Data != null)
            {
                Data.RemoveAll(x => x.GetType().IsSubOrEqual(Type));
            }

            Adjust(false);
        }
示例#23
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                _materialEffects.ReadString(reader);
                _bitmap.ReadString(reader);
                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data.Add(new ByteBlockBlock());
                    Data[x].Read(reader);
                }
                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2.Add(new ByteBlockBlock());
                    Data2[x].Read(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3.Add(new ByteBlockBlock());
                    Data3[x].Read(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3[x].ReadChildData(reader);
                }
                for (x = 0; (x < _cores.Count); x = (x + 1))
                {
                    Cores.Add(new LiquidCoreBlockBlock());
                    Cores[x].Read(reader);
                }
                for (x = 0; (x < _cores.Count); x = (x + 1))
                {
                    Cores[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data4.Count); x = (x + 1))
                {
                    Data4.Add(new ByteBlockBlock());
                    Data4[x].Read(reader);
                }
                for (x = 0; (x < _data4.Count); x = (x + 1))
                {
                    Data4[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data5.Count); x = (x + 1))
                {
                    Data5.Add(new ByteBlockBlock());
                    Data5[x].Read(reader);
                }
                for (x = 0; (x < _data5.Count); x = (x + 1))
                {
                    Data5[x].ReadChildData(reader);
                }
            }
示例#24
0
        public ComWithS71200DB()
        {
            TypeList.Add(Data0.GetType().ToString());
            TypeList.Add(Data1.GetType().ToString());
            TypeList.Add(Data2.GetType().ToString());
            TypeList.Add(Data3.GetType().ToString());
            TypeList.Add(Data4.GetType().ToString());
            TypeList.Add(Data5.GetType().ToString());
            TypeList.Add(Data6.GetType().ToString());
            TypeList.Add(Data7.GetType().ToString());
            TypeList.Add(Data8.GetType().ToString());
            TypeList.Add(Data9.GetType().ToString());
            TypeList.Add(Data10.GetType().ToString());
            TypeList.Add(Data11.GetType().ToString());
            TypeList.Add(Data12.GetType().ToString());
            TypeList.Add(Data13.GetType().ToString());
            TypeList.Add(Data14.GetType().ToString());
            TypeList.Add(Data15.GetType().ToString());
            TypeList.Add(Data16.GetType().ToString());
            TypeList.Add(Data17.GetType().ToString());
            TypeList.Add(Data18.GetType().ToString());
            TypeList.Add(Data19.GetType().ToString());
            TypeList.Add(Data20.GetType().ToString());
            TypeList.Add(Data21.GetType().ToString());
            TypeList.Add(Data22.GetType().ToString());
            TypeList.Add(Data23.GetType().ToString());
            TypeList.Add(Data24.GetType().ToString());
            TypeList.Add(Data25.GetType().ToString());
            TypeList.Add(Data26.GetType().ToString());
            TypeList.Add(Data27.GetType().ToString());
            TypeList.Add(Data28.GetType().ToString());
            TypeList.Add(Data29.GetType().ToString());
            TypeList.Add(Data30.GetType().ToString());
            TypeList.Add(Data31.GetType().ToString());
            TypeList.Add(Data32.GetType().ToString());
            TypeList.Add(Data33.GetType().ToString());
            TypeList.Add(Data34.GetType().ToString());
            TypeList.Add(Data35.GetType().ToString());
            TypeList.Add(Data36.GetType().ToString());
            TypeList.Add(Data37.GetType().ToString());
            TypeList.Add(Data38.GetType().ToString());
            TypeList.Add(Data39.GetType().ToString());
            TypeList.Add(Data40.GetType().ToString());
            TypeList.Add(Data41.GetType().ToString());
            TypeList.Add(Data42.GetType().ToString());
            TypeList.Add(Data43.GetType().ToString());
            TypeList.Add(Data44.GetType().ToString());
            TypeList.Add(Data45.GetType().ToString());
            TypeList.Add(Data46.GetType().ToString());
            TypeList.Add(Data47.GetType().ToString());
            TypeList.Add(Data48.GetType().ToString());
            TypeList.Add(Data49.GetType().ToString());
            TypeList.Add(Data50.GetType().ToString());
            TypeList.Add(Data51.GetType().ToString());
            TypeList.Add(Data52.GetType().ToString());
            TypeList.Add(Data53.GetType().ToString());
            TypeList.Add(Data54.GetType().ToString());
            TypeList.Add(Data55.GetType().ToString());
            TypeList.Add(Data56.GetType().ToString());
            TypeList.Add(Data57.GetType().ToString());
            TypeList.Add(Data58.GetType().ToString());
            TypeList.Add(Data59.GetType().ToString());
            TypeList.Add(Data60.GetType().ToString());
            TypeList.Add(Data61.GetType().ToString());
            TypeList.Add(Data62.GetType().ToString());
            TypeList.Add(Data63.GetType().ToString());
            TypeList.Add(Data64.GetType().ToString());
            TypeList.Add(Data65.GetType().ToString());
            TypeList.Add(Data66.GetType().ToString());
            TypeList.Add(Data67.GetType().ToString());
            TypeList.Add(Data68.GetType().ToString());
            TypeList.Add(Data69.GetType().ToString());
            TypeList.Add(Data70.GetType().ToString());
            TypeList.Add(Data71.GetType().ToString());
            TypeList.Add(Data72.GetType().ToString());
            TypeList.Add(Data73.GetType().ToString());
            TypeList.Add(Data74.GetType().ToString());
            TypeList.Add(Data75.GetType().ToString());
            TypeList.Add(Data76.GetType().ToString());
            TypeList.Add(Data77.GetType().ToString());
            TypeList.Add(Data78.GetType().ToString());
            TypeList.Add(Data79.GetType().ToString());
            TypeList.Add(Data80.GetType().ToString());
            TypeList.Add(Data81.GetType().ToString());
            TypeList.Add(Data82.GetType().ToString());
            TypeList.Add(Data83.GetType().ToString());
            TypeList.Add(Data84.GetType().ToString());
            TypeList.Add(Data85.GetType().ToString());
            TypeList.Add(Data86.GetType().ToString());
            TypeList.Add(Data87.GetType().ToString());
            TypeList.Add(Data88.GetType().ToString());
            TypeList.Add(Data89.GetType().ToString());
            TypeList.Add(Data90.GetType().ToString());
            TypeList.Add(Data91.GetType().ToString());
            TypeList.Add(Data92.GetType().ToString());
            TypeList.Add(Data93.GetType().ToString());
            TypeList.Add(Data94.GetType().ToString());
            TypeList.Add(Data95.GetType().ToString());
            TypeList.Add(Data96.GetType().ToString());
            TypeList.Add(Data97.GetType().ToString());
            TypeList.Add(Data98.GetType().ToString());
            TypeList.Add(Data99.GetType().ToString());
            TypeList.Add(Data100.GetType().ToString());

            DataList.Add(Data0);
            DataList.Add(Data1);
            DataList.Add(Data2);
            DataList.Add(Data3);
            DataList.Add(Data4);
            DataList.Add(Data5);
            DataList.Add(Data6);
            DataList.Add(Data7);
            DataList.Add(Data8);
            DataList.Add(Data9);
            DataList.Add(Data10);
            DataList.Add(Data11);
            DataList.Add(Data12);
            DataList.Add(Data13);
            DataList.Add(Data14);
            DataList.Add(Data15);
            DataList.Add(Data16);
            DataList.Add(Data17);
            DataList.Add(Data18);
            DataList.Add(Data19);
            DataList.Add(Data20);
            DataList.Add(Data21);
            DataList.Add(Data22);
            DataList.Add(Data23);
            DataList.Add(Data24);
            DataList.Add(Data25);
            DataList.Add(Data26);
            DataList.Add(Data27);
            DataList.Add(Data28);
            DataList.Add(Data29);
            DataList.Add(Data30);
            DataList.Add(Data31);
            DataList.Add(Data32);
            DataList.Add(Data33);
            DataList.Add(Data34);
            DataList.Add(Data35);
            DataList.Add(Data36);
            DataList.Add(Data37);
            DataList.Add(Data38);
            DataList.Add(Data39);
            DataList.Add(Data40);
            DataList.Add(Data41);
            DataList.Add(Data42);
            DataList.Add(Data43);
            DataList.Add(Data44);
            DataList.Add(Data45);
            DataList.Add(Data46);
            DataList.Add(Data47);
            DataList.Add(Data48);
            DataList.Add(Data49);
            DataList.Add(Data50);
            DataList.Add(Data51);
            DataList.Add(Data52);
            DataList.Add(Data53);
            DataList.Add(Data54);
            DataList.Add(Data55);
            DataList.Add(Data56);
            DataList.Add(Data57);
            DataList.Add(Data58);
            DataList.Add(Data59);
            DataList.Add(Data60);
            DataList.Add(Data61);
            DataList.Add(Data62);
            DataList.Add(Data63);
            DataList.Add(Data64);
            DataList.Add(Data65);
            DataList.Add(Data66);
            DataList.Add(Data67);
            DataList.Add(Data68);
            DataList.Add(Data69);
            DataList.Add(Data70);
            DataList.Add(Data71);
            DataList.Add(Data72);
            DataList.Add(Data73);
            DataList.Add(Data74);
            DataList.Add(Data75);
            DataList.Add(Data76);
            DataList.Add(Data77);
            DataList.Add(Data78);
            DataList.Add(Data79);
            DataList.Add(Data80);
            DataList.Add(Data81);
            DataList.Add(Data82);
            DataList.Add(Data83);
            DataList.Add(Data84);
            DataList.Add(Data85);
            DataList.Add(Data86);
            DataList.Add(Data87);
            DataList.Add(Data88);
            DataList.Add(Data89);
            DataList.Add(Data90);
            DataList.Add(Data91);
            DataList.Add(Data92);
            DataList.Add(Data93);
            DataList.Add(Data94);
            DataList.Add(Data95);
            DataList.Add(Data96);
            DataList.Add(Data97);
            DataList.Add(Data98);
            DataList.Add(Data99);
            DataList.Add(Data100);
        }
示例#25
0
        public void Set(object Value, bool Overwrite = true)
        {
            var T = Value.GetType();

            if (Data1 == null)
            {
                Data1 = Value;
            }
            else if (Data1.GetType().IsSubOrEqual(T))
            {
                if (!Overwrite)
                {
                    throw new InvalidOperationException("The list already contains an object with the same type");
                }

                Data1 = Value;
            }

            else if (Data2 == null)
            {
                Data2 = Value;
            }
            else if (Data2.GetType().IsSubOrEqual(T))
            {
                if (!Overwrite)
                {
                    throw new InvalidOperationException("The list already contains an object with the same type");
                }

                Data2 = Value;
            }

            else if (Data3 == null)
            {
                Data3 = Value;
            }
            else if (Data3.GetType().IsSubOrEqual(T))
            {
                if (!Overwrite)
                {
                    throw new InvalidOperationException("The list already contains an object with the same type");
                }

                Data3 = Value;
            }

            else if (Data != null)
            {
                for (var i = 0; i < Data.Count; i++)
                {
                    if (Data[i].GetType().IsSubOrEqual(T))
                    {
                        if (!Overwrite)
                        {
                            throw new InvalidOperationException("The list already contains an object with the same type");
                        }

                        Data[i] = Value;
                        return;
                    }
                }

                Data.Add(Value);
            }
            else
            {
                Data = new List <object>()
                {
                    Value
                };
            }
        }
示例#26
0
 public string OperatorToString() =>
 Data1.ToString() + " "
 + Data2.ToString() + " "
 + Data3.ToString() + " "
 + Data4.ToString() + " "
 + Data5.ToString();
示例#27
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //Расстановка исходных точек
            Data2.Clear();
            foreach (Axes a in Data1)
            {
                Data2.Add(new KeyValuePair <double, double>(a.XValue, a.YValue));
            }
            lineSeries1.DataContext = Data2;

            //Линейная функция
            var solver = SolverContext.GetContext();

            solver.ClearModel();
            var      model = solver.CreateModel();
            Decision a0    = new Decision(Domain.Real, "a0");
            Decision a1    = new Decision(Domain.Real, "a1");

            model.AddDecision(a0);
            model.AddDecision(a1);
            Term generalError = 0; //функция которую минимизируем

            foreach (Axes a in Data1)
            {
                Term error = Model.Power(a0 + a1 * a.XValue - a.YValue, 2);
                generalError += error;
            }
            model.AddGoal("ComplicatedGoal", GoalKind.Minimize, generalError);
            var solution  = solver.Solve();
            var solutions = solution.Decisions.ToList();
            var linearB   = Math.Round(solutions[0].ToDouble(), 3);
            var linearA   = Math.Round(solutions[1].ToDouble(), 3);


            solver.ClearModel();
            //Квадратичная функция
            var      model2 = solver.CreateModel();
            Decision b0     = new Decision(Domain.Real, "b0");
            Decision b1     = new Decision(Domain.Real, "b1");
            Decision b2     = new Decision(Domain.Real, "b2");

            model2.AddDecision(b0);
            model2.AddDecision(b1);
            model2.AddDecision(b2);
            generalError = 0; //функция которую минимизируем
            foreach (Axes a in Data1)
            {
                Term error = Model.Power(b0 + b1 * a.XValue + b2 * a.XValue * a.XValue - a.YValue, 2);
                generalError += error;
            }
            model2.AddGoal("ComplicatedGoal", GoalKind.Minimize, generalError);
            solution  = solver.Solve();
            solutions = solution.Decisions.ToList();
            var squaredC = Math.Round(solutions[0].ToDouble(), 3);
            var squaredB = Math.Round(solutions[1].ToDouble(), 3);
            var squaredA = Math.Round(solutions[2].ToDouble(), 3);

            textBlock1.Text = "Коэффициенты полинома 1й степени";
            textBlock2.Text = $"a = {linearA} ";
            textBlock3.Text = $"b = {linearB}";
            textBlock4.Text = "Коэффициенты полинома 2й степени";
            textBlock5.Text = $"a = {squaredA}";
            textBlock6.Text = $"b = {squaredB}";
            textBlock7.Text = $"c = {squaredC}";

            // Отрисовка полиномов
            double minX = Data1[0].XValue;
            double maxX = Data1[0].XValue;

            foreach (Axes a in Data1)
            {
                if (a.XValue < minX)
                {
                    minX = a.XValue;
                }
                if (a.XValue > maxX)
                {
                    maxX = a.XValue;
                }
            }
            Data3.Clear();
            for (double i = minX - 2; i <= maxX + 2; i += 0.1)
            {
                Data3.Add(new KeyValuePair <double, double>(i, linearA * i + linearB));
            }
            lineSeries2.DataContext = Data3;

            Data4.Clear();
            for (double i = minX - 2; i <= maxX + 2; i += 0.1)
            {
                Data4.Add(new KeyValuePair <double, double>(i, squaredA * i * i + squaredB * i + squaredC));
            }
            lineSeries3.DataContext = Data4;
        }
示例#28
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                _particlePhysics.ReadString(reader);
                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data.Add(new ByteBlockBlock());
                    Data[x].Read(reader);
                }
                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2.Add(new ByteBlockBlock());
                    Data2[x].Read(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3.Add(new ByteBlockBlock());
                    Data3[x].Read(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data4.Count); x = (x + 1))
                {
                    Data4.Add(new ByteBlockBlock());
                    Data4[x].Read(reader);
                }
                for (x = 0; (x < _data4.Count); x = (x + 1))
                {
                    Data4[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data5.Count); x = (x + 1))
                {
                    Data5.Add(new ByteBlockBlock());
                    Data5[x].Read(reader);
                }
                for (x = 0; (x < _data5.Count); x = (x + 1))
                {
                    Data5[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data6.Count); x = (x + 1))
                {
                    Data6.Add(new ByteBlockBlock());
                    Data6[x].Read(reader);
                }
                for (x = 0; (x < _data6.Count); x = (x + 1))
                {
                    Data6[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data7.Count); x = (x + 1))
                {
                    Data7.Add(new ByteBlockBlock());
                    Data7[x].Read(reader);
                }
                for (x = 0; (x < _data7.Count); x = (x + 1))
                {
                    Data7[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data8.Count); x = (x + 1))
                {
                    Data8.Add(new ByteBlockBlock());
                    Data8[x].Read(reader);
                }
                for (x = 0; (x < _data8.Count); x = (x + 1))
                {
                    Data8[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data9.Count); x = (x + 1))
                {
                    Data9.Add(new ByteBlockBlock());
                    Data9[x].Read(reader);
                }
                for (x = 0; (x < _data9.Count); x = (x + 1))
                {
                    Data9[x].ReadChildData(reader);
                }
            }
示例#29
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                _bitmap.ReadString(reader);
                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data.Add(new ByteBlockBlock());
                    Data[x].Read(reader);
                }
                for (x = 0; (x < _data.Count); x = (x + 1))
                {
                    Data[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2.Add(new ByteBlockBlock());
                    Data2[x].Read(reader);
                }
                for (x = 0; (x < _data2.Count); x = (x + 1))
                {
                    Data2[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3.Add(new ByteBlockBlock());
                    Data3[x].Read(reader);
                }
                for (x = 0; (x < _data3.Count); x = (x + 1))
                {
                    Data3[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data4.Count); x = (x + 1))
                {
                    Data4.Add(new ByteBlockBlock());
                    Data4[x].Read(reader);
                }
                for (x = 0; (x < _data4.Count); x = (x + 1))
                {
                    Data4[x].ReadChildData(reader);
                }
                for (x = 0; (x < _data5.Count); x = (x + 1))
                {
                    Data5.Add(new ByteBlockBlock());
                    Data5[x].Read(reader);
                }
                for (x = 0; (x < _data5.Count); x = (x + 1))
                {
                    Data5[x].ReadChildData(reader);
                }
                for (x = 0; (x < _aspect.Count); x = (x + 1))
                {
                    Aspect.Add(new LightVolumeAspectBlockBlock());
                    Aspect[x].Read(reader);
                }
                for (x = 0; (x < _aspect.Count); x = (x + 1))
                {
                    Aspect[x].ReadChildData(reader);
                }
                for (x = 0; (x < _emptyname.Count); x = (x + 1))
                {
                    Emptyname.Add(new LightVolumeRuntimeOffsetBlockBlock());
                    Emptyname[x].Read(reader);
                }
                for (x = 0; (x < _emptyname.Count); x = (x + 1))
                {
                    Emptyname[x].ReadChildData(reader);
                }
            }
示例#30
0
 public override string ToString()
 {
     return($"{{{nameof(Offset)}={Offset.ToString("X")}, {nameof(ArticleGroupId)}={ArticleGroupId.ToString("X")}, {nameof(ArcEntryGroup)}={ArcEntryGroup.ToString("X")}, {nameof(Bone)}={Bone.ToString("X")}, {nameof(ActionFlags)}={ActionFlags.ToString("X")}, {nameof(SubActionFlags)}={SubActionFlags.ToString("X")}, {nameof(Actions)}={Actions.ToString("X")}, {nameof(SubActionMain)}={SubActionMain.ToString("X")}, {nameof(SubActionGfx)}={SubActionGfx.ToString("X")}, {nameof(SubActionSfx)}={SubActionSfx.ToString("X")}, {nameof(ModelVisibility)}={ModelVisibility.ToString("X")}, {nameof(CollisionData)}={CollisionData.ToString("X")}, {nameof(Data2)}={Data2.ToString("X")}, {nameof(Data3)}={Data3.ToString("X")}, {nameof(SubActionCount)}={SubActionCount.ToString("X")}}}");
 }