예제 #1
0
        private void OnOptionClicked()
        {
            optionState[0] = true;
            optionState[1] = propertyDicTemp != null && propertyDicTemp.Count > 0;
            optionState[2] = propertyDic != null && propertyDic.Count > 0;
            optionState[3] = propertyCatchedDic != null && propertyCatchedDic.Count > 0;
            optionState[4] = ID != 0;
            optionState[5] = ID != 0;

            PopOption.Instence.ShowPop(options, optionState, (index) =>
            {
                if (index == 0)
                {
                    typeTemp = layerDefine.type;
                    propertyDicTemp.Clear();
                    CopyDictionary(propertyDic, propertyDicTemp);
                }
                else if (index == 1)
                {
                    if (typeTemp != layerDefine.type)
                    {
                        var @continue = DialogHelper.ShowDialog("提示", "类型不一致,是否强制粘贴?", "粘贴", "取消");
                        if (!@continue)
                        {
                            return;
                        }
                    }

                    CopyDictionary(propertyDicTemp, propertyDic);
                    UpdateView();
                }
                else if (index == 2)
                {
                    propertyDic.Clear();
                    UpdateView();
                }
                else if (index == 3)
                {
                    CopyDictionary(propertyCatchedDic, propertyDic);
                    UpdateView();
                }
                else if (index == 4)
                {
                    if (onMainControl != null)
                    {
                        onMainControl.Invoke(this);
                    }
                }
                else if (index == 5)
                {
                    if (onGenInstenceControl != null)
                    {
                        onGenInstenceControl.Invoke(this);
                    }
                }
            });
        }
예제 #2
0
 public void CopyToDic(ResourceDic target)
 {
     target.Clear();
     CopyDictionary(propertyDic, target);
 }