//============================================================ // <T>数据打包。</T> // // @return 设置内容的位置 //============================================================ public string Pack() { StringBuilder buffer = new StringBuilder(); for (int n = 0; n < _count; n++) { // value返回的值 string name = _names[n]; string value = _values[n]; if (RString.IsBlank(name)) { throw new Exception("Name is invalid."); } // 得到名称的长度及名称长度所占的位数 int nameLength = name.Length; int nameLLength = nameLength.ToString().Length; // 得到值的长度及值长度所占的位数 string valueString = "0"; if (!RString.IsBlank(value)) { int valueLength = value.Length; int valueLLength = valueLength.ToString().Length; valueString = valueLLength.ToString() + valueLength.ToString() + value; } // 接受返回的字符串 string itemPack = nameLLength.ToString() + nameLength.ToString() + name + valueString; // 使用StringBuilder进行字符串追加 buffer.Append(itemPack); } return(buffer.ToString()); }
//============================================================ // <T>过滤数据。</T> //============================================================ public void DoFilter() { bool filterValue = !RString.IsBlank(_filterValue); // 加载子目录 lvResources.BeginUpdate(); lvResources.Items.Clear(); //foreach(INamePair<FRsResource> pair in _resources) { // FRsResource resource = pair.Value; // //SDsResourceTag tag = resource.Tag as SDsResourceTag; // //if(tag.item == null) { // // continue; // //} // //ListViewItem qItem = tag.item as ListViewItem; // //// 是否含有内容 // //if(filterValue) { // // if(!tag.key.Contains(_filterValue)) { // // continue; // // } // //} // // 增加内容 // lvResources.Items.Add(qItem); //} lvResources.EndUpdate(); }
//============================================================ private void DoOk() { string value = txtInput.Text; if (!RString.IsBlank(value)) { DialogResult = DialogResult.OK; } }
public override bool DoCheck(FValidatorParameters parameters) { string value = RString.Nvl(parameters.Value); if (RString.IsBlank(value)) { parameters.Description = _resource.FindDisplay(MSG_IS_BLANK, _description); return(false); } return(true); }
//============================================================ public void DoAfterLabelEdit(NodeLabelEditEventArgs e) { TreeNode node = e.Node; string label = e.Label; if (RString.IsBlank(label)) { // 取消修改 if (null == node.Tag) { // 删除新节点 if (null == node.Parent) { Nodes.Remove(node); } else { node.Parent.Nodes.Remove(node); } } node.EndEdit(false); e.CancelEdit = true; } else { // 确定修改 node.Text = e.Label; node.EndEdit(true); e.CancelEdit = false; // 修改资源目录 FCfgObject cfgObject = node.Tag as FCfgObject; if (null == cfgObject) { FCfgFolder cfgFolder = null; if (null == node.Parent) { cfgFolder = _folder; } else { cfgFolder = node.Parent.Tag as FCfgFolder; } node.Tag = cfgFolder.CreateFolder(label); } } }
//============================================================ // <T>序列化内部数据到输出流。</T> // // @param output 输出流 //============================================================ public void SerializeInfo(IOutput output) { // 修正数据 if (RString.IsBlank(_effectName)) { _effectName = "automatic"; } else if (_effectName == "skeleton.4") { _effectName = "skeleton"; } // 存储属性 output.WriteString(_effectName); output.WriteString(_transformName); // 存储设置 output.WriteInt8((sbyte)_optionLight); output.WriteInt8((sbyte)_optionMerge); output.WriteInt8((sbyte)_optionSort); output.WriteInt32(_sortLevel); output.WriteInt8((sbyte)_optionAlpha); output.WriteInt8((sbyte)_optionDepth); output.WriteString(_optionCompare); output.WriteInt8((sbyte)_optionDouble); output.WriteInt8((sbyte)_optionShadow); output.WriteInt8((sbyte)_optionShadowSelf); output.WriteInt8((sbyte)_optionDynamic); output.WriteInt8((sbyte)_optionTransmittance); output.WriteInt8((sbyte)_optionOpacity); // 存储纹理 output.WriteFloat(_coordRateWidth); output.WriteFloat(_coordRateHeight); // 存储颜色 output.WriteFloat(_colorMin); output.WriteFloat(_colorMax); output.WriteFloat(_colorRate); output.WriteFloat(_colorMerge); // 存储透明 output.WriteFloat(_alphaBase); output.WriteFloat(_alphaRate); output.WriteFloat(_alphaLevel); output.WriteFloat(_alphaMerge); // 存储属性 _ambientColor.Serialize(output); output.WriteFloat(_ambientShadow); _diffuseColor.Serialize(output); output.WriteFloat(_diffuseShadow); _diffuseViewColor.Serialize(output); output.WriteFloat(_diffuseViewShadow); _specularColor.Serialize(output); output.WriteFloat(_specularBase); output.WriteFloat(_specularRate); output.WriteFloat(_specularAverage); output.WriteFloat(_specularShadow); _specularViewColor.Serialize(output); output.WriteFloat(_specularViewBase); output.WriteFloat(_specularViewRate); output.WriteFloat(_specularViewAverage); output.WriteFloat(_specularViewShadow); // 存储反射 _reflectColor.Serialize(output); output.WriteFloat(_reflectMerge); output.WriteFloat(_reflectShadow); // 存储折射 _refractFrontColor.Serialize(output); _refractBackColor.Serialize(output); // 存储不透明度 _opacityColorColor.Serialize(output); output.WriteFloat(_opacityRate); output.WriteFloat(_opacityAlpha); output.WriteFloat(_opacityDepth); output.WriteFloat(_opacityTransmittance); // 存储自发光 _emissiveColor.Serialize(output); }
public static bool IsBlank(RString sNow) { return(RString.IsBlank(sNow)); }