Exemple #1
0
 public object Convert(object[] value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value == null)
     {
         return(System.Windows.Visibility.Collapsed);
     }
     if ((int)value[0] == 0)
     {
         return(System.Windows.Visibility.Collapsed);
     }
     if (value.Length < 2)
     {
         return(System.Windows.Visibility.Collapsed);
     }
     if ((value[1] as System.Windows.Controls.ItemCollection).Count == 0)
     {
         return(System.Windows.Visibility.Collapsed);
     }
     else
     {
         foreach (var item in (value[1] as System.Windows.Controls.ItemCollection))
         {
             DataClass.Attribute att = (item as DataClass.Attribute);
             if (att.Name != "guid" && att.IsGuid)
             {
                 return(System.Windows.Visibility.Visible);
             }
         }
     }
     return(System.Windows.Visibility.Collapsed);
 }
Exemple #2
0
 private void list_attributes_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     DataClass.Attribute li = (sender as ListView).SelectedItem as DataClass.Attribute;
     if (li != null)
     {
         Clipboard.SetText(li.ToString());
     }
 }
Exemple #3
0
 private bool IsAttributeRef(DataClass.Attribute att)
 {
     if (att.Name == "guid" || att.Name == "guidRef")
     {
         return(false);
     }
     return(att.IsGuid);
 }
        private void GenerateContextMenu(TreeViewItemData treeViewItemData)
        {
            //ContextMenu contextMenu = new ContextMenu();
            //contextMenu.AddHandler(ContextMenu.ContextMenuOpeningEvent, new ContextMenuEventHandler(ContextMenu_ContextMenuOpening));

            // itens que não precisão do app
            //if (!string.IsNullOrEmpty(treeViewItemData.Data.GuidRef))
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Find Ref Item";
            //    menuItem.Click += MenuFindRef_Click;
            //    contextMenu.Items.Add(menuItem);


            //}
            //if (!string.IsNullOrEmpty(treeViewItemData.Data.Guid))
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Copy Guid";
            //    menuItem.Icon = new System.Windows.Controls.Image() { Source = dataContext.CopyMenuItemImg };
            //    menuItem.Click += MenuCopyGuid_Click;
            //    contextMenu.Items.Add(menuItem);


            //}
            if (treeViewItemData.Data.ContainsAttribute("captionRef"))
            {
                MenuItemData menuItem = new MenuItemData();
                menuItem.Data   = treeViewItemData.Data;
                menuItem.Header = "Find Caption Ref";
                menuItem.Click += MenuItemFindCaptionRef_Click;
                //contextMenu.Items.Add(menuItem);
            }
            //if (treeViewItemData.Data.ContainsAttribute("itemRef"))
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Find Item Ref";
            //    menuItem.Click += MenuItemFindCaptionRef_Click;
            //    contextMenu.Items.Add(menuItem);
            //}
            for (int i = 0; i < treeViewItemData.Data.Attributes.Count; i++)
            {
                DataClass.Attribute att = treeViewItemData.Data.Attributes[i];
                if (att.Name != "captionRef" && att.Name != "guid" && att.Name != "guidRef" && att.IsGuid)
                {
                    MenuItemData menuItem = new MenuItemData();
                    menuItem.Data   = treeViewItemData.Data;
                    menuItem.Header = string.Format("Find {0}", att.Name);
                    menuItem.Tag    = att.Name;
                    menuItem.Click += MenuItemFindGenericRef_Click;
                    //contextMenu.Items.Add(menuItem);
                }
            }


            //MenuItemData menuItem4 = new MenuItemData();
            //menuItem4.Data = treeViewItemData.Data;
            //menuItem4.Header = "Xml";
            //menuItem4.Click += MenuItemXmlEncode_Click;
            //contextMenu.Items.Add(menuItem4);

            //if (!dataContext.InCorel)
            //    return contextMenu;



            //MenuItemData menuItem2 = new MenuItemData();
            //menuItem2.Data = treeViewItemData.Data;
            //menuItem2.Header = "Try Get Caption Text";
            //menuItem2.Click += MenuItemGetCaptionText_Click;
            //contextMenu.Items.Add(menuItem2);

            //MenuItemData menuItem6 = new MenuItemData();
            //menuItem6.Data = treeViewItemData.Data;
            //menuItem6.Header = "Try highlight this";
            //menuItem6.Click += MenuItemTryHighlight_Click;
            //menuItem6.Icon = new System.Windows.Controls.Image() { Source = dataContext.HighLightButtonImg };
            //contextMenu.Items.Add(menuItem6);

            //if (treeViewItemData.Data.GetType() == typeof(DataClass.CommandBarData))
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Try Show Command Bar";
            //    menuItem.Click += MenuItemshowCommandBar_Click;
            //    contextMenu.Items.Add(menuItem);

            //    MenuItemData menuItem3 = new MenuItemData();
            //    menuItem3.Data = treeViewItemData.Data;
            //    menuItem3.Header = "Try Hide Command Bar";
            //    menuItem3.Click += MenuItemHideCommandBar_Click;
            //    contextMenu.Items.Add(menuItem3);

            //    MenuItemData menuItem5 = new MenuItemData();
            //    menuItem5.Data = treeViewItemData.Data;
            //    menuItem5.Header = "Command Bar Mode";
            //    menuItem5.Click += MenuItemCommandBarMode_Click;
            //    contextMenu.Items.Add(menuItem5);

            //}
            //if (treeViewItemData.Data.GetType() == typeof(DataClass.OtherData))
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Try Show this";
            //    menuItem.Click += MenuItemshowItem_Click;
            //    contextMenu.Items.Add(menuItem);
            //}
            //if (treeViewItemData.Data.GetType() == typeof(DataClass.DialogData))
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Try Show Dialog";
            //    menuItem.Click += MenuItemshowDialog_Click;
            //    contextMenu.Items.Add(menuItem);

            //    MenuItemData menuItem3 = new MenuItemData();
            //    menuItem3.Data = treeViewItemData.Data;
            //    menuItem3.Header = "Try Hide Dialog";
            //    menuItem3.Click += MenuItemHideDialog_Click;
            //    contextMenu.Items.Add(menuItem3);
            //}
            //if (treeViewItemData.Data.GetType() == typeof(DataClass.DockerData))
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Try Show Docker";
            //    menuItem.Click += MenuItemshowDocker_Click;
            //    contextMenu.Items.Add(menuItem);

            //    MenuItemData menuItem3 = new MenuItemData();
            //    menuItem3.Data = treeViewItemData.Data;
            //    menuItem3.Header = "Try Hide Docker";
            //    menuItem3.Click += MenuItemHideDocker_Click;
            //    contextMenu.Items.Add(menuItem3);
            //}


            //if (treeViewItemData.Data.GetType() == typeof(DataClass.ItemData))
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Try Invoke Item";
            //    menuItem.Click += MenuItemInvoke_Click;
            //    contextMenu.Items.Add(menuItem);
            //}
            //if (treeViewItemData.Data.TagName == "dockers")
            //{
            //    MenuItemData menuItem = new MenuItemData();
            //    menuItem.Data = treeViewItemData.Data;
            //    menuItem.Header = "Get Dockers Caption";
            //    menuItem.Click += MenuItemGetDockerCaption_Click;
            //    contextMenu.Items.Add(menuItem);

            //    //MenuItemData menuItem12 = new MenuItemData();
            //    //menuItem12.Data = treeViewItemData.Data;
            //    //menuItem12.Header = "Get Dockers Guids";
            //    //menuItem12.Click += MenuItemGetDockersGuid_Click;
            //    //contextMenu.Items.Add(menuItem12);
            //}



            //return contextMenu;
        }
Exemple #5
0
 private void FindRefExec(DataClass.Attribute att)
 {
     core.FindByGuid(core.ListPrimaryItens.Childrens, att.Value);
 }