示例#1
0
        public override void Run(List <string> args)
        {
            // args[0]=v, args[1]=filename.msi
            if (args.Count < 2)
            {
                throw new OptionException("You must specify an msi filename.", "v");
            }
            var msiFileName = args[1];

            using (var msidb = new Database(msiFileName, OpenDatabase.ReadOnly))
            {
                const string tableName = "Property";
                var          query     = string.Format(CultureInfo.InvariantCulture, "SELECT * FROM `{0}`", tableName);
                using (var view = new ViewWrapper(msidb.OpenExecuteView(query)))
                {
                    foreach (var row in view.Records)
                    {
                        var property = (string)row[view.ColumnIndex("Property")];
                        var value    = row[view.ColumnIndex("Value")];
                        if (string.Equals("ProductVersion", property, StringComparison.InvariantCultureIgnoreCase))
                        {
                            Console.WriteLine(value);
                            return;
                        }
                    }
                    Console.WriteLine("Version not found!");
                }
            }
        }
 public IActionResult DisplayActivity(int ActivityId)
 {
     if (HttpContext.Session.GetInt32("UserId") != null)
     {
         ViewWrapper ViewWrapper = new ViewWrapper();
         ViewWrapper.Activity = dbContext.Activities
                                .Include(Activity => Activity.Creator)
                                .Include(Activity => Activity.GuestsOfActivity)
                                .ThenInclude(sub => sub.User)
                                .FirstOrDefault(Activity => Activity.ActivityId == ActivityId);
         ViewWrapper.User = dbContext.Users
                            .Include(Activity => Activity.ActivitiesToGo)
                            .FirstOrDefault(user => user.UserId == (int)HttpContext.Session.GetInt32("UserId"));
         ViewWrapper.Activities = dbContext.Activities
                                  .OrderBy(prod => prod.Date)
                                  .Include(Activity => Activity.Creator)
                                  .Include(Activity => Activity.GuestsOfActivity)
                                  .ToList();
         return(View("Display", ViewWrapper));
     }
     else
     {
         return(View("Index"));
     }
 }
示例#3
0
        public void ViewImplEnableGestureDetection()
        {
            tlog.Debug(tag, $"ViewImplEnableGestureDetection START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                try
                {
                    testingTarget.viewWrapperImpl.EnableGestureDetection(Gesture.GestureType.LongPress);
                    testingTarget.viewWrapperImpl.DisableGestureDetection(Gesture.GestureType.LongPress);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception : Failed!");
                }

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplEnableGestureDetection (OK)");
        }
示例#4
0
        public void ViewImplSetBackground()
        {
            tlog.Debug(tag, $"ViewImplSetBackground START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                using (ColorVisual colorVisual = new ColorVisual())
                {
                    colorVisual.Color = Color.Cyan;

                    try
                    {
                        testingTarget.viewWrapperImpl.SetBackground(colorVisual.OutputVisualMap);
                    }
                    catch (Exception e)
                    {
                        tlog.Debug(tag, e.Message.ToString());
                        Assert.Fail("Caught Exception : Failed!");
                    }
                }

                testingTarget.viewWrapperImpl.ClearBackground();

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplSetBackground END (OK)");
        }
示例#5
0
        public void ViewImplGetGestureDetector()
        {
            tlog.Debug(tag, $"ViewImplGetGestureDetector START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                var pinchGesture = testingTarget.viewWrapperImpl.GetPinchGestureDetector();
                Assert.IsInstanceOf <PinchGestureDetector>(pinchGesture, "should be an instance of testing target class!");

                var panGesture = testingTarget.viewWrapperImpl.GetPanGestureDetector();
                Assert.IsInstanceOf <PanGestureDetector>(panGesture, "should be an instance of testing target class!");

                var tapGesture = testingTarget.viewWrapperImpl.GetTapGestureDetector();
                Assert.IsInstanceOf <TapGestureDetector>(tapGesture, "should be an instance of testing target class!");

                var pressGesture = testingTarget.viewWrapperImpl.GetLongPressGestureDetector();
                Assert.IsInstanceOf <LongPressGestureDetector>(pressGesture, "should be an instance of testing target class!");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplGetGestureDetector (OK)");
        }
示例#6
0
        /// <summary>
        /// Shows the table in the list on the view table tab.
        /// </summary>
        /// <param name="msidb">The msi database.</param>
        /// <param name="tableName">The name of the table.</param>
        private void UpdateMSiTableGrid(Database msidb, string tableName)
        {
            if (msidb == null || string.IsNullOrEmpty(tableName))
            {
                return;
            }

            Status(string.Concat("Processing Table \'", tableName, "\'."));

            using (new DisposableCursor(View))
            {               // clear the columns no matter what happens (in the event the table doesn't exist we don't want to show anything).
                View.ClearTableViewGridColumns();
                try
                {
                    // NOTE: Deliberately not calling msidb.TableExists here as some System tables could not be read due to using it.
                    string query = string.Concat("SELECT * FROM `", tableName, "`");

                    using (var view = new ViewWrapper(msidb.OpenExecuteView(query)))
                    {
                        foreach (ColumnInfo col in view.Columns)
                        {
                            View.AddTableViewGridColumn(string.Concat(col.Name, " (", col.TypeID, ")"));
                        }
                        View.SetTableViewGridDataSource(view.Records);
                    }
                    Status("Idle");
                }
                catch (Exception eUnexpected)
                {
                    Error(string.Concat("Cannot view table:", eUnexpected.Message), eUnexpected);
                }
            }
        }
示例#7
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup root, Bundle data)
        {
            ViewWrapper view = (ViewWrapper)inflater.Inflate(Resource.Layout.expandable, root, false);

            ExpandableListView = view.FindViewById <PullToRefresharp.Android.Widget.ExpandableListView>(Resource.Id.expandablelist);
            return(view);
        }
示例#8
0
        public override IViewWrapper ConvertTo(FigmaNode currentNode, ProcessedNode parent)
        {
            var figmaText = ((FigmaText)currentNode);
            var font      = figmaText.style.ToUIFont();
            var textField = FigmaViewsHelper.CreateLabel(figmaText.characters, font);

            textField.Configure(figmaText);
            var wrapper = new ViewWrapper(textField);

            return(wrapper);
        }
示例#9
0
 private void InitEvent()
 {
     _wrappers = new List <ViewWrapper>(_views.Count);
     for (var i = 0; i < _views.Count; i++)
     {
         var wrapper = new ViewWrapper(_views[i]);
         wrapper.SetTag(i);
         _list.AddListener(((IBindList <ViewModel>)wrapper).GetBindListFunc());
         _views[i].Hide();
         _wrappers.Add(wrapper);
     }
 }
示例#10
0
        public override IViewWrapper ConvertTo(FigmaNode currentNode, ProcessedNode parent)
        {
            var figmaText = ((FigmaText)currentNode);
            var font      = figmaText.style.ToFont();
            //var textField = new Label ();
            var textField = new TransparentLabel();

            textField.Font = font;
            textField.Text = figmaText.characters;
            textField.Configure(figmaText);
            var wrapper = new ViewWrapper(textField);

            return(wrapper);
        }
示例#11
0
        public override IViewWrapper ConvertTo(FigmaNode currentNode, ProcessedNode parent)
        {
            var model = ((FigmaText)currentNode);
            //var font = figmaText.style.ToFont();
            //var textField = new Label ();
            var view = new Label();

            //textField.Font = font;
            view.Configure(model);

            var wrapper = new ViewWrapper(view);

            return(wrapper);
        }
示例#12
0
        private void InitEvent()
        {
            int childCount = _content.childCount;

            _wrappers = new List <ViewWrapper>(childCount);
            for (int i = 0; i < childCount; i++)
            {
                var view    = ReflectionHelper.CreateInstance(typeof(TView)) as View;
                var wrapper = new ViewWrapper(view, _content);
                wrapper.SetTag(i);
                _list.AddListener(((IBindList <ViewModel>)wrapper).GetBindListFunc());
                _wrappers.Add(wrapper);
            }
        }
示例#13
0
        public async Task <ActionResult> AddNewQuestion(string quizId, string questionType)
        {
            using (var scope = AutofacSetup.Container.BeginLifetimeScope())
            {
                var controller = scope.ResolveKeyed <QuestionBaseController>(questionType);
                controller.ContextualizeController(nameof(controller.EditQuestion));
                var res = await controller.EditQuestion(quizId, Guid.NewGuid().ToString());

                var viewLocations = res.ViewEngineCollection.FindPartialView(controller.ControllerContext, res.ViewName);
                res.View = viewLocations.View;

                var mod = new ViewWrapper((RazorView)res.View, res.Model);
                return(View("_ViewWrapper", mod));
            }
        }
示例#14
0
        public void ViewImplGetCPtr()
        {
            tlog.Debug(tag, $"ViewImplGetCPtr START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                var result = ViewWrapperImpl.getCPtr(testingTarget.viewWrapperImpl);
                tlog.Debug(tag, "getCptr : " + result);

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplGetCPtr END (OK)");
        }
示例#15
0
        public void ViewImplSetKeyInputFocus()
        {
            tlog.Debug(tag, $"ViewImplSetKeyInputFocus START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                testingTarget.viewWrapperImpl.SetKeyInputFocus();
                var result = testingTarget.viewWrapperImpl.HasKeyInputFocus();
                tlog.Debug(tag, "HasKeyInputFocus : " + result);
                testingTarget.viewWrapperImpl.ClearKeyInputFocus();

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplSetKeyInputFocus (OK)");
        }
示例#16
0
        public void ViewImplSetBackgroundColor()
        {
            tlog.Debug(tag, $"ViewImplSetBackgroundColor START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                using (Vector4 color = new Vector4(0.3f, 0.5f, 0.9f, 1.0f))
                {
                    testingTarget.viewWrapperImpl.SetBackgroundColor(color);
                    //tlog.Debug(tag, "BackgroundColor : " + wrapper.viewWrapperImpl.GetBackgroundColor());
                }

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplSetBackgroundColor END (OK)");
        }
示例#17
0
        public async Task <ActionResult> EditQuestion(string questionId)
        {
            var question = await QuizService.GetQuestion(questionId);

            if (question == null)
            {
                return(PartialView("_InvalidAccess"));
            }
            using (var scope = AutofacSetup.Container.BeginLifetimeScope())
            {
                var controller = scope.ResolveKeyed <QuestionBaseController>(question.QuestionTypeId);
                controller.ContextualizeController(nameof(controller.EditQuestion));
                var res = await controller.EditQuestion(question.QuizId, questionId);

                var viewLocations = res.ViewEngineCollection.FindPartialView(controller.ControllerContext, res.ViewName);
                res.View = viewLocations.View;

                var mod = new ViewWrapper((RazorView)res.View, res.Model);
                return(View("_ViewWrapper", mod));
            }
        }
 public IActionResult DeleteActivity(int ActivityId)
 {
     if (HttpContext.Session.GetInt32("UserId") != null)
     {
         ViewWrapper ViewWrapper = new ViewWrapper();
         ViewWrapper.Activity = dbContext.Activities
                                .Include(Activity => Activity.Creator)
                                .FirstOrDefault(Activity => Activity.ActivityId == ActivityId);
         if (ViewWrapper.Activity != null)
         {
             if (ViewWrapper.Activity.Creator.UserId == HttpContext.Session.GetInt32("UserId"))
             {
                 dbContext.Remove(ViewWrapper.Activity);
                 dbContext.SaveChanges();
             }
         }
         return(RedirectToAction("MainMenu"));
     }
     else
     {
         return(View("Index"));
     }
 }
        public IActionResult MainMenu()
        {
            if (HttpContext.Session.GetInt32("UserId") == null)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                ViewWrapper ViewWrapper = new ViewWrapper();
                //所有活动
                ViewWrapper.Activities = dbContext.Activities
                                         .OrderBy(prod => prod.Date)
                                         .Include(Activity => Activity.Creator)
                                         .Include(Activity => Activity.GuestsOfActivity)
                                         .ThenInclude(Activity => Activity.User)
                                         .ToList();
                //登录的用户
                ViewWrapper.User = dbContext.Users

                                   .FirstOrDefault(user => user.UserId == (int)HttpContext.Session.GetInt32("UserId"));
                return(View("MainMenu", ViewWrapper));
            }
        }
         public override View GetView(int position, View convertView, ViewGroup parent)
         {
             View view = convertView;
 
             ViewWrapper wrapper;
             RatingBar rate;    
            
             question item = this[position];
             if (view == null)
             {
                 view = context.LayoutInflater.Inflate(Resource.Layout.QuestionListViewItemLayout, parent, false);
                 wrapper = new ViewWrapper(view);
                 view.SetTag(Resource.Id.holder, wrapper);
                 rate = wrapper.getRatingBar();
                 rate.RatingBarChange += (o, e) =>
                 {
                     RatingBar ratingBar = o as RatingBar;
                     int myPosition = (int)ratingBar.GetTag(Resource.Id.holder);
                     question model = list[myPosition];
                     model.userrate = System.Convert.ToInt32(e.Rating);
                 };
             }
             else
             {
 
                 wrapper = (ViewWrapper)view.GetTag(Resource.Id.holder);
                 rate = wrapper.getRatingBar();
               
             }
 
             question model1 = list[position];
 
             wrapper.getLabel().Text = model1.text;
             rate.SetTag(Resource.Id.holder, position);
             rate.Rating = model1.userrate;
             return view;
         }
示例#21
0
        public void ViewImplSignal()
        {
            tlog.Debug(tag, $"ViewImplSignal START");

            using (ViewWrapperImpl impl = new ViewWrapperImpl(CustomViewBehaviour.ViewBehaviourDefault))
            {
                var testingTarget = new ViewWrapper("CustomView", impl);
                Assert.IsNotNull(testingTarget, "should be not null");
                Assert.IsInstanceOf <ViewWrapper>(testingTarget, "should be an instance of testing target class!");

                var signal = testingTarget.viewWrapperImpl.KeyEventSignal();
                Assert.IsInstanceOf <ControlKeySignal>(signal, "Should return ControlKeySignal instance.");

                var focusGained = testingTarget.viewWrapperImpl.KeyInputFocusGainedSignal();
                Assert.IsInstanceOf <KeyInputFocusSignal>(focusGained, "Should return ControlKeySignal instance.");

                var focusLost = testingTarget.viewWrapperImpl.KeyInputFocusLostSignal();
                Assert.IsInstanceOf <KeyInputFocusSignal>(focusLost, "Should return ControlKeySignal instance.");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ViewImplSignal (OK)");
        }
示例#22
0
        public void LoadTables()
        {
            var allTableNames = new string[]
            {
                #region Hard Coded Table Names
                //FYI: This list is from http://msdn.microsoft.com/en-us/library/2k3te2cs%28VS.100%29.aspx
                "ActionText",
                "AdminExecuteSequence ",
                "AdminUISequence",
                "AdvtExecuteSequence",
                "AdvtUISequence",
                "AppId",
                "AppSearch",
                "BBControl",
                "Billboard",
                "Binary",
                "BindImage",
                "CCPSearch",
                "CheckBox",
                "Class",
                "ComboBox",
                "CompLocator",
                "Complus",
                "Component",
                "Condition",
                "Control",
                "ControlCondition",
                "ControlEvent",
                "CreateFolder",
                "CustomAction",
                "Dialog",
                "Directory",
                "DrLocator",
                "DuplicateFile",
                "Environment",
                "Error",
                "EventMapping",
                "Extension",
                "Feature",
                "FeatureComponents",
                "File",
                "FileSFPCatalog",
                "Font",
                "Icon",
                "IniFile",
                "IniLocator",
                "InstallExecuteSequence",
                "InstallUISequence",
                "IsolatedComponent",
                "LaunchCondition",
                "ListBox",
                "ListView",
                "LockPermissions",
                "Media",
                "MIME",
                "MoveFile",
                "MsiAssembly",
                "MsiAssemblyName",
                "MsiDigitalCertificate",
                "MsiDigitalSignature",
                "MsiEmbeddedChainer",
                "MsiEmbeddedUI",
                "MsiFileHash",
                "MsiLockPermissionsEx Table",
                "MsiPackageCertificate",
                "MsiPatchCertificate",
                "MsiPatchHeaders",
                "MsiPatchMetadata",
                "MsiPatchOldAssemblyName",
                "MsiPatchOldAssemblyFile",
                "MsiPatchSequence",
                "MsiServiceConfig",
                "MsiServiceConfigFailureActions",
                "MsiSFCBypass",
                "ODBCAttribute",
                "ODBCDataSource",
                "ODBCDriver",
                "ODBCSourceAttribute",
                "ODBCTranslator",
                "Patch",
                "PatchPackage",
                "ProgId",
                "Property",
                "PublishComponent",
                "RadioButton",
                "Registry",
                "RegLocator",
                "RemoveFile",
                "RemoveIniFile",
                "RemoveRegistry",
                "ReserveCost",
                "SelfReg",
                "ServiceControl",
                "ServiceInstall",
                "SFPCatalog",
                "Shortcut",
                "Signature",
                "TextStyle",
                "TypeLib",
                "UIText",
                "Verb",
                "_Validation",
                "_Columns",
                "_Streams",
                "_Storages",
                "_Tables",
                "_TransformView Table",
                "Upgrade"
                #endregion
            };

            var systemTables = new string[]
            {
                "_Validation",
                "_Columns",
                "_Streams",
                "_Storages",
                "_Tables",
                "_TransformView Table"
            };

            IEnumerable <string> msiTableNames = allTableNames;

            using (var msidb = new Database(View.SelectedMsiFile.FullName, OpenDatabase.ReadOnly))
            {
                using (new DisposableCursor(View))
                {
                    try
                    {
                        Status("Loading list of tables...");
                        var query = "SELECT * FROM `_Tables`";
                        using (var msiTable = new ViewWrapper(msidb.OpenExecuteView(query)))
                        {
                            var tableNames = from record in msiTable.Records
                                             select record[0] as string;
                            //NOTE: system tables are not usually in the _Tables table.
                            var tempList = tableNames.ToList();
                            tempList.AddRange(systemTables);
                            msiTableNames = tempList.ToArray();
                        }

                        Status("");
                    }
                    catch (Exception e)
                    {
                        Status(e.Message);
                    }

                    View.cboTable.Items.Clear();
                    View.cboTable.Items.AddRange(msiTableNames.ToArray());
                    View.cboTable.SelectedIndex = 0;
                }
            }
        }
示例#23
0
 public void Initialize(PluginHost p, string pXML, string pWindowKey)
 {
     this.a = p.LoadViewResource(pXML);
 }
示例#24
0
		/// <summary>
		/// Constructs a new instance of a HudManager. You <b>must</b> also register
		///  the GraphicsReset() function for the PluginBase.GraphicsReset event.
		/// </summary>
		/// <param name="host">PluginBase.Host</param>
		/// <param name="core">PluginBase.Core</param>
		/// <param name="startHeartbeatNow">If this is true, the heartbeat 
		///		timer will start ticking right away. This is generally 
		///		undesirable if this HudManager is created in the Startup() 
		///		method of the plugin. If this is false, you must call 
		///		<see cref="StartHeartbeat()"/> at a later time, such as during 
		///		the PlayerLogin event.</param>
		public HudManager(PluginHost host, CoreManager core, ViewWrapper defaultView, DefaultViewActiveDelegate defaultViewActive, bool startHeartbeatNow)
		{
			mHost = host;
			mCore = core;
			mDefaultView = defaultView;
			mDefaultViewActive = defaultViewActive;

			mToolTip = new ToolTipHud(this);

			mRepaintHeartbeat = new DecalTimer();
			mRepaintHeartbeat.Timeout += new Decal.Interop.Input.ITimerEvents_TimeoutEventHandler(RepaintHeartbeatDispatch);
			if (startHeartbeatNow)
				StartHeartbeat();

			//Core.WindowMessage += new EventHandler<WindowMessageEventArgs>(WindowMessageDispatch);
		}
 private void OnViewWrapperTogglePaneButtonRectChanged(ViewWrapper sender, Rect e)
 {
     this.TitleBar.Margin = new Thickness(e.Right, 0, 0, 0);
 }
示例#26
0
 public void InitializeRawXML(PluginHost p, string pXML, string pWindowKey)
 {
     this.a = p.LoadView(pXML);
 }
示例#27
0
        public override void Run(List <string> args)
        {
            /* examples:
             *	lessmsi l -t Component c:\theinstall.msi
             *	lessmsi l -t Property c:\theinstall.msi
             */
            args = args.Skip(1).ToList();
            var tableName = "";
            var options   = new OptionSet {
                { "t=", "Specifies the table to list.", t => tableName = t }
            };
            var extra = options.Parse(args);

            if (extra.Count < 1)
            {
                throw new OptionException("You must specify the msi file to list from.", "l");
            }
            if (string.IsNullOrEmpty(tableName))
            {
                throw new OptionException("You must specify the table name to list.", "t");
            }

            var csv = new StringBuilder();

            Debug.Print("Opening msi file '{0}'.", extra[0]);
            using (var msidb = new Database(extra[0], OpenDatabase.ReadOnly))
            {
                Debug.Print("Opening table '{0}'.", tableName);
                var query = string.Format(CultureInfo.InvariantCulture, "SELECT * FROM `{0}`", tableName);
                using (var view = new ViewWrapper(msidb.OpenExecuteView(query)))
                {
                    for (var index = 0; index < view.Columns.Length; index++)
                    {
                        var col = view.Columns[index];
                        if (index > 0)
                        {
                            csv.Append(',');
                        }
                        csv.Append(col.Name);
                    }
                    csv.AppendLine();
                    foreach (var row in view.Records)
                    {
                        for (var colIndex = 0; colIndex < row.Length; colIndex++)
                        {
                            if (colIndex > 0)
                            {
                                csv.Append(',');
                            }
                            var      val                = Convert.ToString(row[colIndex], CultureInfo.InvariantCulture);
                            var      newLine            = Environment.NewLine;
                            string[] requireEscapeChars = { ",", newLine };
                            Array.ForEach(requireEscapeChars, s => {
                                if (val.Contains(s))
                                {
                                    val = "\"" + val + "\"";
                                }
                            });
                            csv.Append(val);
                        }
                        csv.AppendLine();
                    }
                }
            }
            Console.Write(csv.ToString());
        }
示例#28
0
		/// <summary>
		/// Cleans up the HudManager and Disposes all windows that are 
		/// being managed by this HudManager. Use this function when the 
		/// plugin is shutting down. Also be sure to unregister 
		/// <see cref="GraphicsReset()"/> from the GraphicsReset event.
		/// </summary>
		public void Dispose()
		{
			if (Disposed)
				return;

			if (mRepaintHeartbeat.Running)
				mRepaintHeartbeat.Stop();
			mRepaintHeartbeat.Timeout -= RepaintHeartbeatDispatch;
			mRepaintHeartbeat = null;

			//Core.WindowMessage -= WindowMessageDispatch;

			// Need to use a copy of the list because the Dispose() method of 
			// windows modifies mWindowList.
			UpdateHudsListCopy();
			foreach (IManagedHud hud in mHudsListCopy)
			{
				hud.Dispose();
			}
			mHudsOnTopList.Clear();
			mHudsList.Clear();
			mHudsListCopy.Clear();

			mHost = null;
			mCore = null;
			mDefaultView = null;
			mDefaultViewActive = null;

			mDisposed = true;
		}