Пример #1
0
        public static EditTemplate Open(TemplateSet template)
        {
            var window = GetWindow<EditTemplate>();
            window.Init(template);

            return window;
        }
Пример #2
0
        private void GUI4SelectTempalte(TemplateSet template)
        {
            EditorGUILayout.BeginHorizontal();

            template.Extension = EditorGUILayout.TextField("Extension: ", template.Extension);
            if(GUILayout.Button("Select")) {
                EditTemplate.Open(template);
            }

            EditorGUILayout.EndHorizontal();
        }
Пример #3
0
 internal ItemTemplate GetTemplate(TemplateSet ts)
 {
     int currentTemplateIndex = this.CurrentTemplateIndex;
     if ((currentTemplateIndex < 0) || (currentTemplateIndex >= ts.Count))
     {
         if ((this.m_parent != null) && (this.m_parent.Parent != null))
         {
             return this.m_parent.Parent.DefaultTemplates[this.Selected ? 1 : 0];
         }
         return null;
     }
     return ts[currentTemplateIndex];
 }
Пример #4
0
 internal int GetHeight(TemplateSet ts)
 {
     int currentTemplateIndex = this.CurrentTemplateIndex;
     if ((currentTemplateIndex < 0) || (currentTemplateIndex >= ts.Count))
     {
         if ((this.m_parent != null) && (this.m_parent.Parent != null))
         {
             return this.m_parent.Parent.DefaultTemplates[this.Selected ? 1 : 0].Height;
         }
         return -1;
     }
     return ts[currentTemplateIndex].GetHeight(this);
 }
Пример #5
0
        private void Init(TemplateSet template)
        {
            if(template == null) { this.Close(); }

            this.previousLabel = template.label;
            this.template = template;

            Action repaint = () => this.Repaint();
            this.ignores = new StringListField("Paths that ignore", repaint, this.template.ignores);
            this.considers = new StringListField("Paths that consider", repaint, this.template.considers);
            this.functions = new ListField<ExecutorFunctionSet>("Executor functions",
                (index, value) => this.GUI4ExecutorFunction(index, value),
                repaint,
                this.template.functions);

            this.functions.ShowHorizontalScrollBar = false;
            this.efpath = Getters4Editor.GetExecutorFunctionsPath(MetadataHolder.Instance);
            this.efobject = Getters4Editor.GetExecutorFunctionsObject(MetadataHolder.Instance);

            this.titleContent.text = "Edit Template";
            this.titleContent.tooltip = "Edit Template Window";
        }
Пример #6
0
 internal int GetHeight(int i, TemplateSet ts)
 {
     if ((i < 0) || (i >= base.List.Count))
     {
         return 0;
     }
     ListItem item = (ListItem) base.InnerList[i];
     int height = this.GetTemplate(item).GetHeight(item);
     if (this.Parent.List.GridLines)
     {
         height++;
     }
     return height;
 }
Пример #7
0
 internal int Draw(Graphics gr, TemplateSet ts, int width, int ymax, int iItem, int iItemOffset, ref bool resetScrollbar)
 {
     int num = (((this.Parent != null) && this.Parent.RightToLeft) && this.Parent.List.ScrollbarVisible) ? this.Parent.List.ClientScrollbarWidth : 0;
     int yOffset = iItemOffset;
     int count = base.List.Count;
     this.LastDrawnItemOffset = yOffset;
     this.LastDrawnItem = iItem;
     while (this.LastDrawnItem < count)
     {
         ListItem item = null;
         if ((this.LastDrawnItem >= 0) && (this.LastDrawnItem < base.InnerList.Count))
         {
             item = base.InnerList[this.LastDrawnItem] as ListItem;
         }
         if (item != null)
         {
             ItemTemplate template = item.GetTemplate(ts);
             int height = 0;
             int num5 = -1;
             if (template.CustomizeCells(item))
             {
                 num5 = template.GetHeight(item);
                 item.ResetCachedBounds();
             }
             height = template.GetHeight(item);
             if ((num5 >= 0) && (height != num5))
             {
                 resetScrollbar = true;
             }
             if ((yOffset + height) >= 0)
             {
                 template.Draw(gr, 0, yOffset, item, width, height);
             }
             this.LastDrawnItemOffset = yOffset;
             yOffset += height;
             if (this.Parent.List.GridLines)
             {
                 gr.DrawLine(this.m_penBorder, num, yOffset, width + num, yOffset);
                 yOffset++;
             }
             if (yOffset > ymax)
             {
                 return yOffset;
             }
         }
         this.LastDrawnItem++;
     }
     this.LastDrawnItemOffset = yOffset;
     return yOffset;
 }
Пример #8
0
 protected override void Dispose(bool disposing)
 {
     if (sBrushes != null)
     {
         sBrushes.Clear();
     }
     sBrushes = null;
     if (disposing && (this.m_list != null))
     {
         this.m_list.Dispose();
         this.m_list = null;
     }
     this.m_items = null;
     this.m_tsCurrent = null;
     if (this.m_alLinks != null)
     {
         this.m_alLinks.Clear();
     }
     this.m_alLinks = null;
     if (this.m_alTooltips != null)
     {
         this.m_alTooltips.Clear();
     }
     this.m_alTooltips = null;
     if (this.m_alButtons != null)
     {
         this.m_alButtons.Clear();
     }
     this.m_alButtons = null;
     if (this.m_dbConnector != null)
     {
         this.m_dbConnector.Dispose();
         this.m_dbConnector = null;
     }
     this.ButtonClick = null;
     this.CellClick = null;
     this.LinkClick = null;
     this.DropDown = null;
     this.DropDownClosed = null;
     this.SelectedIndexChanged = null;
     this.SelectedValueChanged = null;
     this.ValueMemberChanged = null;
     this.DisplayMemberChanged = null;
     Utility.Dispose();
     Links.Dispose();
     Resco.Controls.AdvancedComboBox.Mapping.DisposeEmptyMapping();
     ImageCache.GlobalCache.Clear();
     GC.Collect();
     base.Dispose(disposing);
 }
Пример #9
0
 public AdvancedComboBox()
 {
     this.OnChangeHandler = new OnChangeDelegate(this.OnChangeSafe);
     this.OnItemRemovedHandler = new OnItemRemovedDelegate(this.OnItemRemovedSafe);
     base.AutoScroll = false;
     base.Size = new Size(100, 0x12);
     this.m_dbConnector = new Resco.Controls.AdvancedComboBox.DataConnector();
     this.m_connector = this.m_dbConnector;
     this.m_bKeyNavigation = true;
     this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.m_list = new AdvancedList(this);
     this.m_list.Capture = false;
     this.m_list.Visible = false;
     this.m_list.TouchScrolling = false;
     this.m_list.BorderStyle = this.BorderStyle;//.set_BorderStyle(this.BorderStyle);
     this.m_list.Size = new Size(0, 0);
     this.m_list.ItemSelect += new ItemEventHandler(this.OnItemSelect);
     this.m_list.Changed += new ComboBoxEventHandler(this.OnChange);
     this.SelectedIndexChanged = null;
     this.SelectedValueChanged = null;
     this.ValueMemberChanged = null;
     this.DisplayMemberChanged = null;
     this.m_items = new ItemCollection(this);
     this.m_items.Changed += new ComboBoxEventHandler(this.OnChange);
     this.m_iExpectedItems = -1;
     this.m_nItemsLoaded = 0;
     this.m_nItemsInserted = 0;
     this.m_selectedItemIndex = -1;
     this.m_iSelectedCellIndex = -1;
     this.m_valueMember = "";
     this.m_displayMember = "";
     this.m_tsCurrent = new TemplateSet();
     this.m_tsCurrent.Parent = this;
     this.m_tsCurrent.Changed += new ComboBoxEventHandler(this.OnChange);
     this.m_textBoxTemplateIndex = 0;
     this.m_templateIndex = 0;
     this.m_selectedTemplateIndex = 0;
     this.m_alternateTemplateIndex = -1;
     this.m_grBackBuffer = null;
     this.m_backBuffer = null;
     this.m_colorKey = Color.FromArgb(0xff, 0, 0xff);
     this.m_brushKey = new SolidBrush(this.m_colorKey);
     this.m_imgAttr = new ImageAttributes();
     this.m_imgAttr.SetColorKey(this.m_colorKey, this.m_colorKey);
     this.UpdateDoubleBuffering();
     base.BackColor = SystemColors.ControlLight;
     this.m_BackColor = new SolidBrush(this.BackColor);
     this.m_Timer = new Timer();
     this.m_Timer.Enabled = false;
     this.m_Timer.Interval = 500;
     this.m_Timer.Tick += new EventHandler(this.OnTimerTick);
     this.m_bShowingToolTip = false;
     point1 = new Point(0, 0);
     point2 = new Point(0, -TooltipWidth);
     point3 = new Point(-TooltipWidth, 0);
     this.CalculateTextBoxArea();
 }