예제 #1
0
        private void GridModel_ExpandedField(IFieldModel fieldModel)
        {
            FieldRow row;

            if (!ModelRowMap.TryGetValue(fieldModel.ID, out row))
            {
                XRay.LogError("Row not found for model size {0}", ModelRowMap.Count);
                return;
            }

            row.Nodes.Clear();

            SyncRows(row.Model.Nodes, row.Nodes);

            for (int i = 0; i < FieldGrid.Columns.Count; i++)
            {
                FieldGrid.AutoResizeColumn(i);
            }
        }
예제 #2
0
 public FieldRow(IFieldModel model)
 {
     Model = model;
 }
예제 #3
0
        private void GridModel_ExpandedField(IFieldModel fieldModel)
        {
            FieldRow row;
            if (!ModelRowMap.TryGetValue(fieldModel.ID, out row))
            {
                XRay.LogError("Row not found for model size {0}", ModelRowMap.Count);
                return;
            }

            row.Nodes.Clear();

            SyncRows(row.Model.Nodes, row.Nodes);

            for (int i = 0; i < FieldGrid.Columns.Count; i++)
                FieldGrid.AutoResizeColumn(i);
        }
예제 #4
0
		public CodeVariable(CodeModelContext context, IFieldModel field)
			: base(context, field)
		{
			this.field = field;
		}
예제 #5
0
 public FieldRow(IFieldModel model)
 {
     Model = model;
 }
예제 #6
0
        private void Receive_Instance(XConnection connection, G2ReceivedPacket rawPacket)
        {
            // received by client from server

            var packet = InstancePacket.Decode(rawPacket.Root);

            XUI ui;

            if (!XRay.UIs.TryGetValue(packet.ThreadID, out ui))
            {
                Log("Receive Instance: UI not found for instance result");
                return;
            }

            if (ui.CurrentInstance == null)
            {
                Log("Receive Instance: Field not set");
                return;
            }

            bool        updateTree   = false;
            bool        updateFields = false;
            IFieldModel expandField  = null;

            var instance = ui.CurrentInstance;

            if (packet.Details != null)
            {
                instance.DetailsLabel = packet.Details;
            }

            if (packet.Columns != null)
            {
                instance.Columns = packet.Columns;
                updateTree       = true;
            }

            if (packet.Type == InstancePacketType.Root)
            {
                instance.RootNodes = packet.Fields;
                updateTree         = true;
                updateFields       = true;
            }
            else if (packet.Type == InstancePacketType.Field)
            {
                IFieldModel field;
                if (instance.FieldMap.TryGetValue(packet.FieldID, out field))
                {
                    field.Nodes = packet.Fields;
                }

                updateFields = true;
                expandField  = field;
            }
            else if (packet.Type == InstancePacketType.Refresh)
            {
                foreach (var field in packet.Fields)
                {
                    if (instance.FieldMap.ContainsKey(field.ID))
                    {
                        instance.FieldMap[field.ID].Cells = field.Cells;
                    }
                }

                updateTree = true; // cause recursive update of cells
                // dont update fields because already added, and would orphen fields associated with nodes
            }

            if (updateFields)
            {
                foreach (var field in packet.Fields)
                {
                    instance.FieldMap[field.ID] = field;
                }
            }

            // if we're geting fresh info, or refresh info with new columns
            if (updateTree && instance.UpdatedTree != null)
            {
                ui.Window.BeginInvoke(new Action(() => instance.UpdatedTree()));
            }

            if (expandField != null && instance.ExpandedField != null)
            {
                ui.Window.BeginInvoke(new Action(() => instance.ExpandedField(expandField)));
            }
        }