void UpdateVersionString(bool updateIni) { if (updating) { return; } VFlags flags = 0; if (comboBoxSemVer.SelectedIndex == 1) { flags |= VFlags.Version2; } if (updateIni) { flags |= VFlags.UpdateIni; } if (checkBoxAddConfig.Checked) { flags |= VFlags.MetaWithConfig; } if (checkBoxAddDateTime.Checked) { flags |= VFlags.MetaWithDateTime; } textBoxVersion.Text = BuildVersionString(flags); }
} // public void setSelectedSymbol() public void saveCurrentMark() { // call from window.save button log("VRedlineImpl.saveCurrentMark"); setSelectedSymbol(); // write attribs to Graphic item markState = VFlags.Saved; MapApplication.Current.HideWindow(frmAttribs); } // public void saveCurrentMark()
} // void gl_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e) private void editMarker(Graphic gr) { // call from 'gl_MouseLeftButtonDown' //log(string.Format("editMarker")); var aType = gr.Attributes["aType"]; var aID = gr.Attributes["aID"]; log(string.Format("editMarker, type=[{0}], id=[{1}]", aType, aID)); currGeom = gr.Geometry; currMark = gr; markState = VFlags.Saved; showMarkForm(); } // private void editMarker(Graphic gr)
} // public void saveCurrentMark() /// <summary> /// Remove mark from layer; /// call from RLAttribsForm.remove button /// </summary> public void removeCurrentMark() { log("VRedlineImpl.removeCurrentMark"); if (currMark == null || markState == VFlags.Deleted) { log("currMark is null"); return; } var gl = getRLLayer(); gl.Graphics.Remove(currMark); marks.Remove(currMark); markState = VFlags.Deleted; MapApplication.Current.HideWindow(frmAttribs); } // public void removeCurrentMark()
} // evtOnDrawEnabledChanged /// <summary> /// Call from Map when user stop draw current mark. /// Example says: /// ESRI.ArcGIS.Client.Graphic graphic = new ESRI.ArcGIS.Client.Graphic() /// { Geometry = args.Geometry, Symbol = _activeSymbol }; /// graphicsLayer.Graphics.Add(graphic); /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void evtDrawComplete(object sender, DrawEventArgs e) { log(string.Format("VRedlineImpl.evtDrawComplete, SR={0}", e.Geometry.SpatialReference.WKID)); currGeom = e.Geometry; markState = VFlags.New; frmElement.disabledDrawInternally = true; draw.DrawMode = DrawMode.None; draw.IsEnabled = false; try { //init form currMark = null; frmAttribs.IsEnabled = false; frmAttribs.tbID.Text = Guid.NewGuid().ToString(); frmAttribs.tbName.Text = "Название"; frmAttribs.tbDescr.Text = "Описание"; // symbols setFormMarkType(); frmAttribs.IsEnabled = true; // new mark from form data currMark = newMark(); // add mark to layer setSelectedSymbol(); //showMarkForm MapApplication.Current.ShowWindow("Атрибуты пометки", frmAttribs, false, evtBeforeHideAttrForm, evtAfterHideAttrForm, WindowType.Floating); } catch (Exception ex) { string msg = string.Format("Сбой создания маркера: \n [{0}]", ex.Message); MessageBox.Show(msg); log(msg); } } // private void evtDrawComplete(object sender, DrawEventArgs e)
public DebuggerValue(Debugger debugger, CorValue value) { debugger.Dispatcher.VerifyAccess(); this.debugger = debugger; this.CorValue = value; this.hashCode = value.GetHashCode(); this.address = value.Address; this.size = value.Size; this.elementType = (CorElementType)value.ElementType; this.vflags = 0; if (value.IsGeneric) { this.vflags |= VFlags.Generic; } if (value.IsReference) { this.vflags |= VFlags.Reference; if (value.IsNull) { this.vflags |= VFlags.Null; } } if (value.IsHandle) { this.vflags |= VFlags.Handle; } if (value.IsArray) { this.vflags |= VFlags.Array; } if (value.IsBox) { this.vflags |= VFlags.Box; } if (value.IsString) { this.vflags |= VFlags.String; } if (value.IsObject) { this.vflags |= VFlags.Object; if (value.IsValueClass) { this.vflags |= VFlags.ValueClass; } } if (value.IsContext) { this.vflags |= VFlags.Context; } if (value.IsComObject) { this.vflags |= VFlags.ComObject; } if (value.IsExceptionObject) { this.vflags |= VFlags.ExObject; } if (value.IsHeap) { this.vflags |= VFlags.Heap; } }
public DebuggerValue(Debugger debugger, CorValue value) { debugger.Dispatcher.VerifyAccess(); this.debugger = debugger; CorValue = value; hashCode = value.GetHashCode(); address = value.Address; size = value.Size; elementType = (CorElementType)value.ElementType; vflags = 0; if (value.IsGeneric) vflags |= VFlags.Generic; if (value.IsReference) { vflags |= VFlags.Reference; if (value.IsNull) vflags |= VFlags.Null; } if (value.IsHandle) vflags |= VFlags.Handle; if (value.IsArray) vflags |= VFlags.Array; if (value.IsBox) vflags |= VFlags.Box; if (value.IsString) vflags |= VFlags.String; if (value.IsObject) { vflags |= VFlags.Object; if (value.IsValueClass) vflags |= VFlags.ValueClass; } if (value.IsContext) vflags |= VFlags.Context; if (value.IsComObject) vflags |= VFlags.ComObject; if (value.IsExceptionObject) vflags |= VFlags.ExObject; if (value.IsHeap) vflags |= VFlags.Heap; }
string BuildVersionString(VFlags flags) { bool metaWithConfig = flags.HasFlag(VFlags.MetaWithConfig); bool metaWithDateTime = flags.HasFlag(VFlags.MetaWithDateTime); bool updateIni = flags.HasFlag(VFlags.UpdateIni); bool version2 = flags.HasFlag(VFlags.Version2); if ((metaWithConfig || metaWithDateTime) && updateIni) { //ini should never contain additional meta, so update without it BuildVersionString(flags & ~VFlags.MetaWithConfig & ~VFlags.MetaWithDateTime); updateIni = false; } int patch; if (!int.TryParse(textBoxMajor.Text, out int major)) { major = 1; } if (!int.TryParse(textBoxMinor.Text, out int minor)) { minor = 0; } if (string.IsNullOrWhiteSpace(textBoxPatch.Text)) { patch = -1; } else if (!int.TryParse(textBoxPatch.Text, out patch)) { patch = 0; } StringBuilder sb = new StringBuilder(); sb.Append(major); sb.Append('.'); sb.Append(minor); if (patch > -1) { sb.Append('.'); sb.Append(patch); } string meta = GetMeta(metaWithConfig, metaWithDateTime, version2); if (!version2) { if (!string.IsNullOrWhiteSpace(meta)) { string s = $"{meta}"; s = s.Split(".-+".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Join("-"); sb.Append('-'); sb.Append(s); } } else { if (!string.IsNullOrWhiteSpace(meta)) { if (!meta.StartsWith("-") && !meta.StartsWith("+")) { sb.Append('-'); } sb.Append(meta); } } if (updateIni) { if (ini.HasSection("Version")) { ini.RemoveSection("Version"); } ini.WriteSetting("Version", "AddConfig", checkBoxAddConfig.Checked.ToString()); ini.WriteSetting("Version", "AddDateTime", checkBoxAddDateTime.Checked.ToString()); ini.WriteSetting("Version", "Major", major.ToString()); ini.WriteSetting("Version", "Minor", minor.ToString()); ini.WriteSetting("Version", "Patch", patch.ToString()); ini.WriteSetting("Version", "Meta", meta); ini.WriteSetting("Version", "Type", comboBoxSemVer.SelectedIndex.ToString()); ini.WriteSetting("Version", "Full", sb.ToString()); } return(sb.ToString()); }