Example #1
0
        protected override void setupMatrices(ViewInfo curView, Shader curShader)
        {
            base.setupMatrices( curView,  curShader);

            GL.UniformMatrix4(curShader.rotationMatrixLocation2, false, ref orientation2);
            GL.UniformMatrix4(curShader.modelMatrixLocation2, false, ref modelMatrix2);
        }
Example #2
0
        protected override void setupMatrices(ref ViewInfo curView, ref Shader shader, ref Mesh curMesh)
        {
            base.setupMatrices(ref curView, ref shader, ref curMesh);

            shader.insertUniform(Shader.Uniform.rotation_matrix2, ref orientation2);
            shader.insertUniform(Shader.Uniform.model_matrix2, ref modelMatrix2);
        }
Example #3
0
 public ViewEditor(IViewContext viewContext, ViewInfo viewInfo)
 {
     InitializeComponent();
     ViewContext = viewContext;
     ViewInfo = OriginalViewInfo = viewInfo;
     _undoIndex = 0;
     _undoStack = new List<KeyValuePair<ViewInfo, IList<PropertyPath>>>();
     SetViewInfo(ViewInfo, new PropertyPath[0]);
     tbxViewName.Text = ViewSpec.Name;
     Icon = ViewContext.ApplicationIcon;
     _chooseColumnsTab = new ChooseColumnsTab {Dock = DockStyle.Fill};
     tabPageColumns.Controls.Add(_chooseColumnsTab);
     _filterTab = new FilterTab { Dock = DockStyle.Fill };
     tabPageFilter.Controls.Add(_filterTab);
     _sourceTab = new SourceTab{Dock = DockStyle.Fill};
     tabPageSource.Controls.Add(_sourceTab);
     _editorWidgets.AddRange(new ViewEditorWidget[] { _chooseColumnsTab, _filterTab, _sourceTab });
     foreach (var tab in _editorWidgets)
     {
         tab.SetViewEditor(this);
     }
     toolButtonShowAdvanced.Checked = ShowHiddenFields;
     if (!ShowHiddenFields)
     {
         tabControl1.TabPages.Remove(tabPageSource);
     }
 }
Example #4
0
 /// <summary>
 /// Pivoter Constructor.  Initializes many lists of ColumnDescriptors that
 /// get used while doing the work of expanding, aggregating, and pivoting.
 /// </summary>
 public Pivoter(ViewInfo viewInfo)
 {
     ViewInfo = viewInfo;
     var collectionColumnArray = ViewInfo.GetCollectionColumns().ToArray();
     Array.Sort(collectionColumnArray, (cd1, cd2) => cd1.PropertyPath.CompareTo(cd2.PropertyPath));
     CollectionColumns = Array.AsReadOnly(collectionColumnArray);
     var sublistColumns = new List<ColumnDescriptor>();
     var pivotColumns = new List<ColumnDescriptor>();
     foreach (var collectionColumn in CollectionColumns)
     {
         if (collectionColumn.PropertyPath.IsRoot)
         {
             continue;
         }
         if (ViewInfo.SublistId.StartsWith(collectionColumn.PropertyPath))
         {
             sublistColumns.Add(collectionColumn);
         }
         else
         {
             pivotColumns.Add(collectionColumn);
         }
     }
     SublistColumns = ImmutableList.ValueOf(sublistColumns);
     PivotColumns = ImmutableList.ValueOf(pivotColumns);
 }
Example #5
0
        public override void draw(ViewInfo curView, bool targetLayer)
        {
            if (vaoHandle != null && isVisible)
            {
                //Vector4 screenpos;
                for (int i = 0; i < vaoHandle.Length; i++)
                {
                    gameWindow.checkGlError("--uncaught ERROR drawing Model--" + meshes[i].name);

                    if (materials[i].propertys.useAlpha == targetLayer)
                    {
                        //Console.WriteLine("drawing: " + mMesh[i].name);

                        Material curMat = materials[i];
                        Shader shader = activateMaterial(ref curMat);
                        Mesh curMesh = meshes[i];

                        if (shader.loaded)
                        {
                            shader.insertUniform(Shader.Uniform.in_screensize, ref gameWindow.virtual_size);
                            shader.insertUniform(Shader.Uniform.in_rendersize, ref gameWindow.currentSize);
                            shader.insertUniform(Shader.Uniform.in_time, ref gameWindow.frameTime);
                            shader.insertUniform(Shader.Uniform.in_color, ref color);

                            //GL.Uniform1(curShader.nearLocation, 1, ref mGameWindow.mPlayer.zNear);
                            //GL.Uniform1(curShader.farLocation, 1, ref mGameWindow.mPlayer.zFar);

                            if (Scene != null)
                            {
                                setupMatrices(ref curView, ref shader, ref curMesh);
                            }

                            setSpecialUniforms(ref shader,ref curMesh);

                            GL.BindVertexArray(vaoHandle[i]);

                            for (int j = 0; j < particles.Length; j++)
                            {
                                Particle curPat = particles[j];
                                if (curPat.alive && curPat.rendertype == i)
                                {
                                    shader.insertUniform(Shader.Uniform.in_particlepos, ref curPat.position);
                                    shader.insertUniform(Shader.Uniform.in_particlesize, ref curPat.size);
                                    GL.DrawElements(BeginMode.Triangles, curMesh.indicesVboData.Length, DrawElementsType.UnsignedInt, IntPtr.Zero);
                                }
                            }

                            gameWindow.checkGlError("--Drawing ERROR--" + curMesh.name);
                        }
                    }
                }
            }
        }
Example #6
0
 protected virtual bool IsValidRule(ILogicRuleObject rule, ViewInfo viewInfo,EventArgs eventArgs,ExecutionContext executionContext){
     var isValidViewId = IsValidViewId(viewInfo.ViewId, rule);
     var isValidNewObject = IsValidNewObject(rule);
     var isValidViewType = IsValidViewType(viewInfo, rule);
     var isValidNestedType = IsValidNestedType(rule, viewInfo);
     var isValidTypeInfo = IsValidTypeInfo(viewInfo, rule);
     var isValidViewEditMode = IsValidViewEditMode(viewInfo, rule);
     var templateContextGroupIsValid = TemplateContextGroupIsValid(rule);
     var viewIsRoot = ViewIsRoot(rule);
     var isVailidExecutionContext = IsVailidExecutionContext(rule,executionContext,eventArgs);
     return isValidViewId &&isValidNewObject&&isValidViewType && isValidNestedType && isValidTypeInfo&& isValidViewEditMode && templateContextGroupIsValid && viewIsRoot&&isVailidExecutionContext;
 }
Example #7
0
        public static Collection<ViewInfo> GetViews(string connectionstring, string databasename)
        {
            Collection<ViewInfo> views = new Collection<ViewInfo>();

            DataTable dt = Sql2kDriver.GetViews(connectionstring, databasename);

            foreach (DataRow dataRow in dt.Rows)
            {
                ViewInfo tb = new ViewInfo((string)dataRow["VIEW_NAME"], (string)dataRow["TABLE_SCHEMA"]);
                tb.Columns = GetColumns(connectionstring + "Database=" + databasename + ";", (string)dataRow["VIEW_NAME"]);
                views.Add(tb);
            }

            return views;
        }
Example #8
0
        public override void draw(ViewInfo curView, bool renderlayer)
        {
            if (isVisible && vaoHandle != null && curView.frustrumCheck(this))

                //Vector4 screenpos;
                for (int i = 0; i < vaoHandle.Length; i++)
                {
                    Material curMaterial = materials[i];
                    Mesh curMesh = meshes[i];
                    gameWindow.checkGlError("--uncaught ERROR drawing Model--" + curMesh.name);

                    //Console.WriteLine("drawing: " + mMesh[i].name);

                    if (renderlayer == curMaterial.propertys.useAlpha)
                    {
                        Shader shader = activateMaterial(ref curMaterial);

                        if (shader.loaded)
                        {
                            shader.insertUniform(Shader.Uniform.in_screensize, ref gameWindow.virtual_size);
                            shader.insertUniform(Shader.Uniform.in_rendersize, ref gameWindow.currentSize);
                            shader.insertUniform(Shader.Uniform.in_time, ref gameWindow.frameTime);
                            shader.insertUniform(Shader.Uniform.in_color, ref color);

                            //GL.Uniform1(curShader.nearLocation, 1, ref mGameWindow.mPlayer.zNear);
                            //GL.Uniform1(curShader.farLocation, 1, ref mGameWindow.mPlayer.zFar);

                            if (Scene != null)
                            {
                                setupMatrices(ref curView, ref shader, ref curMesh);
                            }

                            setSpecialUniforms(ref shader, ref curMesh);

                            GL.BindVertexArray(vaoHandle[i]);
                            GL.DrawElements(BeginMode.Triangles, curMesh.indicesVboData.Length, DrawElementsType.UnsignedInt, IntPtr.Zero);

                            gameWindow.checkGlError("--Drawing ERROR--" + curMesh.name);
                        }
                    }
                }
        }
Example #9
0
        public override void draw(ViewInfo curView,bool targetLayer)
        {
            if (vaoHandle != null && isVisible && curView.frustrumCheck(this))
            {
                //Vector4 screenpos;
                for (int i = 0; i < vaoHandle.Length; i++)
                {
                    gameWindow.checkGlError("--uncaught ERROR drawing Model--" + meshes[i].name);

                    if (materials[i].useAlpha == targetLayer)
                    {
                        //Console.WriteLine("drawing: " + mMesh[i].name);

                        Shader curShader = activateMaterial(materials[i]);

                        if (curShader.loaded)
                        {
                            GL.Uniform2(curShader.screenSizeLocation, ref gameWindow.virtual_size);
                            GL.Uniform2(curShader.renderSizeLocation, ref gameWindow.currentSize);
                            GL.Uniform1(curShader.timeLocation, 1, ref gameWindow.frameTime);

                            GL.Uniform4(curShader.colorLocation, ref color);

                            //GL.Uniform1(curShader.nearLocation, 1, ref mGameWindow.mPlayer.zNear);
                            //GL.Uniform1(curShader.farLocation, 1, ref mGameWindow.mPlayer.zFar);

                            if (Scene != null)
                            {
                                setupMatrices(curView, curShader);
                            }

                            setSpecialUniforms(curShader);

                            GL.BindVertexArray(vaoHandle[i]);
                            GL.DrawElements(BeginMode.Triangles, meshes[i].indicesVboData.Length, DrawElementsType.UnsignedInt, IntPtr.Zero);

                            gameWindow.checkGlError("--Drawing ERROR--" + meshes[i].name);
                        }
                    }
                }
            }
        }
Example #10
0
 public void SetViewContext(IViewContext viewContext, ViewInfo viewInfo)
 {
     ViewContext = viewContext;
     if (null == viewInfo)
     {
         BindingListView.ViewInfo = null;
     }
     else
     {
         IEnumerable rowSource = null;
         if (null != ViewInfo)
         {
             if (ViewInfo.RowSourceName == viewInfo.RowSourceName)
             {
                 rowSource = RowSource;
             }
         }
         rowSource = rowSource ?? viewContext.GetRowSource(viewInfo);
         BindingListView.SetViewAndRows(viewInfo, rowSource);
     }
     OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
 }
Example #11
0
        public override void drawNormal(ViewInfo curView)
        {
            if (vaoHandle != null && isVisible && curView.frustrumCheck(this))
            {
                for (int i = 0; i < vaoHandle.Length; i++)
                {
                    Shader curShader = activateMaterialSSN(materials[i]);

                    if (curShader.loaded)
                    {
                        if (Scene != null)
                        {

                            setupMatrices(curView, curShader);

                        }

                        GL.BindVertexArray(vaoHandle[i]);
                        GL.DrawElements(BeginMode.Triangles, meshes[i].indicesVboData.Length, DrawElementsType.UnsignedInt, IntPtr.Zero);
                    }
                }
            }
        }
Example #12
0
 public QueryParameters(ViewInfo viewInfo, RowFilter rowFilter, ListSortDescriptionCollection sortDescriptions)
 {
     ViewInfo = viewInfo;
     RowFilter = rowFilter;
     SortDescriptions = sortDescriptions;
 }
Example #13
0
 public void setupShadow()
 {
     viewInfo = new ViewInfo(this);
     viewInfo.zNear = 0.6f;
     viewInfo.zFar = 10f;
     viewInfo.fovy = (float)Math.PI/2f;
     viewInfo.updateProjectionMatrix();
 }
Example #14
0
 public override void drawShadow(ViewInfo curView)
 {
 }
 public override int CalculateHeight(ViewInfo view)
 {
     return(IsHidden ? HiddenHeight : view.Font.Height);
 }
Example #16
0
 public override int CalculateDrawnHeight(ViewInfo view)
 {
     return(IsHidden && !view.ShowOptions.ShowHidden ? HiddenHeight : view.Font.Height);
 }
Example #17
0
 public void SetViewAndRows(ViewInfo viewInfo, IRowSource rows)
 {
     RowSource = rows;
     _queryRequestor.QueryParameters = _queryRequestor.QueryParameters.ChangeViewInfo(viewInfo);
 }
Example #18
0
 public virtual void drawShadow(ViewInfo curView)
 {
 }
Example #19
0
 private void RefreshValues()
 {
     ViewInfo.CalcViewInfo();
     Invalidate();
 }
Example #20
0
    //技能结算


    public void updateViewInfo(ViewInfo info)
    {
    }
Example #21
0
 public void SetView(ViewInfo viewInfo, IRowSource rows)
 {
     BindingListView.SetViewAndRows(viewInfo, rows);
 }
Example #22
0
 /// <summary>Draws this node.</summary>
 /// <param name="view">The view information.</param>
 /// <param name="x">The x coordinate.</param>
 /// <param name="y">The y coordinate.</param>
 /// <returns>The pixel size the node occupies.</returns>
 public override Size Draw(ViewInfo view, int x, int y)
 {
     return(DrawNumeric(view, x, y, Icons.Double, "Double", view.Memory.ReadObject <double>(Offset).ToString("0.000")));
 }
Example #23
0
 protected override int CalculateValuesHeight(ViewInfo view)
 {
     return(0);
 }
 public override Size Draw(ViewInfo view, int x, int y)
 {
     return(DrawText(view, x, y, "Text8Ptr"));
 }
Example #25
0
        protected Size DrawCompare(ViewInfo view, int x, int y, string text, int length)
        {
            Contract.Requires(view != null);

            if (IsHidden && !view.ShowOptions.ShowHidden)
            {
                return(DrawHidden(view, x, y));
            }

            // DrawInvalidMemoryIndicator(view, y);

            var origX = x;

            AddSelection(view, x, y, view.Font.Height);

            x += TextPadding;
            x  = AddAddressOffset(view, x, y, true, false);

            if (!string.IsNullOrEmpty(text))
            {
                x = AddText(view, x, y, view.Settings.TextColor, HotSpot.NoneId, text);
            }

            view.Memory.ReadBytes(Offset, buffer);

            var color = view.Settings.HexColor;

            if (view.Settings.HighlightChangedValues)
            {
                var address = view.Address.Add(Offset);

                highlightTimer.RemoveWhere(kv => kv.Value.Value < CurrentHighlightTime);

                if (highlightTimer.TryGetValue(address, out var until))
                {
                    if (until.Value >= CurrentHighlightTime)
                    {
                        color = view.Settings.HighlightColor;

                        if (view.Memory.HasChanged(Offset, MemorySize))
                        {
                            until.Value = CurrentHighlightTime.Add(HightlightDuration);
                        }
                    }
                }
                else if (view.Memory.HasChanged(Offset, MemorySize))
                {
                    highlightTimer.Add(address, CurrentHighlightTime.Add(HightlightDuration));

                    color = view.Settings.HighlightColor;
                }
            }

            for (var i = 0; i < length; ++i)
            {
                x = AddText(view, x, y, color, i, $"{buffer[i]:X02}") + view.Font.Width;
            }

            // x = AddComment(view, x, y);

            // AddTypeDrop(view, y);
            // AddDelete(view, y);

            return(new Size(x - origX, view.Font.Height));
        }
Example #26
0
 public virtual void draw(ViewInfo curView, Shader curShader)
 {
 }
Example #27
0
 public virtual void drawNormal(ViewInfo curView)
 {
 }
Example #28
0
 /// <summary>Draws this node.</summary>
 /// <param name="view">The view information.</param>
 /// <param name="x">The x coordinate.</param>
 /// <param name="y">The y coordinate.</param>
 /// <returns>The pixel size the node occupies.</returns>
 public override Size Draw(ViewInfo view, int x, int y)
 {
     return(DrawNumeric(view, x, y, Icons.Signed, "Int32", view.Memory.ReadObject <int>(Offset).ToString()));
 }
Example #29
0
 private void SetShowViewInfo(ViewInfo info, List<ViewInfo> showList)
 {
     switch (info.type)
     {
         case "Recharge_AdvanceMoney":
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.Recharge_AdvanceMoney);
             showList.Add(info);
             break;
         case "Recharge_PersonalRealTime":
             //个人实时充值
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.Recharge_PersonalRealTime);
             showList.Add(info);
             break;
         case "Recharge_PersonalTransfer":
             //个转账充值
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.Recharge_PersonalTransfer);
             showList.Add(info);
             break;
         case "Recharge_BatchTransfer":
             //批量转账充值
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.Recharge_BatchTransfer);
             showList.Add(info);
             break;
         case "Refund_PersonalCash":
             //个人现金退款
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.Refund_PersonalCash);
             info.cost = "-" + info.cost;
             showList.Add(info);
             break;
         case "Refund_CardPersonalRealTime":
             //个人实时卡退款
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.Refund_CardPersonalRealTime);
             info.cost = "-" + info.cost;
             showList.Add(info);
             break;
         case "Refund_PersonalTransfer":
             //个人转账退款
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.Refund_PersonalTransfer);
             showList.Add(info);
             break;
         case "Refund_BatchTransfer":
             //批量转账退款
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.Refund_BatchTransfer);
             showList.Add(info);
             break;
     }
 }
Example #30
0
 public static void ClearClip(Canvas canvas, ViewInfo viewInfo)
 {
     canvas.ClipRect(new Android.Graphics.Rect(viewInfo.Left, viewInfo.Top, viewInfo.Right, viewInfo.Bottom), Region.Op.Replace);
 }
Example #31
0
 public void ShowPreview()
 {
     Debug.Assert(PreviewButtonVisible);
     var viewInfo = new ViewInfo(ViewInfo.ParentColumn, ViewSpec.SetName(ViewName));
     ViewContext.Preview(this, viewInfo);
 }
Example #32
0
 protected override int CalculateValuesHeight(ViewInfo view)
 {
     return(3 * view.Font.Height);
 }
        protected Size Draw(ViewInfo view, int x, int y, string type, string name)
        {
            Contract.Requires(view != null);
            Contract.Requires(type != null);
            Contract.Requires(name != null);

            if (IsHidden && !IsWrapped)
            {
                return(DrawHidden(view, x, y));
            }

            var origX = x;

            AddSelection(view, x, y, view.Font.Height);

            x += TextPadding;

            x = AddIcon(view, x, y, Icons.Function, HotSpot.NoneId, HotSpotType.None);

            var tx = x;

            x = AddAddressOffset(view, x, y);

            x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width;
            if (!IsWrapped)
            {
                x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, name) + view.Font.Width;
            }

            x = AddOpenCloseIcon(view, x, y) + view.Font.Width;

            x = AddComment(view, x, y);

            if (view.Settings.ShowCommentSymbol)
            {
                var value = view.Memory.ReadIntPtr(Offset);

                var module = view.Memory.Process.GetModuleToPointer(value);
                if (module != null)
                {
                    var symbols = view.Memory.Process.Symbols.GetSymbolsForModule(module);
                    var symbol  = symbols?.GetSymbolString(value, module);
                    if (!string.IsNullOrEmpty(symbol))
                    {
                        x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.ReadOnlyId, symbol);
                    }
                }
            }

            DrawInvalidMemoryIndicatorIcon(view, y);
            AddContextDropDownIcon(view, y);
            AddDeleteIcon(view, y);

            var size = new Size(x - origX, view.Font.Height);

            if (LevelsOpen[view.Level])
            {
                var ptr = view.Memory.ReadIntPtr(Offset);

                DisassembleRemoteCode(view.Memory, ptr);

                var instructionSize = DrawInstructions(view, tx, y);

                size.Width   = Math.Max(size.Width, instructionSize.Width + tx - origX);
                size.Height += instructionSize.Height;
            }

            return(size);
        }
 public override int CalculateDrawnHeight(ViewInfo view)
 {
     throw new NotImplementedException();
 }
Example #35
0
 public void SetViewInfo(ViewInfo info)
 {
     this.info = info;
 }
 public override Size Draw(ViewInfo view, int x, int y)
 {
     throw new NotImplementedException();
 }
Example #37
0
 private void ButtonViewInfo_Click(object sender, EventArgs e)
 {
     ViewInfo ob = new ViewInfo(sv);
     ob.Show();
 }
Example #38
0
    IEnumerator SendCreateView()
    {
        if (m_IsCoroutineStarted)
        {
            yield break;
        }

        m_IsCoroutineStarted = true;

        if (string.IsNullOrEmpty(Page))
        {
            throw new System.ApplicationException("The Page of a view must not be null or empty.");
        }

        if (ResourceHandlerFactoryFunc != null)
        {
            m_ResourceHandler = ResourceHandlerFactoryFunc();
        }

        if (m_ResourceHandler == null)
        {
            Debug.LogWarning("Unable to create file handler using factory function! Falling back to default handler.");
            m_ResourceHandler = new UnityGTResourceHandler();
        }

        ViewLoadPolicy policy = ViewLoadPolicy.VLP_UseCacheOrLoad;

                #if UNITY_EDITOR
        m_ResourcesInUse  = new HashSet <string>();
        m_ResourceHandler = new UnityGTResourceHandlerDecorator(m_ResourceHandler, this);

        if (AutoRefresh)
        {
            policy = ViewLoadPolicy.VLP_IgnoreCache;
        }
                #endif

        var viewInfo = new ViewInfo();
        viewInfo.Width                      = (uint)this.m_Width;
        viewInfo.Height                     = (uint)this.m_Height;
        viewInfo.IsTransparent              = this.m_IsTransparent;
        viewInfo.ViewListenerInstance       = m_Listener;
        viewInfo.ResourceHandlerInstance    = m_ResourceHandler;
        viewInfo.ClickThroughAlphaThreshold = ClickThroughThreshold;

        if (string.IsNullOrEmpty(InitialScript))
        {
            View = m_UISystem.UISystem.CreateView(viewInfo, Page, policy);
        }
        else
        {
            View = m_UISystem.UISystem.CreateView(viewInfo, Page, InitialScript, policy);
        }

        RecreateViewTexture(m_Width, m_Height);

        View.SetNewRenderTarget(ViewTexture.GetNativeTexturePtr(),
                                DepthTexture.GetNativeTexturePtr(),
                                (uint)m_Width, (uint)m_Height, 1);

        CoherentUIGTRenderEvents.SendRenderEvent(CoherentRenderEventType.CreateViewRenderer,
                                                 View.GetId());

        while (ViewRenderer == null)
        {
            ViewRenderer = View.GetViewRenderer();
            yield return(null);
        }

        AddViewRendererComponent();
    }
Example #39
0
 public QueryParameters SetViewInfo(ViewInfo value)
 {
     return new QueryParameters(this) {ViewInfo = value};
 }
Example #40
0
 public override Size Draw(ViewInfo view, int x, int y)
 {
     return(DrawNumeric(view, x, y, Icons.Double, "Double", ReadValueFromMemory(view.Memory).ToString("0.000")));
 }
Example #41
0
 public virtual void draw(ViewInfo curView, bool transparencyLayer)
 {
 }
Example #42
0
 public void SetUp()
 {
     mocks  = new MockRepository();
     plugin = new GrassCoverErosionInwardsPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(GrassCoverErosionInwardsFailureMechanismView));
 }
Example #43
0
 public virtual void drawDefInfo(ViewInfo curView)
 {
 }
Example #44
0
 /// <summary>Draws this node.</summary>
 /// <param name="view">The view information.</param>
 /// <param name="x">The x coordinate.</param>
 /// <param name="y">The y coordinate.</param>
 /// <returns>The pixel size the node occupies.</returns>
 public override Size Draw(ViewInfo view, int x, int y)
 {
     return(DrawNumeric(view, x, y, Icons.Unsigned, "UInt16", view.Memory.ReadObject <ushort>(Offset).ToString()));
 }
Example #45
0
 public virtual void drawSelection(ViewInfo curView)
 {
 }
 public void SetUp()
 {
     plugin = new GrassCoverErosionInwardsPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(GrassCoverErosionInwardsFailureMechanismResultView));
 }
Example #47
0
 protected virtual void setupMatrices(ref ViewInfo curView,ref Shader shader, ref Mesh curMesh)
 {
     shader.insertUniform(Shader.Uniform.projection_matrix, ref curView.projectionMatrix);
     shader.insertUniform(Shader.Uniform.modelview_matrix, ref curView.modelviewMatrix);
     shader.insertUniform(Shader.Uniform.rotation_matrix, ref orientation);
     shader.insertUniform(Shader.Uniform.model_matrix, ref modelMatrix);
 }
 private void SetShowViewInfo(ViewInfo info, List<ViewInfo> showList)
 {
     switch (info.type)
     {
         case "NewCardCost":
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.NewCardCost);
             showList.Add(info);
             break;
         case "ReplaceCardCost":
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.ReplaceCardCost);
             showList.Add(info);
             break;
         //case "AdvanceMealCost":
         //    info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.AdvanceMealCost);
         //    showList.Add(info);
         //    break;
         case "SetMealCost":
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.SetMealCost);
             showList.Add(info);
             break;
         case "FreeMealCost":
             info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.FreeMealCost);
             showList.Add(info);
             break;
         //case "PreCostRecharge":
         //    info.type = DefineConstantValue.GetMoneyFlowDesc(DefineConstantValue.ConsumeMoneyFlowType.PreCostRecharge);
         //    showList.Add(info);
         //    break;
     }
 }
	private void SendCreateView()
	{
		if(Page == null || Page == "") {
			throw new System.ApplicationException("The Page of a view must not be null or empty.");
		}

		var viewInfo = new ViewInfo();
		viewInfo.Width = this.m_Width;
		viewInfo.Height = this.m_Height;
		viewInfo.IsTransparent = this.m_IsTransparent;
		#if COHERENT_UI_PRO_UNITY3D && (UNITY_EDITOR || COHERENT_UNITY_STANDALONE)
		viewInfo.IsOnDemand = this.m_IsOnDemand;
		viewInfo.ControlTimeOnDemand = this.m_ControlTimeOnDemand;
		viewInfo.TargetFrameRate = (int)this.m_TargetFramerate;
		#endif
		viewInfo.SupportClickThrough = this.m_SupportClickThrough;

		#if UNITY_EDITOR || COHERENT_UNITY_STANDALONE
		viewInfo.ForceSoftwareRendering = this.m_ForceSoftwareRendering;
		viewInfo.ClickThroughAlphaThreshold = this.m_ClickThroughAlphaThreshold;
		viewInfo.UsesSharedMemory = !m_System.DeviceSupportsSharedTextures || this.m_ForceSoftwareRendering;
		#elif UNITY_IPHONE || UNITY_ANDROID
		viewInfo.X = this.m_XPos;
		viewInfo.Y = this.m_YPos;
		viewInfo.ShowImmediately = this.enabled;
		viewInfo.InitialInputState = (ViewInputState)this.m_ViewInputState;
		viewInfo.ScaleToFit = m_ScaleToFit;
		viewInfo.EnableWebGLSupport = m_EnableWebGLSupport;
		#endif

		#if UNITY_EDITOR || COHERENT_UNITY_STANDALONE
		if (InitialScript == null)
		{
			m_System.UISystem.CreateView(viewInfo, Page, m_Listener);
		}
		else
		{
			m_System.UISystem.CreateView(viewInfo, Page, m_Listener, InitialScript);
		}
		#else
		m_System.UISystem.CreateView(viewInfo, Page, m_Listener);
		#endif

		#if UNITY_EDITOR || COHERENT_UNITY_STANDALONE
		CoherentUIViewRenderer.WakeRenderer();
		#endif
	}
 protected void SetViewInfo(ViewInfo viewInfo, IEnumerable<PropertyPath> selectedPaths)
 {
     if (UseTransformedView && null != ViewEditor.ViewTransformer)
     {
         var keyValuePair = ViewEditor.ViewTransformer.UntransformView(viewInfo, selectedPaths);
         viewInfo = keyValuePair.Key;
         selectedPaths = keyValuePair.Value;
     }
     ViewEditor.SetViewInfo(viewInfo, selectedPaths);
 }
Example #51
0
 public void SetViewInfo(ViewInfo viewInfo, IEnumerable<PropertyPath> selectedPaths)
 {
     bool inChangeView = _inChangeView;
     try
     {
         _inChangeView = true;
         _undoStack.RemoveRange(_undoIndex, _undoStack.Count - _undoIndex);
         _undoStack.Add(new KeyValuePair<ViewInfo, IList<PropertyPath>>(viewInfo, ImmutableList.ValueOf(selectedPaths ?? _selectedPaths)));
         ApplyViewInfo(_undoStack[_undoIndex++]);
     }
     finally
     {
         _inChangeView = inChangeView;
     }
 }
        protected int AddComment(ViewInfo view, int x, int y, float fvalue, IntPtr ivalue, UIntPtr uvalue)
        {
            Contract.Requires(view != null);

            if (Program.Settings.ShowCommentFloat)
            {
                x = AddText(view, x, y, Program.Settings.ValueColor, HotSpot.ReadOnlyId, $"({(fvalue > -99999.0f && fvalue < 99999.0f ? fvalue : 0.0f):0.000})");
            }
            if (Program.Settings.ShowCommentInteger)
            {
                if (ivalue == IntPtr.Zero)
                {
                    x = AddText(view, x, y, Program.Settings.ValueColor, HotSpot.ReadOnlyId, "(0)");
                }
                else
                {
                    x = AddText(view, x, y, Program.Settings.ValueColor, HotSpot.ReadOnlyId, $"({ivalue.ToInt64()}|0x{uvalue.ToUInt64():X})");
                }
            }

            var namedAddress = view.Memory.Process.GetNamedAddress(ivalue);

            if (!string.IsNullOrEmpty(namedAddress))
            {
                x += view.Font.Width;

                if (Program.Settings.ShowCommentPointer)
                {
                    x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.NoneId, "->") + view.Font.Width;
                    x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.ReadOnlyId, namedAddress) + view.Font.Width;
                }

                if (Program.Settings.ShowCommentRtti)
                {
                    var rtti = view.Memory.Process.ReadRemoteRuntimeTypeInformation(ivalue);
                    if (!string.IsNullOrEmpty(rtti))
                    {
                        x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.ReadOnlyId, rtti) + view.Font.Width;
                    }
                }

                if (Program.Settings.ShowCommentSymbol)
                {
                    var module = view.Memory.Process.GetModuleToPointer(ivalue);
                    if (module != null)
                    {
                        var symbols = view.Memory.Process.Symbols.GetSymbolsForModule(module);
                        if (symbols != null)
                        {
                            var symbol = symbols.GetSymbolString(ivalue, module);
                            if (!string.IsNullOrEmpty(symbol))
                            {
                                x = AddText(view, x, y, Program.Settings.OffsetColor, HotSpot.ReadOnlyId, symbol) + view.Font.Width;
                            }
                        }
                    }
                }

                if (Program.Settings.ShowCommentString)
                {
                    var data = view.Memory.Process.ReadRemoteMemory(ivalue, 64);

                    // First check if it could be an UTF8 string and if not try UTF16.
                    if (data.Take(IntPtr.Size).InterpretAsUTF8().IsPrintableData())
                    {
                        var text = new string(Encoding.UTF8.GetChars(data).TakeWhile(c => c != 0).ToArray());
                        x = AddText(view, x, y, Program.Settings.TextColor, HotSpot.ReadOnlyId, $"'{text}'") + view.Font.Width;
                    }
                    else if (data.Take(IntPtr.Size * 2).InterpretAsUTF16().IsPrintableData())
                    {
                        var text = new string(Encoding.Unicode.GetChars(data).TakeWhile(c => c != 0).ToArray());
                        x = AddText(view, x, y, Program.Settings.TextColor, HotSpot.ReadOnlyId, $"L'{text}'") + view.Font.Width;
                    }
                }

                if (Program.Settings.ShowCommentPluginInfo)
                {
                    foreach (var reader in NodeInfoReader)
                    {
                        var info = reader.ReadNodeInfo(this, ivalue, view.Memory);
                        if (info != null)
                        {
                            x = AddText(view, x, y, Program.Settings.PluginColor, HotSpot.ReadOnlyId, info) + view.Font.Width;
                        }
                    }
                }
            }

            return(x);
        }
Example #53
0
        public bool Export(CancellationToken cancellationToken, IProgressMonitor progressMonitor, ref IProgressStatus status, ViewInfo viewInfo, TextWriter writer, DsvWriter dsvWriter)
        {
            progressMonitor = progressMonitor ?? new SilentProgressMonitor();
            using (var bindingListSource = new BindingListSource(cancellationToken))
            {
                bindingListSource.SetViewContext(this, viewInfo);
                progressMonitor.UpdateProgress(status = status.ChangePercentComplete(5)
                                                        .ChangeMessage(Resources.ExportReportDlg_ExportReport_Writing_report));

                WriteDataWithStatus(progressMonitor, ref status, writer, bindingListSource, dsvWriter);
                if (progressMonitor.IsCanceled)
                {
                    return(false);
                }

                writer.Flush();
                progressMonitor.UpdateProgress(status = status.Complete());
            }
            return(true);
        }
Example #54
0
 public void SetUp()
 {
     plugin = new RiskeerPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.DataType == typeof(RegistrationStateRootContext));
 }
Example #55
0
 public void SetUp()
 {
     plugin = new RiskeerPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(AssemblyResultTotalView));
 }
Example #56
0
        public override Size Draw(ViewInfo view, int x, int y)
        {
            if (IsHidden && !IsWrapped)
            {
                return(DrawHidden(view, x, y));
            }

            var origX = x;
            var origY = y;

            AddSelection(view, x, y, view.Font.Height);

            if (InnerNode != null)
            {
                x = AddOpenCloseIcon(view, x, y);
            }
            else
            {
                x += TextPadding;
            }
            x = AddIcon(view, x, y, Icons.Pointer, -1, HotSpotType.None);

            var tx = x;

            x = AddAddressOffset(view, x, y);

            x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, "TSharedPtr") + view.Font.Width;
            if (!IsWrapped)
            {
                x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name) + view.Font.Width;
            }
            if (InnerNode == null)
            {
                x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, "<void>") + view.Font.Width;
            }
            x = AddIcon(view, x, y, Icons.Change, 4, HotSpotType.ChangeWrappedType) + view.Font.Width;

            var ptr = view.Memory.ReadIntPtr(Offset);

            x = AddText(view, x, y, view.Settings.OffsetColor, HotSpot.NoneId, "->") + view.Font.Width;
            x = AddText(view, x, y, view.Settings.ValueColor, 0, "0x" + ptr.ToString(Constants.AddressHexFormat)) + view.Font.Width;

            x = AddComment(view, x, y);

            DrawInvalidMemoryIndicatorIcon(view, y);
            AddContextDropDownIcon(view, y);
            AddDeleteIcon(view, y);

            y += view.Font.Height;

            var size = new Size(x - origX, y - origY);

            if (LevelsOpen[view.Level] && InnerNode != null)
            {
                memory.Size = InnerNode.MemorySize;
                memory.UpdateFrom(view.Process, ptr);

                var v = view.Clone();
                v.Address = ptr;
                v.Memory  = memory;

                var innerSize = InnerNode.Draw(v, tx, y);

                size.Width   = Math.Max(size.Width, innerSize.Width + tx - origX);
                size.Height += innerSize.Height;
            }

            return(size);
        }
Example #57
0
        public override Size Draw(ViewInfo view, int x, int y)
        {
            var value = ReadValueFromMemory(view.Memory);

            return(DrawNumeric(view, x, y, Icons.Unsigned, "UInt8", value.ToString(), $"0x{value:X}"));
        }
        private ViewInfo ReadViewInfo()
        {
            ViewInfo viewInfo = this.viewer.GetViewInfo(this.viewInfoOptions);

            return(viewInfo);
        }
        /// <summary>
        /// 显示查询结果
        /// </summary>
        private void ShowRecord()
        {
            _showList = new List<ViewInfo>();

            try
            {
                this.lblRecordAmount.Text = "0";
                this.lvList.Items.Clear();

                DateTime startTime = DateTime.Parse(dtpDateFrom.Value.ToString("yyyy/MM/dd"));
                DateTime endTime = DateTime.Parse(dtpDateTo.Value.ToString("yyyy/MM/dd"));

                if (startTime > endTime)
                {
                    base.MessageDialog("提示", "开始时间要小于结束时间!");
                    return;
                }

                System.TimeSpan ts = endTime.Subtract(startTime);//TimeSpan得到dt1和dt2的时间间隔
                int countDays = ts.Days;//相隔天数
                if (countDays > 60)
                {
                    base.MessageDialog("提示", "最多只能查询前后60天的记录!");
                    startTime = startTime.AddDays(60);
                    this.dtpDateTo.Value = startTime;
                    return;
                }

                CardUserAccount_cua_Info cuaInfo = new CardUserAccount_cua_Info();
                cuaInfo.cua_cCUSID = _userID;
                cuaInfo = _icuaBL.SearchRecords(cuaInfo).FirstOrDefault() as CardUserAccount_cua_Info;

                CardUserAccountDetail_cuad_Info cuadInfo = new CardUserAccountDetail_cuad_Info();
                cuadInfo.cuad_cCUAID = cuaInfo.cua_cRecordID;
                cuadInfo.OptTime_From = startTime;
                cuadInfo.OptTime_To = endTime.AddDays(1);

                List<CardUserAccountDetail_cuad_Info> infoList = _icuadBL.SearchRecords(cuadInfo);

                if (infoList != null)
                {
                    infoList = infoList.OrderByDescending(x => x.cuad_dOptTime).ToList();

                    int rowNo = 1;

                    for (int index = 0; index < infoList.Count; index++)
                    {
                        cuadInfo = infoList[index] as CardUserAccountDetail_cuad_Info;

                        ViewInfo vi = new ViewInfo();
                        vi.index = rowNo;
                        vi.times = cuadInfo.cuad_dOptTime.ToString("yyyy/MM/dd");
                        vi.cost = cuadInfo.cuad_fFlowMoney.ToString();
                        vi.type = cuadInfo.cuad_cFlowType;

                        try
                        {
                            //PreConsumeRecord_pcs_Info pcsinfo = new PreConsumeRecord_pcs_Info();
                            //pcsinfo.pcs_cRecordID = (Guid)cuadInfo.cuad_cConsumeID;
                            //pcsinfo = _ipcrBL.DisplayRecord(pcsinfo);

                            //if (pcsinfo != null)
                            //{
                            //    vi.mealTime = pcsinfo.pcs_dConsumeDate.ToString("yyyy/MM/dd HH:mm:ss");
                            //}
                            //else
                            //{
                            //    vi.mealTime = cuadInfo.cuad_dOptTime.ToString("yyyy/MM/dd HH:mm:ss");
                            //}

                            ConsumeRecord_csr_Info csrInfo = new ConsumeRecord_csr_Info();
                            csrInfo.csr_cRecordID = (Guid)cuadInfo.cuad_cConsumeID;
                            csrInfo = _IConsumeRecordBL.DisplayRecord(csrInfo);
                            if (csrInfo != null)
                            {
                                vi.mealTime = csrInfo.csr_dConsumeDate.ToString("yyyy/MM/dd HH:mm:ss");
                            }
                            else
                            {
                                PreConsumeRecord_pcs_Info pcsinfo = new PreConsumeRecord_pcs_Info();
                                pcsinfo.pcs_cRecordID = (Guid)cuadInfo.cuad_cConsumeID;
                                pcsinfo = _ipcrBL.DisplayRecord(pcsinfo);

                                if (pcsinfo != null)
                                {
                                    vi.mealTime = pcsinfo.pcs_dConsumeDate.ToString("yyyy/MM/dd HH:mm:ss");
                                }
                                else
                                {
                                    vi.mealTime = cuadInfo.cuad_dOptTime.ToString("yyyy/MM/dd HH:mm:ss");
                                }
                            }
                        }
                        catch
                        {

                        }
                        if (cuadInfo.MacNo != null)
                        {
                            vi.CostType = cuadInfo.MacNo.ToString() + "号机";
                        }
                        else
                        {
                            vi.CostType = "系统补扣";
                        }

                        SetShowViewInfo(vi, _showList);
                        //_showList.Add(vi);

                        rowNo = _showList.Count + 1;
                    }
                }

                if (_showList.Count == 0)
                {
                    if (startTime == endTime && startTime == DateTime.Parse(System.DateTime.Now.ToString("yyyy/MM/dd")))
                    {
                        base.MessageDialog("提示", "今天内无消费记录!");
                    }
                    else
                    {
                        base.MessageDialog("提示", "查找时间内无消费记录!");
                    }
                }

                this.lblRecordAmount.Text = _showList.Count.ToString();
            }
            catch
            {

            }
            finally
            {
                //計算最大頁數
                if (_showList != null)
                {
                    _MaxPage = _showList.Count / _PageSize;

                    if (_showList.Count % _PageSize != 0)
                    {
                        _MaxPage++;
                    }

                    if (_MaxPage == 0)
                    {
                        _PageIndex = 0;
                    }
                    else
                    {
                        if (_PageIndex == 0)
                        {
                            _PageIndex = 1;
                        }
                    }

                    ShowList();//顯示內容
                }
                SetUpDownBtnStatus();
            }
        }
Example #60
0
 public override Size Draw(ViewInfo view, int x, int y)
 {
     return(Draw(view, x, y, view.Settings.ShowNodeText ? view.Memory.ReadPrintableAsciiString(Offset, 1) + "        " : null, 1));
 }