Beispiel #1
0
 public SkeletalMeshSamplingLODBuiltDataPropertyData(FName name) : base(name)
 {
 }
Beispiel #2
0
        //上传主要部分。
        public void Open()
        {
            HttpPostedFile hpFile = _FormFile.PostedFile;

            if (hpFile == null || hpFile.FileName.Trim() == "")
            {
                _Error = 1;
                return;
            }

            string Ext = GetExt(hpFile.FileName);

            if (!IsUpload(Ext))
            {
                _Error = 2;
                return;
            }

            int iLen = hpFile.ContentLength;

            if (iLen > _MaxSize)
            {
                _Error = 3;
                return;
            }

            try
            {
                _Size = iLen;
                if (!Directory.Exists(_SavePath))
                {
                    Directory.CreateDirectory(_SavePath);
                }
                byte[] bData = new byte[iLen];
                hpFile.InputStream.Read(bData, 0, iLen);
                string FName;
                FName = FileName(Ext);
                string TempFile = "";
                if (_IsDraw)
                {
                    TempFile = FName.Split('.').GetValue(0).ToString() + "_temp." + FName.Split('.').GetValue(1).ToString();
                }
                else
                {
                    TempFile = FName;
                }
                FileStream newFile = new FileStream(_SavePath + TempFile, FileMode.Create);
                newFile.Write(bData, 0, bData.Length);
                newFile.Flush();
                int _FileSizeTemp = hpFile.ContentLength;

                if (_IsDraw)
                {
                    if (_DrawStyle == 0)
                    {
                        System.Drawing.Image Img1 = System.Drawing.Image.FromStream(newFile);
                        Graphics             g    = Graphics.FromImage(Img1);
                        g.DrawImage(Img1, 100, 100, Img1.Width, Img1.Height);
                        Font   f       = new Font(_Font, _FontSize);
                        Brush  b       = new SolidBrush(Color.Red);
                        string addtext = _AddText;
                        g.DrawString(addtext, f, b, _DrawString_x, _DrawString_y);
                        g.Dispose();
                        Img1.Save(_SavePath + FName);
                        Img1.Dispose();
                    }
                    else
                    {
                        System.Drawing.Image image     = System.Drawing.Image.FromStream(newFile);
                        System.Drawing.Image copyImage = System.Drawing.Image.FromFile(_CopyIamgePath);
                        Graphics             g         = Graphics.FromImage(image);
                        g.DrawImage(copyImage, new Rectangle(image.Width - copyImage.Width - 5, image.Height - copyImage.Height - 5, copyImage.Width, copyImage.Height), 0, 0, copyImage.Width, copyImage.Height, GraphicsUnit.Pixel);
                        g.Dispose();
                        image.Save(_SavePath + FName);
                        image.Dispose();
                    }
                }

                try
                {
                    //获取图片的高度和宽度
                    System.Drawing.Image Img = System.Drawing.Image.FromStream(newFile);
                    _Width  = Img.Width;
                    _Height = Img.Height;
                    //生成缩略图部分
                    if (_IsCreateImg)
                    {
                        //如果上传文件小于15k,则不生成缩略图。
                        if (iLen > 15360)
                        {
                            System.Drawing.Image newImg = Img.GetThumbnailImage(_sWidth, _sHeight, null, System.IntPtr.Zero);
                            newImg.Save(_SavePath + FName.Split('.').GetValue(0).ToString() + "_s." + FName.Split('.').GetValue(1).ToString());
                            newImg.Dispose();
                            _Iss = true;
                        }
                    }
                    if (_IsDraw)
                    {
                        if (File.Exists(_SavePath + FName.Split('.').GetValue(0).ToString() + "_temp." + FName.Split('.').GetValue(1).ToString()))
                        {
                            newFile.Dispose();
                            File.Delete(_SavePath + FName.Split('.').GetValue(0).ToString() + "_temp." + FName.Split('.').GetValue(1).ToString());
                        }
                    }
                }
                catch { }
                newFile.Close();
                newFile.Dispose();
                _OutFileName = FName;
                _FileSize    = _FileSizeTemp;
                _Error       = 0;
                return;
            }
            catch
            {
                _Error = 4;
                return;
            }
        }
        /*
         * MethodName: ToString()
         * ReturnType: string
         * Summary: Prints the attributes of the object as a string in the specified format.
         */
        public override string ToString()
        {
            Program obj = new Program();

            return("z" + obj.Temp.ToString().PadRight(6, ' ') + " --    " + FName.PadLeft(12, ' ') + ", " + LName.PadRight(10, ' ') + "[" + Acdyear.ToString().PadRight(10, ' ') + "]  " + "(" + Major.PadRight(15, ' ') + ")  " + "  | " + String.Format("{0:0.000}", GPA) + " |");
        }
 public TimespanPropertyData(FName name) : base(name)
 {
 }
Beispiel #5
0
 public void DeserializePropertyTagValue(IAssetConverter converter)
 {
     this.Name = new FName(converter.GetNameMap(), converter.GetExportStream());
 }
Beispiel #6
0
 public FSmartName(FStructFallback data)
 {
     DisplayName = data.GetOrDefault <FName>(nameof(DisplayName));
 }
 public void SetSerializingPropertyType(FName newType)
 {
     SerializingPropertyType = newType;
 }
 public FMaterialParameterInfo(FArchive Ar)
 {
     Name        = Ar.ReadFName();
     Association = Ar.Read <EMaterialParameterAssociation>();
     Index       = Ar.Read <int>();
 }
 public FMaterialParameterInfo()
 {
     Name        = new FName();
     Association = EMaterialParameterAssociation.LayerParameter;
     Index       = 0;
 }
Beispiel #10
0
 public Vector4PropertyData(FName name) : base(name)
 {
 }
 public FMaterialParameterInfo(FStructFallback fallback)
 {
     Name        = fallback.GetOrDefault <FName>(nameof(Name));
     Association = fallback.GetOrDefault <EMaterialParameterAssociation>(nameof(Association));
     Index       = fallback.GetOrDefault <int>(nameof(Index));
 }
Beispiel #12
0
 public FNumberedPair(FAssetRegistryReader Ar)
 {
     Key   = Ar.ReadFName();
     Value = new FValueId(Ar);
 }
Beispiel #13
0
 public FNumberedPair(FName key, FValueId value)
 {
     Key   = key;
     Value = value;
 }
Beispiel #14
0
        void BeginPlay()
        {
            LogWarning("Hello World!");

            LogInfo(string.Format("int {0}", testData));
            LogInfo(string.Format("testFloat {0}", testFloat));
            LogInfo(string.Format("testString {0}", testString));

            LogInfo("Class " + this.GetName());
            if (this.GetOuter() == null)
            {
                LogInfo("Class Out Is Null");
            }
            else
            {
                LogInfo("Class " + this.GetOuter().GetName());
            }

            //FTransform trans = GetOwner().GetTransform();
            //trans.Scale3D.X = 3.0f;
            //trans.Scale3D.Y = 3.0f;
            //trans.Scale3D.Z = 3.0f;
            //LogInfo("more methods:" + string.Format("Actor Name {0}, Pos {1},{2},{3}",
            //    this.GetOwner().GetName(),
            //    trans.Translation.X,
            //    trans.Translation.Y,
            //    trans.Translation.Z));

            LogInfo("Tick Group " + this.PrimaryComponentTick.TickGroup);

            LogInfo(string.Format("array num {0}", intArray2.Length));
            for (int i = 0; i < intArray2.Length; i++)
            {
                LogInfo(string.Format("intArray index {0} , value {1}", i, intArray2[i]));
            }
            for (int i = 0; i < strArray.Length; i++)
            {
                LogInfo(string.Format("strArray index {0} , value {1}", i, strArray[i]));
            }
            for (int i = 0; i < boolArray.Length; i++)
            {
                LogInfo(string.Format("boolArray index {0} , value {1}", i, boolArray[i]));
            }
            if (actorArray2 != null)
            {
                for (int i = 0; i < actorArray2.Length; i++)
                {
                    LogInfo(string.Format("actorArray2 index {0} , value {1}", i, actorArray2[i].GetName()));
                }
            }
            else
            {
                LogInfo(string.Format("actorArray2 is null"));
            }

            LogInfo(string.Format("check state {0}", checkState));

            AActor Owner = this.GetOwner();

            TStructArray <FName> tags = this.ComponentTags;

            tags.Add(FName.FromString("Tag0_Modify"));
            tags.Add(FName.FromString("Tag1"));
            this.ComponentTags = tags;
            int num = this.ComponentTags.Num();

            LogInfo("Tags Num:" + num);
            for (int i = 0; i < num; i++)
            {
                LogInfo(string.Format("com name {0}", this.ComponentTags[i].ToString()));
            }
            LogInfo(string.Format("GetComponentsByClass"));
            TSubclassOf <UActorComponent> Class = typeof(UActorComponent);

            LogInfo(string.Format("GetComponentsByClass1"));
            UActorComponent[] coms = this.GetOwner().GetComponentsByClass(Class);
            LogInfo(string.Format("GetComponentsByClass2"));
            LogInfo(string.Format("coms num {0}", coms.Length));
            for (int i = 0; i < coms.Length; i++)
            {
                LogInfo(string.Format("coms index {0} , value {1}", i, coms[i].GetName()));
            }
        }
Beispiel #15
0
 public FObjectResource(FName objectName, FPackageIndex outerIndex)
 {
     ObjectName = objectName;
     OuterIndex = outerIndex;
 }
Beispiel #16
0
 public FNiagaraVariable(FName name, FStructFallback typeDef, byte[] varData) : base(name, typeDef)
 {
     VarData = varData;
 }
Beispiel #17
0
 public SoftAssetPathPropertyData(FName name)
     : base(name)
 {
 }
 public FAssetRegistryExportPath(FAssetRegistryReader Ar)
 {
     Class   = Ar.ReadFName();
     Object  = Ar.ReadFName();
     Package = Ar.ReadFName();
 }
 public UnknownPropertyData(FName name) : base(name)
 {
 }
 public FAssetRegistryExportPath(FNameEntrySerialized classs, FNameEntrySerialized objectt, FNameEntrySerialized package)
 {
     Class   = new FName(classs.Name);
     Object  = new FName(objectt.Name);
     Package = new FName(package.Name);
 }
 public IntPointPropertyData(FName name) : base(name)
 {
 }
Beispiel #22
0
        public void _dropdownWorker_SelectedIndexChanged(object sender, EventArgs e)
        {
            string        WorkerID = _dropdownWorker.SelectedValue.ToString();
            String        Conn     = ConfigurationManager.ConnectionStrings["ConnString_WEB_ASSET_DB"].ConnectionString;
            SqlConnection Connect  = new SqlConnection(Conn);

            Connect.Open();
            SqlCommand Cmd = new SqlCommand("SELECT COUNT (*) FROM BADGE WHERE WORKERID=@WorkerID", Connect);

            Cmd.Parameters.AddWithValue("@WorkerID", WorkerID);
            Int32 Count = (Int32)Cmd.ExecuteScalar();

            Connect.Close();
            if (Count == 0)
            {
                Connect.Open();
                Cmd = new SqlCommand("SELECT WORKERID, WORKERIMAGE, WORKERFNAME, WORKERLNAME, WORKERDOB FROM WORKER WHERE WORKERID=@WorkerID", Connect);
                Cmd.Parameters.AddWithValue("@WorkerID", WorkerID);
                SqlDataReader Reader = Cmd.ExecuteReader();
                while (Reader.Read())
                {
                    _labelID.Text         = Reader["WORKERID"].ToString();
                    _imageWorker.ImageUrl = Reader["WORKERIMAGE"].ToString();
                    //_txtValidFrom.Text = Reader["BADGEFROM"].ToString();
                    //_txtValidTo.Text = Reader["BADGETO"].ToString();
                    string   FirstName   = Reader["WORKERFNAME"].ToString();
                    string   DateOfBirth = Reader["WORKERDOB"].ToString();
                    DateTime DOB         = Convert.ToDateTime(DateOfBirth);
                    string   Birthdate   = DOB.Date.ToString("MM/dd/yyyy");
                    string   FName;
                    if (FirstName.Length < 4)
                    {
                        FName = FirstName + "0";
                        FName = FName.Substring(0, 4);
                    }
                    else
                    {
                        FName = FirstName.Substring(0, 4);
                    }
                    int    IdWork = Convert.ToInt32(_labelID.Text);
                    string WorkID = IdWork.ToString("00000");
                    _txtBadgeCode.Text = WorkID + FName.Replace(" ", string.Empty) + Birthdate.Replace("/", string.Empty);
                    _txtBadgeCode.Text = _txtBadgeCode.Text.ToUpper();
                    _txtValidFrom.Text = "";
                    _txtValidTo.Text   = "";
                    _dropdownBadgeStat.ClearSelection();
                }
                Connect.Close();
                Cmd.Parameters.Clear();
            }
            else
            {
                Connect.Open();
                Cmd = new SqlCommand("SELECT BADGE.WORKERID, WORKERIMAGE, WORKERFNAME, WORKERLNAME, WORKERDOB, BADGE.BADGEFROM, BADGE.BADGETO,BADGE.BADGESTAT FROM WORKER JOIN BADGE ON BADGE.WORKERID=WORKER.WORKERID WHERE BADGE.WORKERID=@WorkerID", Connect);
                Cmd.Parameters.AddWithValue("@WorkerID", WorkerID);
                SqlDataReader Reader = Cmd.ExecuteReader();
                while (Reader.Read())
                {
                    _labelID.Text         = Reader["WORKERID"].ToString();
                    _imageWorker.ImageUrl = Reader["WORKERIMAGE"].ToString();
                    //_txtValidFrom.Text = Reader["BADGEFROM"].ToString();
                    //_txtValidTo.Text = Reader["BADGETO"].ToString();
                    DateTime From = Convert.ToDateTime(Reader["BADGEFROM"].ToString());
                    DateTime To   = Convert.ToDateTime(Reader["BADGETO"].ToString());
                    _txtValidFrom.Text = From.ToString("MM/dd/yyyy");
                    _txtValidTo.Text   = To.ToString("MM/dd/yyyy");
                    string   FirstName   = Reader["WORKERFNAME"].ToString();
                    string   DateOfBirth = Reader["WORKERDOB"].ToString();
                    DateTime DOB         = Convert.ToDateTime(DateOfBirth);
                    string   Birthdate   = DOB.Date.ToString("MM/dd/yyyy");
                    string   FName;
                    if (FirstName.Length < 4)
                    {
                        FName = FirstName + "0";
                        FName = FName.Substring(0, 4);
                    }
                    else
                    {
                        FName = FirstName.Substring(0, 4);
                    }
                    int    IdWork = Convert.ToInt32(_labelID.Text);
                    string WorkID = IdWork.ToString("00000");
                    _txtBadgeCode.Text = WorkID + FName.Replace(" ", string.Empty) + Birthdate.Replace("/", string.Empty);
                    _txtBadgeCode.Text = _txtBadgeCode.Text.ToUpper();
                    _dropdownBadgeStat.SelectedValue = Reader["BADGESTAT"].ToString();
                }
                Connect.Close();
                Cmd.Parameters.Clear();
            }
        }
Beispiel #23
0
        public void Upload()
        {
            HttpPostedFile hpFile = _FormFile.PostedFile;

            if (hpFile == null || hpFile.FileName.Trim() == "")
            {
                _Error = 1;
                return;
            }
            string Ext = GetExt(hpFile.FileName);

            if (!IsUpload(Ext))
            {
                _Error = 2;
                return;
            }
            int iLen = hpFile.ContentLength;

            if (iLen > _MaxSize)
            {
                _Error = 3;
                return;
            }
            try
            {
                if (!Directory.Exists(_SavePath))
                {
                    Directory.CreateDirectory(_SavePath);
                }
                byte[] bData = new byte[iLen];
                hpFile.InputStream.Read(bData, 0, iLen);
                string FName;
                FName = FileName(Ext);
                string TempFile = "";
                if (_IsDraw)
                {
                    TempFile = FName.Split('.').GetValue(0).ToString() + "_temp." + FName.Split('.').GetValue(1).ToString();
                }
                else
                {
                    TempFile = FName;
                }
                FileStream newFile = new FileStream(_SavePath + TempFile, FileMode.Create);
                newFile.Write(bData, 0, bData.Length);
                newFile.Flush();
                int _FileSizeTemp = hpFile.ContentLength;

                string ImageFilePath = _SavePath + FName;
                if (_IsDraw)
                {
                    if (_DrawStyle == 0)
                    {
                        System.Drawing.Image Img1 = System.Drawing.Image.FromStream(newFile);
                        Graphics             g    = Graphics.FromImage(Img1);
                        g.DrawImage(Img1, 100, 100, Img1.Width, Img1.Height);
                        Font   f       = new Font(_Font, _FontSize);
                        Brush  b       = new SolidBrush(Color.Red);
                        string addtext = _AddText;
                        g.DrawString(addtext, f, b, _DrawString_x, _DrawString_y);
                        g.Dispose();
                        Img1.Save(ImageFilePath);
                        Img1.Dispose();
                    }
                    else
                    {
                        System.Drawing.Image image     = System.Drawing.Image.FromStream(newFile);
                        System.Drawing.Image copyImage = System.Drawing.Image.FromFile(_CopyIamgePath);
                        Graphics             g         = Graphics.FromImage(image);
                        g.DrawImage(copyImage, new Rectangle(image.Width - copyImage.Width - 5, image.Height - copyImage.Height - 5, copyImage.Width, copyImage.Height), 0, 0, copyImage.Width, copyImage.Height, GraphicsUnit.Pixel);
                        g.Dispose();
                        image.Save(ImageFilePath);
                        image.Dispose();
                    }
                }

                //获取图片的高度和宽度
                System.Drawing.Image Img = System.Drawing.Image.FromStream(newFile);
                _Width  = Img.Width;
                _Height = Img.Height;

                //生成缩略图部分
                if (_IsCreateImg)
                {
                    #region 缩略图大小只设置了最大范围,并不是实际大小
                    float realbili = (float)_Width / (float)_Height;
                    float wishbili = (float)_sWidth / (float)_sHeight;

                    //实际图比缩略图最大尺寸更宽矮,以宽为准
                    if (realbili > wishbili)
                    {
                        _sHeight = (int)((float)_sWidth / realbili);
                    }
                    //实际图比缩略图最大尺寸更高长,以高为准
                    else
                    {
                        _sWidth = (int)((float)_sHeight * realbili);
                    }
                    #endregion

                    this.OutThumbFileName = FName.Split('.').GetValue(0).ToString() + "_s." + FName.Split('.').GetValue(1).ToString();
                    string ImgFilePath = _SavePath + this.OutThumbFileName;

                    System.Drawing.Image newImg = Img.GetThumbnailImage(_sWidth, _sHeight, null, System.IntPtr.Zero);
                    newImg.Save(ImgFilePath);
                    newImg.Dispose();
                    _Iss = true;
                }

                if (_IsDraw)
                {
                    if (File.Exists(_SavePath + FName.Split('.').GetValue(0).ToString() + "_temp." + FName.Split('.').GetValue(1).ToString()))
                    {
                        newFile.Dispose();
                        File.Delete(_SavePath + FName.Split('.').GetValue(0).ToString() + "_temp." + FName.Split('.').GetValue(1).ToString());
                    }
                }
                newFile.Close();
                newFile.Dispose();
                _OutFileName = FName;
                _FileSize    = _FileSizeTemp;
                _Error       = 0;
                return;
            }
            catch (Exception ex)
            {
                _Error = 4;
                return;
            }
        }
Beispiel #24
0
        public override int Write(AssetBinaryWriter writer, bool includeHeader)
        {
            if (Value.Length > 0)
            {
                ArrayType = Value[0].PropertyType;
            }

            if (includeHeader)
            {
                writer.Write(ArrayType);
                writer.WritePropertyGuid(PropertyGuid);
            }

            int here = (int)writer.BaseStream.Position;

            writer.Write(Value.Length);
            if (ArrayType.Value.Value == "StructProperty" && ShouldSerializeStructsDifferently)
            {
                if (Value.Length == 0 && DummyStruct == null)
                {
                    throw new InvalidOperationException("No dummy struct present in an empty StructProperty array, cannot serialize");
                }
                if (Value.Length > 0)
                {
                    DummyStruct = (StructPropertyData)Value[0];
                }

                FName fullType = DummyStruct.StructType;

                int lengthLoc = -1;
                if (writer.Asset.EngineVersion >= UE4Version.VER_UE4_INNER_ARRAY_TAG_INFO)
                {
                    writer.Write(DummyStruct.Name);
                    writer.Write(new FName("StructProperty"));
                    lengthLoc = (int)writer.BaseStream.Position;
                    writer.Write((long)0);
                    writer.Write(fullType);
                    if (writer.Asset.EngineVersion >= UE4Version.VER_UE4_STRUCT_GUID_IN_PROPERTY_TAG)
                    {
                        writer.Write(DummyStruct.StructGUID.ToByteArray());
                    }
                    if (writer.Asset.EngineVersion >= UE4Version.VER_UE4_PROPERTY_GUID_IN_PROPERTY_TAG)
                    {
                        writer.Write((byte)0);
                    }
                }

                for (int i = 0; i < Value.Length; i++)
                {
                    ((StructPropertyData)Value[i]).StructType = fullType;
                    Value[i].Offset = writer.BaseStream.Position;
                    Value[i].Write(writer, false);
                }

                if (writer.Asset.EngineVersion >= UE4Version.VER_UE4_INNER_ARRAY_TAG_INFO)
                {
                    int fullLen = (int)writer.BaseStream.Position - lengthLoc;
                    int newLoc  = (int)writer.BaseStream.Position;
                    writer.Seek(lengthLoc, SeekOrigin.Begin);
                    writer.Write(fullLen - 32 - (includeHeader ? 1 : 0));
                    writer.Seek(newLoc, SeekOrigin.Begin);
                }
            }
            else
            {
                for (int i = 0; i < Value.Length; i++)
                {
                    Value[i].Offset = writer.BaseStream.Position;
                    Value[i].Write(writer, false);
                }
            }

            return((int)writer.BaseStream.Position - here);
        }
Beispiel #25
0
 public FMeshBoneInfo(FName name, int parentIndex)
 {
     Name        = name;
     ParentIndex = parentIndex;
 }
Beispiel #26
0
 public ArrayPropertyData(FName name) : base(name)
 {
     Value = new PropertyData[0];
 }
Beispiel #27
0
        internal static BaseProperty ReadAsObject(PackageReader reader, FPropertyTag tag, FName type, ReadType readType)
        {
            BaseProperty prop = type.String switch
            {
                "ByteProperty" => new ByteProperty(reader, readType),
                "BoolProperty" => new BoolProperty(reader, tag, readType),
                "IntProperty" => new IntProperty(reader),
                "FloatProperty" => new FloatProperty(reader),
                "ObjectProperty" => new ObjectProperty(reader),
                "NameProperty" => new NameProperty(reader),
                "DelegateProperty" => new DelegateProperty(reader),
                "DoubleProperty" => new DoubleProperty(reader),
                "ArrayProperty" => new ArrayProperty(reader, tag),
                "StructProperty" => new StructProperty(reader, tag),
                "StrProperty" => new StrProperty(reader),
                "TextProperty" => new TextProperty(reader),
                "InterfaceProperty" => new InterfaceProperty(reader),
                //"MulticastDelegateProperty" => new MulticastDelegateProperty(reader, tag),
                //"LazyObjectProperty" => new LazyObjectProperty(reader, tag),
                "SoftObjectProperty" => new SoftObjectProperty(reader, readType),
                "AssetObjectProperty" => new SoftObjectProperty(reader, readType),
                "UInt64Property" => new UInt64Property(reader),
                "UInt32Property" => new UInt32Property(reader),
                "UInt16Property" => new UInt16Property(reader),
                "Int64Property" => new Int64Property(reader),
                "Int16Property" => new Int16Property(reader),
                "Int8Property" => new Int8Property(reader),
                "MapProperty" => new MapProperty(reader, tag),
                "SetProperty" => new SetProperty(reader, tag),
                "EnumProperty" => new EnumProperty(reader),
                _ => null, //throw new NotImplementedException($"Parsing of {type.String} types aren't supported yet."),
            };

            return(prop);
        }
Beispiel #28
0
        public override void Read(AssetBinaryReader reader, bool includeHeader, long leng1, long leng2 = 0)
        {
            if (includeHeader)
            {
                ArrayType    = reader.ReadFName();
                PropertyGuid = reader.ReadPropertyGuid();
            }

            int numEntries = reader.ReadInt32();

            if (ArrayType.Value.Value == "StructProperty" && ShouldSerializeStructsDifferently)
            {
                var results = new PropertyData[numEntries];

                FName name         = this.Name;
                long  structLength = 1;
                FName fullType     = new FName("Generic");
                Guid  structGUID   = new Guid();

                if (reader.Asset.EngineVersion >= UE4Version.VER_UE4_INNER_ARRAY_TAG_INFO)
                {
                    name = reader.ReadFName();
                    if (name.Value.Value.Equals("None"))
                    {
                        Value = results;
                        return;
                    }

                    FName thisArrayType = reader.ReadFName();
                    if (thisArrayType.Value.Value.Equals("None"))
                    {
                        Value = results;
                        return;
                    }

                    if (thisArrayType.Value.Value != ArrayType.Value.Value)
                    {
                        throw new FormatException("Invalid array type: " + thisArrayType.ToString() + " vs " + ArrayType.ToString());
                    }

                    structLength = reader.ReadInt64(); // length value
                    fullType     = reader.ReadFName();
                    structGUID   = new Guid(reader.ReadBytes(16));
                    reader.ReadPropertyGuid();
                }

                if (numEntries == 0)
                {
                    DummyStruct = new StructPropertyData(name, fullType)
                    {
                        StructGUID = structGUID
                    };
                }
                else
                {
                    for (int i = 0; i < numEntries; i++)
                    {
                        var data = new StructPropertyData(name, fullType);
                        data.Offset = reader.BaseStream.Position;
                        data.Read(reader, false, structLength);
                        data.StructGUID = structGUID;
                        results[i]      = data;
                    }
                    DummyStruct = (StructPropertyData)results[0];
                }
                Value = results;
            }
            else
            {
                var results = new PropertyData[numEntries];
                if (numEntries > 0)
                {
                    int averageSizeEstimate1 = (int)(leng1 / numEntries);
                    int averageSizeEstimate2 = (int)((leng1 - 4) / numEntries);
                    for (int i = 0; i < numEntries; i++)
                    {
                        results[i]        = MainSerializer.TypeToClass(ArrayType, new FName(i.ToString(), int.MinValue), reader.Asset);
                        results[i].Offset = reader.BaseStream.Position;
                        if (results[i] is StructPropertyData)
                        {
                            ((StructPropertyData)results[i]).StructType = new FName("Generic");
                        }
                        results[i].Read(reader, false, averageSizeEstimate1, averageSizeEstimate2);
                    }
                }
                Value = results;
            }
        }
Beispiel #29
0
 public SmartNamePropertyData(FName name) : base(name)
 {
 }
        public void FillFormForDiscipline(string discipline, string examinationNumber, string examinationName, string appleant, string fName, string mName, string lName, string aka,
                                          string lastFourSSN, string contactPhone, string mailingAddress, string city, string state, string zip, string email, string cEmail, string empNumber,
                                          string payroll, string department, string appealIssue, string notificationDocument, string attachmentDesciption, string classificationDoc, string ClassificationDocDesc, string remedy
                                          )
        {
            // SubmitAppeal.Clicks();
            BtnIAgree.Clicks();

            DisciplineHeadingID.Clicks();
            if (discipline.Contains("1-5 day Suspension") || discipline.Contains("LayOff") ||
                discipline.Contains("Probationary Discharge") || discipline.Contains("Probationary Reduction") ||
                discipline.Contains("Reduction due to Lay-Off") || discipline.Contains("Release From Temporary Employment") ||
                discipline.Contains("Transfer") || discipline.Contains("Resignation"))
            {
                if (discipline.Contains("1-5 day Suspension"))
                {
                    Suspension.Clicks();
                }
                else if (discipline.Contains("LayOff"))
                {
                    LayOff.Clicks();
                }
                else if (discipline.Contains("Probationary Discharge"))
                {
                    ProbationaryDischarge.Clicks();
                }
                else if (discipline.Contains("Probationary Reduction"))
                {
                    ProbationaryReduction.Clicks();
                }
                else if (discipline.Contains("Reduction due to Lay-Off"))
                {
                    ReductionDueToLayOff.Clicks();
                }
                else if (discipline.Contains("Release From Temporary Employment"))
                {
                    ReleaseFromTemporaryEmployment.Clicks();
                }
                else if (discipline.Contains("Transfer"))
                {
                    Transfer.Clicks();
                }
                else if (discipline.Contains("Resignation"))
                {
                    Resignation.Clicks();
                }
                if (appleant.Contains("Yourself"))
                {
                    FillingYourSelf.Click();
                }
                FName.EnterText(fName);
                MName.EnterText(mName);
                LName.EnterText(lName);
                Aka.EnterText(aka);
                LastFourSSN.EnterText(lastFourSSN);
                ContactPhone.EnterText(contactPhone);
                MailingAddress.EnterText(mailingAddress);
                City.EnterText(city);
                State.ClearText(state);
                ZipCode.EnterText(zip);
                PreferredEmail.EnterText(email);
                ConfirmEmail.EnterText(cEmail);
                EmployeeNumber.EnterText(empNumber);
                Payroll.EnterText(payroll);
                EmployingDepartment.EnterText(department);
                AppealIssue.EnterText(appealIssue);
                Attach.Clicks();
                Browse.UploadFile(notificationDocument);
                AttachmentDescription.EnterText(attachmentDesciption);
                Remedy.SendKeys(remedy);
                SubmitBtn.Clicks();
                AcceptPopupBtn.Clicks();
            }

            else if (discipline.Contains("ClassificationStudy"))
            {
                ClassificationStudy.Clicks();
                ExaminationNumber.SendKeys(examinationNumber);
                ExaminationName.SendKeys(examinationName);
                if (appleant == "Yourself")
                {
                    FillingYourSelf.Click();
                }
                FName.EnterText(fName);
                MName.EnterText(mName);
                LName.EnterText(lName);
                Aka.EnterText(aka);
                LastFourSSN.EnterText(lastFourSSN);
                ContactPhone.EnterText(contactPhone);
                MailingAddress.EnterText(mailingAddress);
                City.EnterText(city);
                State.ClearText(state);
                ZipCode.EnterText(zip);
                PreferredEmail.EnterText(email);
                ConfirmEmail.EnterText(cEmail);
                EmployeeNumber.EnterText(empNumber);
                Payroll.EnterText(payroll);
                EmployingDepartment.EnterText(department);
                AppealIssue.EnterText(appealIssue);
                Attach.Clicks();
                Browse.UploadFile(notificationDocument);
                AttachmentDescription.EnterText(attachmentDesciption);
                AttachAdditional.Clicks();
                BrowseAdditional.UploadFile(classificationDoc);
                DescriptionAdditional.EnterText(ClassificationDocDesc);
                Remedy.SendKeys(remedy);
                SubmitBtn.Clicks();
                AcceptPopupBtn.Clicks();
            }
        }