public void Generate( )
        {
            MethodsTemplates.Clear( );
            Methods.Clear( );
            Constructors.Clear( );

            GenerateReadBlockTemplateMethod( );
            GenerateReadDataMethod( );
            GenerateBinaryReaderConstructor( );
        }
Exemple #2
0
        public void Generate()
        {
            MethodTemplates.Clear();
            Methods.Clear();
            Constructors.Clear();

            Methods.AddRange(new[]
            {
                MethodInfoFactory.GenerateReadFieldsMethod(this),
                MethodInfoFactory.GenerateReadPointersMethod(this)
            });

            GenerateWriteMethod();
        }
        /// <summary>
        /// Dispose the resources
        /// </summary>
        public override void Dispose()
        {
            Task.Run(() =>
            {
                OnDone(this);

                ClassDeclaration = null;

                if (Variables != null)
                {
                    foreach (var variable in Variables)
                    {
                        var value = variable.Value as IDisposable;
                        if (value != null)
                        {
                            value.Dispose();
                        }
                    }
                    Variables.Clear();
                }
                Variables = null;

                if (Constructors != null)
                {
                    Constructors.Clear();
                }
                Constructors = null;

                if (Methods != null)
                {
                    Methods.Clear();
                }
                Methods = null;

                EntryPoint = null;
            });
        }
        private void SelectionChanged(object obj)
        {
            if (obj == null)
            {
                return;
            }
            string s = selectedid;

            //CurrentMenu = obj as MenuItem;

            CurrentNode = obj as TreeNodeModel;
            if (CurrentNode == null)
            {
                return;
            }
            Constructors.Clear();
            ParameterItems.Clear();

            if (!string.IsNullOrEmpty(CurrentNode.Item.InvokingConfig))
            {
                XmlDocument xdoc = new XmlDocument();
                xdoc.LoadXml(CurrentNode.Item.InvokingConfig);
                XmlNodeList xlist = xdoc.GetElementsByTagName("DSPUSERCONTROL");

                string[] strs = xlist.Item(0).ChildNodes[2].InnerText.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                ParameterItems.Clear();
                foreach (string str in strs)
                {
                    string[] tstr = str.Split(new char[] { ':' });
                    ParameterItems.Add(new ParameterItemModel()
                    {
                        DataName = tstr[0], DataType = tstr[1], DataValue = tstr[2]
                    });
                }
            }
        }